acp-sdk 0.2.5__py3-none-any.whl → 0.3.1__py3-none-any.whl

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.
acp_sdk/models/models.py CHANGED
@@ -75,12 +75,18 @@ class RunStatus(str, Enum):
75
75
  return self in terminal_states
76
76
 
77
77
 
78
- class AwaitRequest(BaseModel):
79
- type: Literal["placeholder"] = "placeholder"
78
+ class MessageAwaitRequest(BaseModel):
79
+ type: Literal["message"] = "message"
80
+ message: Message
81
+
82
+
83
+ class MessageAwaitResume(BaseModel):
84
+ type: Literal["message"] = "message"
85
+ message: Message
80
86
 
81
87
 
82
- class AwaitResume(BaseModel):
83
- pass
88
+ AwaitRequest = Union[MessageAwaitRequest]
89
+ AwaitResume = Union[MessageAwaitResume]
84
90
 
85
91
 
86
92
  class Run(BaseModel):
acp_sdk/server/app.py CHANGED
@@ -144,6 +144,16 @@ def create_app(*agents: Agent) -> FastAPI:
144
144
  @app.post("/runs/{run_id}")
145
145
  async def resume_run(run_id: RunId, request: RunResumeRequest) -> RunResumeResponse:
146
146
  bundle = find_run_bundle(run_id)
147
+
148
+ if bundle.run.await_request is None:
149
+ raise HTTPException(status_code=status.HTTP_403_FORBIDDEN, detail=f"Run {run_id} has no await request")
150
+
151
+ if bundle.run.await_request.type != request.await_resume.type:
152
+ raise HTTPException(
153
+ status_code=status.HTTP_403_FORBIDDEN,
154
+ detail=f"Run {run_id} is expecting resume of type {bundle.run.await_request.type}",
155
+ )
156
+
147
157
  await bundle.resume(request.await_resume)
148
158
  match request.mode:
149
159
  case RunMode.STREAM:
acp_sdk/server/bundle.py CHANGED
@@ -129,6 +129,8 @@ class RunBundle:
129
129
  run_logger.info("Run resumed")
130
130
  elif isinstance(next, Error):
131
131
  raise ACPError(error=next)
132
+ elif next is None:
133
+ pass # Do nothing
132
134
  else:
133
135
  try:
134
136
  generic = AnyModel.model_validate(next)
acp_sdk/server/types.py CHANGED
@@ -2,5 +2,5 @@ from typing import Any
2
2
 
3
3
  from acp_sdk.models import AwaitRequest, AwaitResume, Message
4
4
 
5
- RunYield = Message | AwaitRequest | dict[str | Any]
5
+ RunYield = Message | AwaitRequest | dict[str | Any] | None
6
6
  RunYieldResume = AwaitResume | None
@@ -1,23 +1,21 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: acp-sdk
3
- Version: 0.2.5
3
+ Version: 0.3.1
4
4
  Summary: Agent Communication Protocol SDK
5
5
  Author: IBM Corp.
6
6
  Maintainer-email: Tomas Pilar <thomas7pilar@gmail.com>
7
7
  License-Expression: Apache-2.0
8
8
  Requires-Python: <4.0,>=3.11
9
+ Requires-Dist: fastapi[standard]>=0.115.8
10
+ Requires-Dist: httpx-sse>=0.4.0
11
+ Requires-Dist: httpx>=0.28.1
12
+ Requires-Dist: janus>=2.0.0
9
13
  Requires-Dist: opentelemetry-api>=1.31.1
14
+ Requires-Dist: opentelemetry-exporter-otlp-proto-http>=1.31.1
15
+ Requires-Dist: opentelemetry-instrumentation-fastapi>=0.52b1
16
+ Requires-Dist: opentelemetry-instrumentation-httpx>=0.52b1
17
+ Requires-Dist: opentelemetry-sdk>=1.31.1
10
18
  Requires-Dist: pydantic>=2.11.1
11
- Provides-Extra: client
12
- Requires-Dist: httpx-sse>=0.4.0; extra == 'client'
13
- Requires-Dist: httpx>=0.28.1; extra == 'client'
14
- Requires-Dist: opentelemetry-instrumentation-httpx>=0.52b1; extra == 'client'
15
- Provides-Extra: server
16
- Requires-Dist: fastapi[standard]>=0.115.8; extra == 'server'
17
- Requires-Dist: janus>=2.0.0; extra == 'server'
18
- Requires-Dist: opentelemetry-exporter-otlp-proto-http>=1.31.1; extra == 'server'
19
- Requires-Dist: opentelemetry-instrumentation-fastapi>=0.52b1; extra == 'server'
20
- Requires-Dist: opentelemetry-sdk>=1.31.1; extra == 'server'
21
19
  Description-Content-Type: text/markdown
22
20
 
23
21
  # Agent Communication Protocol SDK for Python
@@ -30,19 +28,7 @@ Agent Communication Protocol SDK for Python provides allows developers to serve
30
28
 
31
29
  ## Installation
32
30
 
33
- Install to use client:
34
-
35
- ```shell
36
- pip install acp-sdk[client]
37
- ```
38
-
39
- Install to use server:
40
-
41
- ```shell
42
- pip install acp-sdk[server]
43
- ```
44
-
45
- Install to use models only:
31
+ Install with:
46
32
 
47
33
  ```shell
48
34
  pip install acp-sdk
@@ -6,20 +6,20 @@ acp_sdk/client/__init__.py,sha256=Bca1DORrswxzZsrR2aUFpATuNG2xNSmYvF1Z2WJaVbc,51
6
6
  acp_sdk/client/client.py,sha256=lEUs0Oc7MZbKkTF2E6e8Wn3dTW5cMVj6fD8TbuEOMDk,6584
7
7
  acp_sdk/models/__init__.py,sha256=numSDBDT1QHx7n_Y3Deb5VOvKWcUBxbOEaMwQBSRHxc,151
8
8
  acp_sdk/models/errors.py,sha256=rEyaMVvQuBi7fwWe_d0PGGySYsD3FZTluQ-SkC0yhAs,444
9
- acp_sdk/models/models.py,sha256=Z8qgURpz18uPXpYDYmlbMQ3Du9-hrJUE3GVPf7ufdUY,3994
9
+ acp_sdk/models/models.py,sha256=GjsVvP5NVlW_9pbi47vBZA94WRL8bcMzbWIebwZuJGs,4158
10
10
  acp_sdk/models/schemas.py,sha256=Kj7drJSR8d-N3KHzu_qTnLdagrMtAyhid5swluuhHTw,645
11
11
  acp_sdk/server/__init__.py,sha256=mxBBBFaZuMEUENRMLwp1XZkuLeT9QghcFmNvjnqvAAU,377
12
12
  acp_sdk/server/agent.py,sha256=fGky5MIuknw-Gy-THqhWLt9I9-gUyNIar8qEAvZb3uQ,6195
13
- acp_sdk/server/app.py,sha256=qLeQ1STgX8_7cRtG-7Be6V5vS9ooBq6O89cQryqBdII,5903
14
- acp_sdk/server/bundle.py,sha256=VchPUW8URH83-qJo9kRQsYCBcuLKbxGXHB3sw9CK0cc,6178
13
+ acp_sdk/server/app.py,sha256=3QJzGi05DKoIKyTeYYKKQhcYz4qorQKmVI94_guVkEY,6340
14
+ acp_sdk/server/bundle.py,sha256=6LZnxsP1rawxic9CwDAQCsOV1v31qNI9meKXMty_yWg,6260
15
15
  acp_sdk/server/context.py,sha256=MgnLV6qcDIhc_0BjW7r4Jj1tHts4ZuwpdTGIBnz2Mgo,1036
16
16
  acp_sdk/server/errors.py,sha256=IGtpPpb2ChtYvCac8kf_P-RkcY71gBvX0yq97uZWa-w,2104
17
17
  acp_sdk/server/logging.py,sha256=Oc8yZigCsuDnHHPsarRzu0RX3NKaLEgpELM2yovGKDI,411
18
18
  acp_sdk/server/server.py,sha256=-eT3fmnEsBUN44Spi2EP2eV0l4RAlKa8bzqxnhz16SM,5399
19
19
  acp_sdk/server/session.py,sha256=0cDr924HC5x2bBNbK9NSKVHAt5A_mi5dK8P4jP_ugq0,629
20
20
  acp_sdk/server/telemetry.py,sha256=1BUxNg-xL_Vqgs27PDWNc3HikrQW2lidAtT_FKlp_Qk,1833
21
- acp_sdk/server/types.py,sha256=1bqMCjwZM3JzvJ1h4aBHWzjbldMQ45HqcezBD6hUoYo,175
21
+ acp_sdk/server/types.py,sha256=E0_9xWwgGzyvJjxtbeBBmSbIPhbbTSXLpHFL5dZDzxI,182
22
22
  acp_sdk/server/utils.py,sha256=EfrF9VCyVk3AM_ao-BIB9EzGbfTrh4V2Bz-VFr6f6Sg,351
23
- acp_sdk-0.2.5.dist-info/METADATA,sha256=ovtFlDH-TAiF1iW3-elh0-69d9A5h-Poaw1yheSrFvM,3463
24
- acp_sdk-0.2.5.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
25
- acp_sdk-0.2.5.dist-info/RECORD,,
23
+ acp_sdk-0.3.1.dist-info/METADATA,sha256=Eng_oiR7OIfJK3XDKIAjlmlFX8eHoVqxkd_6XIVpXlQ,3119
24
+ acp_sdk-0.3.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
25
+ acp_sdk-0.3.1.dist-info/RECORD,,