spot-sdk-python 2.1.0b3__tar.gz → 2.1.1__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.
- {spot_sdk_python-2.1.0b3 → spot_sdk_python-2.1.1}/PKG-INFO +1 -1
- {spot_sdk_python-2.1.0b3 → spot_sdk_python-2.1.1}/pyproject.toml +1 -1
- {spot_sdk_python-2.1.0b3 → spot_sdk_python-2.1.1}/pyproject.toml.orig +1 -1
- {spot_sdk_python-2.1.0b3 → spot_sdk_python-2.1.1}/spot_sdk/hosting.py +13 -6
- {spot_sdk_python-2.1.0b3 → spot_sdk_python-2.1.1}/README.md +0 -0
- {spot_sdk_python-2.1.0b3 → spot_sdk_python-2.1.1}/spot_sdk/__init__.py +0 -0
- {spot_sdk_python-2.1.0b3 → spot_sdk_python-2.1.1}/spot_sdk/_json.py +0 -0
- {spot_sdk_python-2.1.0b3 → spot_sdk_python-2.1.1}/spot_sdk/app.py +0 -0
- {spot_sdk_python-2.1.0b3 → spot_sdk_python-2.1.1}/spot_sdk/artifacts.py +0 -0
- {spot_sdk_python-2.1.0b3 → spot_sdk_python-2.1.1}/spot_sdk/clients.py +0 -0
- {spot_sdk_python-2.1.0b3 → spot_sdk_python-2.1.1}/spot_sdk/config.py +0 -0
- {spot_sdk_python-2.1.0b3 → spot_sdk_python-2.1.1}/spot_sdk/correlation.py +0 -0
- {spot_sdk_python-2.1.0b3 → spot_sdk_python-2.1.1}/spot_sdk/email.py +0 -0
- {spot_sdk_python-2.1.0b3 → spot_sdk_python-2.1.1}/spot_sdk/errors.py +0 -0
- {spot_sdk_python-2.1.0b3 → spot_sdk_python-2.1.1}/spot_sdk/knowledge.py +0 -0
- {spot_sdk_python-2.1.0b3 → spot_sdk_python-2.1.1}/spot_sdk/knowledge_tags.py +0 -0
- {spot_sdk_python-2.1.0b3 → spot_sdk_python-2.1.1}/spot_sdk/llm.py +0 -0
- {spot_sdk_python-2.1.0b3 → spot_sdk_python-2.1.1}/spot_sdk/logging.py +0 -0
- {spot_sdk_python-2.1.0b3 → spot_sdk_python-2.1.1}/spot_sdk/manifest.py +0 -0
- {spot_sdk_python-2.1.0b3 → spot_sdk_python-2.1.1}/spot_sdk/mime.py +0 -0
- {spot_sdk_python-2.1.0b3 → spot_sdk_python-2.1.1}/spot_sdk/model_input.py +0 -0
- {spot_sdk_python-2.1.0b3 → spot_sdk_python-2.1.1}/spot_sdk/orchestrator.py +0 -0
- {spot_sdk_python-2.1.0b3 → spot_sdk_python-2.1.1}/spot_sdk/proxy.py +0 -0
- {spot_sdk_python-2.1.0b3 → spot_sdk_python-2.1.1}/spot_sdk/py.typed +0 -0
- {spot_sdk_python-2.1.0b3 → spot_sdk_python-2.1.1}/spot_sdk/retriever.py +0 -0
- {spot_sdk_python-2.1.0b3 → spot_sdk_python-2.1.1}/spot_sdk/settings.py +0 -0
- {spot_sdk_python-2.1.0b3 → spot_sdk_python-2.1.1}/spot_sdk/signals.py +0 -0
- {spot_sdk_python-2.1.0b3 → spot_sdk_python-2.1.1}/spot_sdk/testing/README.md +0 -0
- {spot_sdk_python-2.1.0b3 → spot_sdk_python-2.1.1}/spot_sdk/testing/__init__.py +0 -0
- {spot_sdk_python-2.1.0b3 → spot_sdk_python-2.1.1}/spot_sdk/testing/container.py +0 -0
- {spot_sdk_python-2.1.0b3 → spot_sdk_python-2.1.1}/spot_sdk/testing/contract.py +0 -0
- {spot_sdk_python-2.1.0b3 → spot_sdk_python-2.1.1}/spot_sdk/testing/corpus.py +0 -0
- {spot_sdk_python-2.1.0b3 → spot_sdk_python-2.1.1}/spot_sdk/testing/engine.py +0 -0
- {spot_sdk_python-2.1.0b3 → spot_sdk_python-2.1.1}/spot_sdk/testing/fake_knowledge_client.py +0 -0
- {spot_sdk_python-2.1.0b3 → spot_sdk_python-2.1.1}/spot_sdk/testing/fake_llm.py +0 -0
- {spot_sdk_python-2.1.0b3 → spot_sdk_python-2.1.1}/spot_sdk/testing/fake_spot.py +0 -0
- {spot_sdk_python-2.1.0b3 → spot_sdk_python-2.1.1}/spot_sdk/testing/metrics.py +0 -0
- {spot_sdk_python-2.1.0b3 → spot_sdk_python-2.1.1}/spot_sdk/testing/report.py +0 -0
- {spot_sdk_python-2.1.0b3 → spot_sdk_python-2.1.1}/spot_sdk/testing/settings.py +0 -0
- {spot_sdk_python-2.1.0b3 → spot_sdk_python-2.1.1}/spot_sdk/testing/views.py +0 -0
- {spot_sdk_python-2.1.0b3 → spot_sdk_python-2.1.1}/spot_sdk/urls.py +0 -0
- {spot_sdk_python-2.1.0b3 → spot_sdk_python-2.1.1}/spot_sdk/verdict.py +0 -0
- {spot_sdk_python-2.1.0b3 → spot_sdk_python-2.1.1}/spot_sdk/workflow.py +0 -0
|
@@ -44,7 +44,11 @@ could expand past the bound once decoded."""
|
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
class AnswerRefusedError(Exception):
|
|
47
|
-
"""A plugin's answer that is not read: encoded, or longer than
|
|
47
|
+
"""A plugin's answer that is not read: encoded, or longer than its bound."""
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
class AnswerTooLargeError(AnswerRefusedError):
|
|
51
|
+
"""An answer longer than its bound, which a caller may treat apart from an encoded one."""
|
|
48
52
|
|
|
49
53
|
|
|
50
54
|
class InvalidResponseError(Exception):
|
|
@@ -121,11 +125,14 @@ def secrets_archive(secrets: Mapping[str, str]) -> bytes:
|
|
|
121
125
|
return buffer.getvalue()
|
|
122
126
|
|
|
123
127
|
|
|
124
|
-
async def read_answer(
|
|
125
|
-
|
|
128
|
+
async def read_answer(
|
|
129
|
+
response: httpx2.Response, max_bytes: int = MAX_ANSWER_BYTES
|
|
130
|
+
) -> bytes:
|
|
131
|
+
"""A streamed answer's body, as sent, read up to ``max_bytes``.
|
|
126
132
|
|
|
127
133
|
Raises:
|
|
128
|
-
AnswerRefusedError: the answer is encoded
|
|
134
|
+
AnswerRefusedError: the answer is encoded
|
|
135
|
+
AnswerTooLargeError: the answer is longer than ``max_bytes``
|
|
129
136
|
"""
|
|
130
137
|
if (
|
|
131
138
|
response.headers.get("content-encoding", "identity").strip().lower()
|
|
@@ -135,8 +142,8 @@ async def read_answer(response: httpx2.Response) -> bytes:
|
|
|
135
142
|
body = bytearray()
|
|
136
143
|
async for chunk in response.aiter_raw():
|
|
137
144
|
body += chunk
|
|
138
|
-
if len(body) >
|
|
139
|
-
raise
|
|
145
|
+
if len(body) > max_bytes:
|
|
146
|
+
raise AnswerTooLargeError(f"response too large: over {max_bytes} bytes")
|
|
140
147
|
return bytes(body)
|
|
141
148
|
|
|
142
149
|
|
|
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
|
|
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
|
|
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
|