acp-sdk 0.2.2__py3-none-any.whl → 0.2.3__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/server/bundle.py
CHANGED
@@ -6,14 +6,18 @@ from concurrent.futures import ThreadPoolExecutor
|
|
6
6
|
from pydantic import ValidationError
|
7
7
|
|
8
8
|
from acp_sdk.models import (
|
9
|
+
ACPError,
|
9
10
|
AnyModel,
|
10
11
|
AwaitRequest,
|
11
12
|
AwaitResume,
|
12
13
|
Error,
|
14
|
+
ErrorCode,
|
13
15
|
Event,
|
14
16
|
GenericEvent,
|
15
17
|
Message,
|
18
|
+
MessageCompletedEvent,
|
16
19
|
MessageCreatedEvent,
|
20
|
+
MessagePart,
|
17
21
|
MessagePartEvent,
|
18
22
|
Run,
|
19
23
|
RunAwaitingEvent,
|
@@ -24,8 +28,6 @@ from acp_sdk.models import (
|
|
24
28
|
RunInProgressEvent,
|
25
29
|
RunStatus,
|
26
30
|
)
|
27
|
-
from acp_sdk.models.errors import ErrorCode
|
28
|
-
from acp_sdk.models.models import MessageCompletedEvent, MessagePart
|
29
31
|
from acp_sdk.server.agent import Agent
|
30
32
|
from acp_sdk.server.logging import logger
|
31
33
|
from acp_sdk.server.telemetry import get_tracer
|
@@ -142,7 +144,10 @@ class RunBundle:
|
|
142
144
|
await self.emit(RunCancelledEvent(run=self.run))
|
143
145
|
run_logger.info("Run cancelled")
|
144
146
|
except Exception as e:
|
145
|
-
|
147
|
+
if isinstance(e, ACPError):
|
148
|
+
self.run.error = e.error
|
149
|
+
else:
|
150
|
+
self.run.error = Error(code=ErrorCode.SERVER_ERROR, message=str(e))
|
146
151
|
self.run.status = RunStatus.FAILED
|
147
152
|
await self.emit(RunFailedEvent(run=self.run))
|
148
153
|
run_logger.exception("Run failed")
|
@@ -10,7 +10,7 @@ acp_sdk/models/schemas.py,sha256=Kj7drJSR8d-N3KHzu_qTnLdagrMtAyhid5swluuhHTw,645
|
|
10
10
|
acp_sdk/server/__init__.py,sha256=mxBBBFaZuMEUENRMLwp1XZkuLeT9QghcFmNvjnqvAAU,377
|
11
11
|
acp_sdk/server/agent.py,sha256=fGky5MIuknw-Gy-THqhWLt9I9-gUyNIar8qEAvZb3uQ,6195
|
12
12
|
acp_sdk/server/app.py,sha256=qLeQ1STgX8_7cRtG-7Be6V5vS9ooBq6O89cQryqBdII,5903
|
13
|
-
acp_sdk/server/bundle.py,sha256=
|
13
|
+
acp_sdk/server/bundle.py,sha256=89Iu6YjsaqGDmLcP4ScLPIP6oi08Lf2SFQr8WBQ9TK8,6078
|
14
14
|
acp_sdk/server/context.py,sha256=MgnLV6qcDIhc_0BjW7r4Jj1tHts4ZuwpdTGIBnz2Mgo,1036
|
15
15
|
acp_sdk/server/errors.py,sha256=fWlgVsQ5hs_AXwzc-wvy6QgoDWEMRUBlSrfJfhHHMyE,2085
|
16
16
|
acp_sdk/server/logging.py,sha256=Oc8yZigCsuDnHHPsarRzu0RX3NKaLEgpELM2yovGKDI,411
|
@@ -19,6 +19,6 @@ acp_sdk/server/session.py,sha256=0cDr924HC5x2bBNbK9NSKVHAt5A_mi5dK8P4jP_ugq0,629
|
|
19
19
|
acp_sdk/server/telemetry.py,sha256=WIEHK8syOTG9SyWi3Y-cos7CsCF5-IHGiyL9bCaUN0E,1921
|
20
20
|
acp_sdk/server/types.py,sha256=1bqMCjwZM3JzvJ1h4aBHWzjbldMQ45HqcezBD6hUoYo,175
|
21
21
|
acp_sdk/server/utils.py,sha256=EfrF9VCyVk3AM_ao-BIB9EzGbfTrh4V2Bz-VFr6f6Sg,351
|
22
|
-
acp_sdk-0.2.
|
23
|
-
acp_sdk-0.2.
|
24
|
-
acp_sdk-0.2.
|
22
|
+
acp_sdk-0.2.3.dist-info/METADATA,sha256=LwqB-ZDr3k6tz5lzjD3rEzWz-h5Ccu4W9AI5-EpACGQ,3463
|
23
|
+
acp_sdk-0.2.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
24
|
+
acp_sdk-0.2.3.dist-info/RECORD,,
|
File without changes
|