acp-sdk 0.12.1__py3-none-any.whl → 0.12.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/client/client.py
CHANGED
@@ -252,15 +252,10 @@ class Client:
|
|
252
252
|
base_url=base_url or self._session_last_refresh_base_url,
|
253
253
|
)
|
254
254
|
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
except ACPError as e:
|
260
|
-
if e.error.code == ErrorCode.NOT_FOUND:
|
261
|
-
pass
|
262
|
-
raise e
|
263
|
-
|
255
|
+
response = await self._client.get(url, timeout=timeout)
|
256
|
+
self._raise_error(response)
|
257
|
+
response = SessionReadResponse.model_validate(response.json())
|
258
|
+
self._session = Session(**response.model_dump())
|
264
259
|
return self._session
|
265
260
|
|
266
261
|
async def _validate_stream(
|
@@ -304,13 +299,11 @@ class Client:
|
|
304
299
|
|
305
300
|
target_base_url = self._create_base_url(base_url=base_url)
|
306
301
|
try:
|
307
|
-
if not self._session_last_refresh_base_url:
|
308
|
-
return {"session": self._session}
|
309
302
|
if self._session_last_refresh_base_url == target_base_url:
|
310
303
|
# Same server, no need to forward session
|
311
304
|
return {"session_id": self._session.id}
|
312
305
|
|
313
|
-
session = await self.refresh_session()
|
306
|
+
session = await self.refresh_session(base_url=self._session_last_refresh_base_url or target_base_url)
|
314
307
|
return {"session": session}
|
315
308
|
except ACPError as e:
|
316
309
|
if e.error.code == ErrorCode.NOT_FOUND:
|
acp_sdk/models/models.py
CHANGED
@@ -6,6 +6,7 @@ from enum import Enum
|
|
6
6
|
from typing import Any, Literal, Optional, Union
|
7
7
|
|
8
8
|
from pydantic import AnyUrl, BaseModel, ConfigDict, Field
|
9
|
+
from pydantic.json_schema import SkipJsonSchema
|
9
10
|
|
10
11
|
from acp_sdk.models.errors import ACPError, Error
|
11
12
|
from acp_sdk.models.platform import PlatformUIAnnotation
|
@@ -336,8 +337,8 @@ class Session(BaseModel):
|
|
336
337
|
history: list[ResourceUrl] = Field(default_factory=list)
|
337
338
|
state: ResourceUrl | None = None
|
338
339
|
|
339
|
-
loader: ResourceLoader | None = Field(None, exclude=True)
|
340
|
-
store: ResourceStore | None = Field(None, exclude=True)
|
340
|
+
loader: SkipJsonSchema[ResourceLoader | None] = Field(None, exclude=True)
|
341
|
+
store: SkipJsonSchema[ResourceStore | None] = Field(None, exclude=True)
|
341
342
|
|
342
343
|
model_config = ConfigDict(arbitrary_types_allowed=True)
|
343
344
|
|
@@ -3,12 +3,12 @@ acp_sdk/instrumentation.py,sha256=JqSyvILN3sGAfOZrmckQq4-M_4_5alyPn95DK0o5lfA,16
|
|
3
3
|
acp_sdk/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
4
4
|
acp_sdk/version.py,sha256=Niy83rgvigB4hL_rR-O4ySvI7dj6xnqkyOe_JTymi9s,73
|
5
5
|
acp_sdk/client/__init__.py,sha256=Bca1DORrswxzZsrR2aUFpATuNG2xNSmYvF1Z2WJaVbc,51
|
6
|
-
acp_sdk/client/client.py,sha256=
|
6
|
+
acp_sdk/client/client.py,sha256=3lQ0URQK2q6_QuADMhbbEijrWegaFRtAvfPDs2XnMS8,12591
|
7
7
|
acp_sdk/client/types.py,sha256=_H6zYt-2OHOOYRtssRnbDIiwmgsl2-KIXc9lb-mJLFA,133
|
8
8
|
acp_sdk/client/utils.py,sha256=2jhJyrPJmVFRoDJh0q_JMqOMlC3IxCh-6HXed-PIZS8,924
|
9
9
|
acp_sdk/models/__init__.py,sha256=_XDSvUwlHeRsqUayAxHusJ5s8Z1jWXV1ZcUKlJakOt4,200
|
10
10
|
acp_sdk/models/errors.py,sha256=rEyaMVvQuBi7fwWe_d0PGGySYsD3FZTluQ-SkC0yhAs,444
|
11
|
-
acp_sdk/models/models.py,sha256
|
11
|
+
acp_sdk/models/models.py,sha256=cSVVmj8tl1CuHUVK_sq7Fcnw8s-XEaOBCWlQTIf_7lo,10889
|
12
12
|
acp_sdk/models/platform.py,sha256=qgQhBZZNPG9XLlytEZmuv1LTkejbklmlj7YpnpUV_DE,497
|
13
13
|
acp_sdk/models/schemas.py,sha256=Vu3aO-6M0IW71I9thxAiphLGXXMvyZXFMJCdj7euUmc,915
|
14
14
|
acp_sdk/models/types.py,sha256=tH79qqpW3DrPJggZD1KFlLtGE_ZKT6eLtwiR3p3x2QM,145
|
@@ -32,6 +32,6 @@ acp_sdk/server/store/store.py,sha256=jGmYy9oiuVjhYYJY8QRo4g2J2Qyt1HLTmq_eHy4aI7c
|
|
32
32
|
acp_sdk/server/store/utils.py,sha256=JumEOMs1h1uGlnHnUGeguee-srGzT7_Y2NVEYt01QuY,92
|
33
33
|
acp_sdk/shared/__init__.py,sha256=vZuhdQ6lrWVdyYPmIyXpPvs5eMnzemhNek3gfYPA3Bc,138
|
34
34
|
acp_sdk/shared/resources.py,sha256=3oPvevYv2B1YaHyoMH85B7fcHVyhgZDUaDCBVEflTlA,1592
|
35
|
-
acp_sdk-0.12.
|
36
|
-
acp_sdk-0.12.
|
37
|
-
acp_sdk-0.12.
|
35
|
+
acp_sdk-0.12.3.dist-info/METADATA,sha256=RglEI7Eje0tSG0-insJiq7ZNwpnvrgm18FlRSRIUng8,1713
|
36
|
+
acp_sdk-0.12.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
37
|
+
acp_sdk-0.12.3.dist-info/RECORD,,
|
File without changes
|