acp-sdk 0.6.0__tar.gz → 0.7.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. {acp_sdk-0.6.0 → acp_sdk-0.7.0}/PKG-INFO +1 -1
  2. {acp_sdk-0.6.0 → acp_sdk-0.7.0}/docs/client.md +1 -1
  3. {acp_sdk-0.6.0 → acp_sdk-0.7.0}/pyproject.toml +1 -1
  4. {acp_sdk-0.6.0 → acp_sdk-0.7.0}/src/acp_sdk/client/client.py +3 -3
  5. {acp_sdk-0.6.0 → acp_sdk-0.7.0}/src/acp_sdk/models/models.py +1 -1
  6. {acp_sdk-0.6.0 → acp_sdk-0.7.0}/src/acp_sdk/models/schemas.py +1 -1
  7. {acp_sdk-0.6.0 → acp_sdk-0.7.0}/src/acp_sdk/server/app.py +1 -1
  8. {acp_sdk-0.6.0 → acp_sdk-0.7.0}/src/acp_sdk/server/bundle.py +5 -5
  9. {acp_sdk-0.6.0 → acp_sdk-0.7.0}/src/acp_sdk/server/session.py +1 -1
  10. acp_sdk-0.7.0/tests/e2e/test_suites/test_discovery.py +18 -0
  11. {acp_sdk-0.6.0 → acp_sdk-0.7.0}/tests/e2e/test_suites/test_runs.py +15 -15
  12. {acp_sdk-0.6.0 → acp_sdk-0.7.0}/tests/unit/client/test_client.py +1 -1
  13. {acp_sdk-0.6.0 → acp_sdk-0.7.0}/.gitignore +0 -0
  14. {acp_sdk-0.6.0 → acp_sdk-0.7.0}/.python-version +0 -0
  15. {acp_sdk-0.6.0 → acp_sdk-0.7.0}/README.md +0 -0
  16. {acp_sdk-0.6.0 → acp_sdk-0.7.0}/docs/_sidebar.md +0 -0
  17. {acp_sdk-0.6.0 → acp_sdk-0.7.0}/docs/index.html +0 -0
  18. {acp_sdk-0.6.0 → acp_sdk-0.7.0}/docs/models.md +0 -0
  19. {acp_sdk-0.6.0 → acp_sdk-0.7.0}/docs/server.md +0 -0
  20. {acp_sdk-0.6.0 → acp_sdk-0.7.0}/pytest.ini +0 -0
  21. {acp_sdk-0.6.0 → acp_sdk-0.7.0}/src/acp_sdk/__init__.py +0 -0
  22. {acp_sdk-0.6.0 → acp_sdk-0.7.0}/src/acp_sdk/client/__init__.py +0 -0
  23. {acp_sdk-0.6.0 → acp_sdk-0.7.0}/src/acp_sdk/instrumentation.py +0 -0
  24. {acp_sdk-0.6.0 → acp_sdk-0.7.0}/src/acp_sdk/models/__init__.py +0 -0
  25. {acp_sdk-0.6.0 → acp_sdk-0.7.0}/src/acp_sdk/models/errors.py +0 -0
  26. {acp_sdk-0.6.0 → acp_sdk-0.7.0}/src/acp_sdk/py.typed +0 -0
  27. {acp_sdk-0.6.0 → acp_sdk-0.7.0}/src/acp_sdk/server/__init__.py +0 -0
  28. {acp_sdk-0.6.0 → acp_sdk-0.7.0}/src/acp_sdk/server/agent.py +0 -0
  29. {acp_sdk-0.6.0 → acp_sdk-0.7.0}/src/acp_sdk/server/context.py +0 -0
  30. {acp_sdk-0.6.0 → acp_sdk-0.7.0}/src/acp_sdk/server/errors.py +0 -0
  31. {acp_sdk-0.6.0 → acp_sdk-0.7.0}/src/acp_sdk/server/logging.py +0 -0
  32. {acp_sdk-0.6.0 → acp_sdk-0.7.0}/src/acp_sdk/server/server.py +0 -0
  33. {acp_sdk-0.6.0 → acp_sdk-0.7.0}/src/acp_sdk/server/telemetry.py +0 -0
  34. {acp_sdk-0.6.0 → acp_sdk-0.7.0}/src/acp_sdk/server/types.py +0 -0
  35. {acp_sdk-0.6.0 → acp_sdk-0.7.0}/src/acp_sdk/server/utils.py +0 -0
  36. {acp_sdk-0.6.0 → acp_sdk-0.7.0}/src/acp_sdk/version.py +0 -0
  37. {acp_sdk-0.6.0 → acp_sdk-0.7.0}/tests/conftest.py +0 -0
  38. {acp_sdk-0.6.0 → acp_sdk-0.7.0}/tests/e2e/__init__.py +0 -0
  39. {acp_sdk-0.6.0 → acp_sdk-0.7.0}/tests/e2e/config.py +0 -0
  40. {acp_sdk-0.6.0 → acp_sdk-0.7.0}/tests/e2e/fixtures/__init__.py +0 -0
  41. {acp_sdk-0.6.0 → acp_sdk-0.7.0}/tests/e2e/fixtures/client.py +0 -0
  42. {acp_sdk-0.6.0 → acp_sdk-0.7.0}/tests/e2e/fixtures/server.py +0 -0
  43. {acp_sdk-0.6.0 → acp_sdk-0.7.0}/tests/e2e/test_suites/__init__.py +0 -0
  44. {acp_sdk-0.6.0 → acp_sdk-0.7.0}/tests/unit/models/__init__.py +0 -0
  45. {acp_sdk-0.6.0 → acp_sdk-0.7.0}/tests/unit/models/test_models.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: acp-sdk
3
- Version: 0.6.0
3
+ Version: 0.7.0
4
4
  Summary: Agent Communication Protocol SDK
5
5
  Author: IBM Corp.
6
6
  Maintainer-email: Tomas Pilar <thomas7pilar@gmail.com>
@@ -76,7 +76,7 @@ async with Client(base_url="http://localhost:8000") as client:
76
76
 
77
77
  # Sync - waits for completion, failure, cancellation or await
78
78
  run = await client.run_sync(agent_name="agent", inputs=[message])
79
- print(run.outputs)
79
+ print(run.output)
80
80
 
81
81
  # Stream - as sync but also receives events
82
82
  async for event in client.run_stream(agent_name="agent", inputs=[message])
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "acp-sdk"
3
- version = "0.6.0"
3
+ version = "0.7.0"
4
4
  description = "Agent Communication Protocol SDK"
5
5
  license = "Apache-2.0"
6
6
  readme = "README.md"
@@ -127,7 +127,7 @@ class Client:
127
127
  "/runs",
128
128
  content=RunCreateRequest(
129
129
  agent_name=agent,
130
- inputs=self._unify_inputs(input),
130
+ input=self._unify_inputs(input),
131
131
  mode=RunMode.SYNC,
132
132
  session_id=self._session_id,
133
133
  ).model_dump_json(),
@@ -142,7 +142,7 @@ class Client:
142
142
  "/runs",
143
143
  content=RunCreateRequest(
144
144
  agent_name=agent,
145
- inputs=self._unify_inputs(input),
145
+ input=self._unify_inputs(input),
146
146
  mode=RunMode.ASYNC,
147
147
  session_id=self._session_id,
148
148
  ).model_dump_json(),
@@ -159,7 +159,7 @@ class Client:
159
159
  "/runs",
160
160
  content=RunCreateRequest(
161
161
  agent_name=agent,
162
- inputs=self._unify_inputs(input),
162
+ input=self._unify_inputs(input),
163
163
  mode=RunMode.STREAM,
164
164
  session_id=self._session_id,
165
165
  ).model_dump_json(),
@@ -177,7 +177,7 @@ class Run(BaseModel):
177
177
  session_id: SessionId | None = None
178
178
  status: RunStatus = RunStatus.CREATED
179
179
  await_request: AwaitRequest | None = None
180
- outputs: list[Message] = []
180
+ output: list[Message] = []
181
181
  error: Error | None = None
182
182
 
183
183
 
@@ -14,7 +14,7 @@ class AgentReadResponse(Agent):
14
14
  class RunCreateRequest(BaseModel):
15
15
  agent_name: AgentName
16
16
  session_id: SessionId | None = None
17
- inputs: list[Message]
17
+ input: list[Message]
18
18
  mode: RunMode = RunMode.SYNC
19
19
 
20
20
 
@@ -105,7 +105,7 @@ def create_app(*agents: Agent, run_limit: int = 1000, run_ttl: timedelta = timed
105
105
  bundle = RunBundle(
106
106
  agent=agent,
107
107
  run=Run(agent_name=agent.name, session_id=session.id),
108
- inputs=request.inputs,
108
+ inputs=request.input,
109
109
  history=list(session.history()),
110
110
  executor=executor,
111
111
  )
@@ -92,7 +92,7 @@ class RunBundle:
92
92
  async def flush_message() -> None:
93
93
  nonlocal in_message
94
94
  if in_message:
95
- await self.emit(MessageCompletedEvent(message=self.run.outputs[-1]))
95
+ await self.emit(MessageCompletedEvent(message=self.run.output[-1]))
96
96
  in_message = False
97
97
 
98
98
  try:
@@ -114,14 +114,14 @@ class RunBundle:
114
114
  if isinstance(next, str):
115
115
  next = MessagePart(content=next)
116
116
  if not in_message:
117
- self.run.outputs.append(Message(parts=[]))
117
+ self.run.output.append(Message(parts=[]))
118
118
  in_message = True
119
- await self.emit(MessageCreatedEvent(message=self.run.outputs[-1]))
120
- self.run.outputs[-1].parts.append(next)
119
+ await self.emit(MessageCreatedEvent(message=self.run.output[-1]))
120
+ self.run.output[-1].parts.append(next)
121
121
  await self.emit(MessagePartEvent(part=next))
122
122
  elif isinstance(next, Message):
123
123
  await flush_message()
124
- self.run.outputs.append(next)
124
+ self.run.output.append(next)
125
125
  await self.emit(MessageCreatedEvent(message=next))
126
126
  for part in next.parts:
127
127
  await self.emit(MessagePartEvent(part=part))
@@ -18,4 +18,4 @@ class Session:
18
18
  for bundle in self.bundles:
19
19
  if bundle.run.status == RunStatus.COMPLETED:
20
20
  yield from bundle.inputs
21
- yield from bundle.run.outputs
21
+ yield from bundle.run.output
@@ -0,0 +1,18 @@
1
+ import pytest
2
+ from acp_sdk.client import Client
3
+ from acp_sdk.models import Agent
4
+ from acp_sdk.server import Server
5
+
6
+
7
+ @pytest.mark.asyncio
8
+ async def test_agents_list(server: Server, client: Client) -> None:
9
+ async for agent in client.agents():
10
+ assert isinstance(agent, Agent)
11
+
12
+
13
+ @pytest.mark.asyncio
14
+ async def test_agents_details(server: Server, client: Client) -> None:
15
+ agent_name = "echo"
16
+ agent = await client.agent(name=agent_name)
17
+ assert isinstance(agent, Agent)
18
+ assert agent.name == agent_name
@@ -27,7 +27,7 @@ await_resume = MessageAwaitResume(message=Message(parts=[]))
27
27
  async def test_run_sync(server: Server, client: Client) -> None:
28
28
  run = await client.run_sync(agent="echo", input=inputs)
29
29
  assert run.status == RunStatus.COMPLETED
30
- assert run.outputs == inputs
30
+ assert run.output == inputs
31
31
 
32
32
 
33
33
  @pytest.mark.asyncio
@@ -102,18 +102,18 @@ async def test_run_resume_stream(server: Server, client: Client) -> None:
102
102
  async def test_run_session(server: Server, client: Client) -> None:
103
103
  async with client.session() as session:
104
104
  run = await session.run_sync(agent="echo", input=inputs)
105
- assert run.outputs == inputs
105
+ assert run.output == inputs
106
106
  run = await session.run_sync(agent="echo", input=inputs)
107
- assert run.outputs == inputs + inputs + inputs
107
+ assert run.output == inputs + inputs + inputs
108
108
 
109
109
 
110
110
  @pytest.mark.asyncio
111
111
  async def test_mime_types(server: Server, client: Client) -> None:
112
112
  run = await client.run_sync(agent="mime_types", input=inputs)
113
113
  assert run.status == RunStatus.COMPLETED
114
- assert len(run.outputs) == 1
114
+ assert len(run.output) == 1
115
115
 
116
- message_parts = run.outputs[0].parts
116
+ message_parts = run.output[0].parts
117
117
  content_types = [part.content_type for part in message_parts]
118
118
 
119
119
  assert "text/html" in content_types
@@ -132,9 +132,9 @@ async def test_mime_types(server: Server, client: Client) -> None:
132
132
  async def test_base64_encoding(server: Server, client: Client) -> None:
133
133
  run = await client.run_sync(agent="base64_encoding", input=inputs)
134
134
  assert run.status == RunStatus.COMPLETED
135
- assert len(run.outputs) == 1
135
+ assert len(run.output) == 1
136
136
 
137
- message_parts = run.outputs[0].parts
137
+ message_parts = run.output[0].parts
138
138
  assert len(message_parts) == 2
139
139
 
140
140
  base64_part = next((part for part in message_parts if part.content_encoding == "base64"), None)
@@ -153,14 +153,14 @@ async def test_artifacts(server: Server, client: Client) -> None:
153
153
  run = await client.run_sync(agent="artifact_producer", input=inputs)
154
154
  assert run.status == RunStatus.COMPLETED
155
155
 
156
- assert len(run.outputs) == 1
157
- assert run.outputs[0].parts[0].content == "Processing with artifacts"
156
+ assert len(run.output) == 1
157
+ assert run.output[0].parts[0].content == "Processing with artifacts"
158
158
 
159
- assert len(run.outputs[0].parts) == 4
159
+ assert len(run.output[0].parts) == 4
160
160
 
161
- text_artifact = next((a for a in run.outputs[0].parts if a.name == "text-result.txt"), None)
162
- json_artifact = next((a for a in run.outputs[0].parts if a.name == "data.json"), None)
163
- image_artifact = next((a for a in run.outputs[0].parts if a.name == "image.png"), None)
161
+ text_artifact = next((a for a in run.output[0].parts if a.name == "text-result.txt"), None)
162
+ json_artifact = next((a for a in run.output[0].parts if a.name == "data.json"), None)
163
+ image_artifact = next((a for a in run.output[0].parts if a.name == "image.png"), None)
164
164
 
165
165
  assert text_artifact is not None
166
166
  assert text_artifact.content_type == "text/plain"
@@ -221,7 +221,7 @@ async def test_session_ttl(server: Server, client: Client) -> None:
221
221
  run = await session.run_sync(agent="echo", input=inputs)
222
222
  await asyncio.sleep(3)
223
223
  run = await session.run_sync(agent="echo", input=inputs)
224
- assert len(run.outputs) == 3
224
+ assert len(run.output) == 3
225
225
  await asyncio.sleep(3)
226
226
  run = await session.run_sync(agent="echo", input=inputs)
227
- assert len(run.outputs) == 7 # First run shall be forgotten
227
+ assert len(run.output) == 7 # First run shall be forgotten
@@ -3,7 +3,7 @@ from acp_sdk.client import Client
3
3
  from acp_sdk.models import Message, MessagePart, Run, RunCompletedEvent
4
4
  from pytest_httpx import HTTPXMock
5
5
 
6
- mock_run = Run(agent_name="mock", outputs=[Message(parts=[MessagePart(content="Hello!")])])
6
+ mock_run = Run(agent_name="mock", output=[Message(parts=[MessagePart(content="Hello!")])])
7
7
 
8
8
 
9
9
  @pytest.mark.asyncio
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes