inferencesh 0.4.15__tar.gz → 0.4.16__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.

Files changed (22) hide show
  1. {inferencesh-0.4.15/src/inferencesh.egg-info → inferencesh-0.4.16}/PKG-INFO +1 -1
  2. {inferencesh-0.4.15 → inferencesh-0.4.16}/pyproject.toml +1 -1
  3. {inferencesh-0.4.15 → inferencesh-0.4.16}/src/inferencesh/client.py +4 -2
  4. {inferencesh-0.4.15 → inferencesh-0.4.16}/src/inferencesh/models/file.py +6 -2
  5. {inferencesh-0.4.15 → inferencesh-0.4.16/src/inferencesh.egg-info}/PKG-INFO +1 -1
  6. {inferencesh-0.4.15 → inferencesh-0.4.16}/tests/test_sdk.py +16 -1
  7. {inferencesh-0.4.15 → inferencesh-0.4.16}/LICENSE +0 -0
  8. {inferencesh-0.4.15 → inferencesh-0.4.16}/README.md +0 -0
  9. {inferencesh-0.4.15 → inferencesh-0.4.16}/setup.cfg +0 -0
  10. {inferencesh-0.4.15 → inferencesh-0.4.16}/src/inferencesh/__init__.py +0 -0
  11. {inferencesh-0.4.15 → inferencesh-0.4.16}/src/inferencesh/models/__init__.py +0 -0
  12. {inferencesh-0.4.15 → inferencesh-0.4.16}/src/inferencesh/models/base.py +0 -0
  13. {inferencesh-0.4.15 → inferencesh-0.4.16}/src/inferencesh/models/llm.py +0 -0
  14. {inferencesh-0.4.15 → inferencesh-0.4.16}/src/inferencesh/utils/__init__.py +0 -0
  15. {inferencesh-0.4.15 → inferencesh-0.4.16}/src/inferencesh/utils/download.py +0 -0
  16. {inferencesh-0.4.15 → inferencesh-0.4.16}/src/inferencesh/utils/storage.py +0 -0
  17. {inferencesh-0.4.15 → inferencesh-0.4.16}/src/inferencesh.egg-info/SOURCES.txt +0 -0
  18. {inferencesh-0.4.15 → inferencesh-0.4.16}/src/inferencesh.egg-info/dependency_links.txt +0 -0
  19. {inferencesh-0.4.15 → inferencesh-0.4.16}/src/inferencesh.egg-info/entry_points.txt +0 -0
  20. {inferencesh-0.4.15 → inferencesh-0.4.16}/src/inferencesh.egg-info/requires.txt +0 -0
  21. {inferencesh-0.4.15 → inferencesh-0.4.16}/src/inferencesh.egg-info/top_level.txt +0 -0
  22. {inferencesh-0.4.15 → inferencesh-0.4.16}/tests/test_client.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: inferencesh
3
- Version: 0.4.15
3
+ Version: 0.4.16
4
4
  Summary: inference.sh Python SDK
5
5
  Author-email: "Inference Shell Inc." <hello@inference.sh>
6
6
  Project-URL: Homepage, https://github.com/inference-sh/sdk
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "inferencesh"
7
- version = "0.4.15"
7
+ version = "0.4.16"
8
8
  description = "inference.sh Python SDK"
9
9
  authors = [
10
10
  {name = "Inference Shell Inc.", email = "hello@inference.sh"},
@@ -366,7 +366,8 @@ class Inference:
366
366
  task_id = task["id"]
367
367
 
368
368
  # Stream updates
369
- for update in client.run(params, stream=True):
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
- async for update in await client.run(params, stream=True):
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
- # Don't resolve refs here - that's what was causing the recursion
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
  }
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: inferencesh
3
- Version: 0.4.15
3
+ Version: 0.4.16
4
4
  Summary: inference.sh Python SDK
5
5
  Author-email: "Inference Shell Inc." <hello@inference.sh>
6
6
  Project-URL: Homepage, https://github.com/inference-sh/sdk
@@ -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