inferencesh 0.4.15__tar.gz → 0.4.17__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.
Potentially problematic release.
This version of inferencesh might be problematic. Click here for more details.
- {inferencesh-0.4.15/src/inferencesh.egg-info → inferencesh-0.4.17}/PKG-INFO +1 -1
- {inferencesh-0.4.15 → inferencesh-0.4.17}/pyproject.toml +1 -1
- {inferencesh-0.4.15 → inferencesh-0.4.17}/src/inferencesh/client.py +4 -2
- {inferencesh-0.4.15 → inferencesh-0.4.17}/src/inferencesh/models/file.py +6 -2
- {inferencesh-0.4.15 → inferencesh-0.4.17}/src/inferencesh/models/llm.py +1 -0
- {inferencesh-0.4.15 → inferencesh-0.4.17/src/inferencesh.egg-info}/PKG-INFO +1 -1
- {inferencesh-0.4.15 → inferencesh-0.4.17}/tests/test_sdk.py +16 -1
- {inferencesh-0.4.15 → inferencesh-0.4.17}/LICENSE +0 -0
- {inferencesh-0.4.15 → inferencesh-0.4.17}/README.md +0 -0
- {inferencesh-0.4.15 → inferencesh-0.4.17}/setup.cfg +0 -0
- {inferencesh-0.4.15 → inferencesh-0.4.17}/src/inferencesh/__init__.py +0 -0
- {inferencesh-0.4.15 → inferencesh-0.4.17}/src/inferencesh/models/__init__.py +0 -0
- {inferencesh-0.4.15 → inferencesh-0.4.17}/src/inferencesh/models/base.py +0 -0
- {inferencesh-0.4.15 → inferencesh-0.4.17}/src/inferencesh/utils/__init__.py +0 -0
- {inferencesh-0.4.15 → inferencesh-0.4.17}/src/inferencesh/utils/download.py +0 -0
- {inferencesh-0.4.15 → inferencesh-0.4.17}/src/inferencesh/utils/storage.py +0 -0
- {inferencesh-0.4.15 → inferencesh-0.4.17}/src/inferencesh.egg-info/SOURCES.txt +0 -0
- {inferencesh-0.4.15 → inferencesh-0.4.17}/src/inferencesh.egg-info/dependency_links.txt +0 -0
- {inferencesh-0.4.15 → inferencesh-0.4.17}/src/inferencesh.egg-info/entry_points.txt +0 -0
- {inferencesh-0.4.15 → inferencesh-0.4.17}/src/inferencesh.egg-info/requires.txt +0 -0
- {inferencesh-0.4.15 → inferencesh-0.4.17}/src/inferencesh.egg-info/top_level.txt +0 -0
- {inferencesh-0.4.15 → inferencesh-0.4.17}/tests/test_client.py +0 -0
|
@@ -366,7 +366,8 @@ class Inference:
|
|
|
366
366
|
task_id = task["id"]
|
|
367
367
|
|
|
368
368
|
# Stream updates
|
|
369
|
-
|
|
369
|
+
stream = client.run(params, stream=True)
|
|
370
|
+
for update in stream:
|
|
370
371
|
print(f"Status: {update.get('status')}")
|
|
371
372
|
if update.get('status') == TaskStatus.COMPLETED:
|
|
372
373
|
print(f"Result: {update.get('output')}")
|
|
@@ -794,7 +795,8 @@ class AsyncInference:
|
|
|
794
795
|
task_id = task["id"]
|
|
795
796
|
|
|
796
797
|
# Stream updates
|
|
797
|
-
|
|
798
|
+
stream = await client.run(params, stream=True)
|
|
799
|
+
for update in stream:
|
|
798
800
|
print(f"Status: {update.get('status')}")
|
|
799
801
|
if update.get('status') == TaskStatus.COMPLETED:
|
|
800
802
|
print(f"Result: {update.get('output')}")
|
|
@@ -266,11 +266,15 @@ class File(BaseModel):
|
|
|
266
266
|
) -> dict[str, Any]:
|
|
267
267
|
"""Generate a simple JSON schema that accepts either a string or an object"""
|
|
268
268
|
json_schema = handler(schema)
|
|
269
|
-
|
|
269
|
+
if "$ref" in json_schema:
|
|
270
|
+
# If we got a ref, resolve it to the actual schema
|
|
271
|
+
json_schema = handler.resolve_ref_schema(json_schema)
|
|
272
|
+
|
|
273
|
+
# Add string as an alternative without recursion
|
|
270
274
|
return {
|
|
271
275
|
"$id": "/schemas/File",
|
|
272
276
|
"oneOf": [
|
|
273
|
-
json_schema,
|
|
277
|
+
{k: v for k, v in json_schema.items() if k != "$ref"}, # Remove any $ref to prevent recursion
|
|
274
278
|
{"type": "string"}
|
|
275
279
|
]
|
|
276
280
|
}
|
|
@@ -159,4 +159,19 @@ def test_file_cleanup(monkeypatch):
|
|
|
159
159
|
tmp_path = file._tmp_path
|
|
160
160
|
assert os.path.exists(tmp_path)
|
|
161
161
|
del file
|
|
162
|
-
assert not os.path.exists(tmp_path)
|
|
162
|
+
assert not os.path.exists(tmp_path)
|
|
163
|
+
|
|
164
|
+
def test_file_schema():
|
|
165
|
+
file = File(uri="https://example.com/test.txt")
|
|
166
|
+
print(file.model_json_schema())
|
|
167
|
+
assert file.model_json_schema() is not None
|
|
168
|
+
assert file.model_json_schema()["$id"] == "/schemas/File"
|
|
169
|
+
assert file.model_json_schema()["oneOf"] is not None
|
|
170
|
+
assert file.model_json_schema()["oneOf"][0] is not None
|
|
171
|
+
assert file.model_json_schema()["oneOf"][0]["type"] == "object"
|
|
172
|
+
assert file.model_json_schema()["oneOf"][0]["properties"] is not None
|
|
173
|
+
assert file.model_json_schema()["oneOf"][0]["properties"]["uri"] is not None
|
|
174
|
+
assert file.model_json_schema()["oneOf"][0]["properties"]["path"] is not None
|
|
175
|
+
assert file.model_json_schema()["oneOf"][0]["properties"]["content_type"] is not None
|
|
176
|
+
assert file.model_json_schema()["oneOf"][0]["properties"]["size"] is not None
|
|
177
|
+
assert file.model_json_schema()["oneOf"][0]["properties"]["filename"] is not None
|
|
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
|