inferencesh 0.4.8__tar.gz → 0.4.10__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.8/src/inferencesh.egg-info → inferencesh-0.4.10}/PKG-INFO +1 -1
- {inferencesh-0.4.8 → inferencesh-0.4.10}/pyproject.toml +1 -1
- {inferencesh-0.4.8 → inferencesh-0.4.10}/src/inferencesh/models/file.py +19 -14
- {inferencesh-0.4.8 → inferencesh-0.4.10/src/inferencesh.egg-info}/PKG-INFO +1 -1
- {inferencesh-0.4.8 → inferencesh-0.4.10}/LICENSE +0 -0
- {inferencesh-0.4.8 → inferencesh-0.4.10}/README.md +0 -0
- {inferencesh-0.4.8 → inferencesh-0.4.10}/setup.cfg +0 -0
- {inferencesh-0.4.8 → inferencesh-0.4.10}/src/inferencesh/__init__.py +0 -0
- {inferencesh-0.4.8 → inferencesh-0.4.10}/src/inferencesh/client.py +0 -0
- {inferencesh-0.4.8 → inferencesh-0.4.10}/src/inferencesh/models/__init__.py +0 -0
- {inferencesh-0.4.8 → inferencesh-0.4.10}/src/inferencesh/models/base.py +0 -0
- {inferencesh-0.4.8 → inferencesh-0.4.10}/src/inferencesh/models/llm.py +0 -0
- {inferencesh-0.4.8 → inferencesh-0.4.10}/src/inferencesh/utils/__init__.py +0 -0
- {inferencesh-0.4.8 → inferencesh-0.4.10}/src/inferencesh/utils/download.py +0 -0
- {inferencesh-0.4.8 → inferencesh-0.4.10}/src/inferencesh/utils/storage.py +0 -0
- {inferencesh-0.4.8 → inferencesh-0.4.10}/src/inferencesh.egg-info/SOURCES.txt +0 -0
- {inferencesh-0.4.8 → inferencesh-0.4.10}/src/inferencesh.egg-info/dependency_links.txt +0 -0
- {inferencesh-0.4.8 → inferencesh-0.4.10}/src/inferencesh.egg-info/entry_points.txt +0 -0
- {inferencesh-0.4.8 → inferencesh-0.4.10}/src/inferencesh.egg-info/requires.txt +0 -0
- {inferencesh-0.4.8 → inferencesh-0.4.10}/src/inferencesh.egg-info/top_level.txt +0 -0
- {inferencesh-0.4.8 → inferencesh-0.4.10}/tests/test_client.py +0 -0
- {inferencesh-0.4.8 → inferencesh-0.4.10}/tests/test_sdk.py +0 -0
|
@@ -8,6 +8,8 @@ import hashlib
|
|
|
8
8
|
from pathlib import Path
|
|
9
9
|
from tqdm import tqdm
|
|
10
10
|
|
|
11
|
+
from pydantic import GetCoreSchemaHandler, GetJsonSchemaHandler, JsonSchemaValue
|
|
12
|
+
from pydantic_core import CoreSchema, core_schema
|
|
11
13
|
|
|
12
14
|
class File(BaseModel):
|
|
13
15
|
"""A class representing a file in the inference.sh ecosystem."""
|
|
@@ -239,21 +241,24 @@ class File(BaseModel):
|
|
|
239
241
|
@classmethod
|
|
240
242
|
def model_json_schema(cls, **kwargs):
|
|
241
243
|
schema = super().model_json_schema(**kwargs)
|
|
244
|
+
schema["$id"] = "/schemas/File"
|
|
242
245
|
# Create a schema that accepts either a string or the full object
|
|
243
|
-
|
|
244
|
-
"
|
|
246
|
+
return {
|
|
247
|
+
"oneOf": [
|
|
245
248
|
{"type": "string"}, # Accept string input
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
249
|
+
schema # Accept full object input
|
|
250
|
+
]
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
@classmethod
|
|
254
|
+
def __get_pydantic_json_schema__(
|
|
255
|
+
cls, core_schema: core_schema.CoreSchema, handler: GetJsonSchemaHandler
|
|
256
|
+
) -> JsonSchemaValue:
|
|
257
|
+
schema = handler(core_schema) # this is the "normal" schema
|
|
258
|
+
return {
|
|
259
|
+
"oneOf": [
|
|
260
|
+
{"type": "string"},
|
|
261
|
+
schema
|
|
252
262
|
]
|
|
253
263
|
}
|
|
254
|
-
|
|
255
|
-
if not kwargs.get("ref_template"):
|
|
256
|
-
return base_schema
|
|
257
|
-
# If this is being used in $defs, include it in the schema
|
|
258
|
-
schema.update(base_schema)
|
|
259
|
-
return schema
|
|
264
|
+
|
|
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
|