inferencesh 0.4.8__py3-none-any.whl → 0.4.9__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.

Potentially problematic release.


This version of inferencesh might be problematic. Click here for more details.

@@ -7,6 +7,8 @@ import urllib.parse
7
7
  import hashlib
8
8
  from pathlib import Path
9
9
  from tqdm import tqdm
10
+ from pydantic_core import core_schema
11
+ from pydantic_core.core_schema import GetJsonSchemaHandler, JsonSchemaValue
10
12
 
11
13
 
12
14
  class File(BaseModel):
@@ -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
- base_schema = {
244
- "anyOf": [
246
+ return {
247
+ "oneOf": [
245
248
  {"type": "string"}, # Accept string input
246
- {
247
- "type": "object",
248
- "properties": schema["properties"],
249
- "title": schema.get("title", "File"),
250
- "description": "A class representing a file in the inference.sh ecosystem."
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
- # If this is the top-level schema, return as is
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
+
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: inferencesh
3
- Version: 0.4.8
3
+ Version: 0.4.9
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
@@ -2,14 +2,14 @@ inferencesh/__init__.py,sha256=dY3l3yCkWoMtGX0gNXgxFnrprFRl6PPWjH8V7Qedx5g,772
2
2
  inferencesh/client.py,sha256=6wTCLqLq-QapvjCjMg8ZE3BQyg8iTL8hv8UU7t-oxmE,39360
3
3
  inferencesh/models/__init__.py,sha256=FDwcdtT6c4hbRitymjmN-hZMlQa8RbKSftkZZyjtUXA,536
4
4
  inferencesh/models/base.py,sha256=eTwRvXAjMGh6b8AUXWKSGpRyeScAkPs6bNYY8AXKSz8,5505
5
- inferencesh/models/file.py,sha256=3RKLs7EcIUDX7GxPC7nYMZq0OhkdkNwfdLJRKIAfctY,10827
5
+ inferencesh/models/file.py,sha256=-ZUR1Wx2bdoFxJYRdACl0VQGO8QJQUj6fWnS5SibsLo,10855
6
6
  inferencesh/models/llm.py,sha256=FPkTqVkH4mdKxUEdDVNimaPEr_mkpGofX7qTK4G1IHo,27873
7
7
  inferencesh/utils/__init__.py,sha256=-xiD6uo2XzcrPAWFb_fUbaimmnW4KFKc-8IvBzaxNd4,148
8
8
  inferencesh/utils/download.py,sha256=DRGBudiPVa5bDS35KfR-DYeGRk7gO03WOelnisecwMo,1815
9
9
  inferencesh/utils/storage.py,sha256=E4J8emd4eFKdmdDgAqzz3TpaaDd3n0l8gYlMHuY8yIU,519
10
- inferencesh-0.4.8.dist-info/licenses/LICENSE,sha256=OsgqEWIh2el_QMj0y8O1A5Q5Dl-dxqqYbFE6fszuR4s,1086
11
- inferencesh-0.4.8.dist-info/METADATA,sha256=aNWzf0W-v_njoZEDO9obbdc1YbG9SIpONQHvdfBP_Ws,5405
12
- inferencesh-0.4.8.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
13
- inferencesh-0.4.8.dist-info/entry_points.txt,sha256=6IC-fyozAqW3ljsMLGCXxJ0_ui2Jb-2fLHtoH1RTnEE,45
14
- inferencesh-0.4.8.dist-info/top_level.txt,sha256=TSMHg3T1ThMl1HGAWmzBClwOYH1ump5neof9BfHIwaA,12
15
- inferencesh-0.4.8.dist-info/RECORD,,
10
+ inferencesh-0.4.9.dist-info/licenses/LICENSE,sha256=OsgqEWIh2el_QMj0y8O1A5Q5Dl-dxqqYbFE6fszuR4s,1086
11
+ inferencesh-0.4.9.dist-info/METADATA,sha256=KSz0RlU3jd7-OdVLbH2rQ3BRjFy8tPsvg5oNiEYDoe8,5405
12
+ inferencesh-0.4.9.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
13
+ inferencesh-0.4.9.dist-info/entry_points.txt,sha256=6IC-fyozAqW3ljsMLGCXxJ0_ui2Jb-2fLHtoH1RTnEE,45
14
+ inferencesh-0.4.9.dist-info/top_level.txt,sha256=TSMHg3T1ThMl1HGAWmzBClwOYH1ump5neof9BfHIwaA,12
15
+ inferencesh-0.4.9.dist-info/RECORD,,