inferencesh 0.2.4__tar.gz → 0.2.6__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.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: inferencesh
3
- Version: 0.2.4
3
+ Version: 0.2.6
4
4
  Summary: inference.sh Python SDK
5
5
  Author: Inference Shell Inc.
6
6
  Author-email: "Inference Shell Inc." <hello@inference.sh>
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "inferencesh"
7
- version = "0.2.4"
7
+ version = "0.2.6"
8
8
  description = "inference.sh Python SDK"
9
9
  authors = [
10
10
  {name = "Inference Shell Inc.", email = "hello@inference.sh"},
@@ -264,6 +264,18 @@ class File(BaseModel):
264
264
  self.size = self._get_file_size() # Always update size
265
265
  self.filename = self._get_filename()
266
266
 
267
+ @classmethod
268
+ def model_json_schema(cls, **kwargs):
269
+ schema = super().model_json_schema(**kwargs)
270
+
271
+ # Create a schema that accepts either a string or the full object
272
+ return {
273
+ "oneOf": [
274
+ {"type": "string"}, # Accept string input
275
+ schema # Accept full object input
276
+ ]
277
+ }
278
+
267
279
 
268
280
  class ContextMessageRole(str, Enum):
269
281
  USER = "user"
@@ -333,6 +345,16 @@ class LLMInput(BaseAppInput):
333
345
  )
334
346
 
335
347
  class LLMInputWithImage(LLMInput):
348
+ context: list[ContextMessageWithImage] = Field(
349
+ description="The context to use for the model",
350
+ examples=[
351
+ [
352
+ {"role": "user", "content": [{"type": "text", "text": "What is the capital of France?"}, {"type": "image", "url": "https://example.com/image.jpg"}]},
353
+ {"role": "assistant", "content": [{"type": "text", "text": "The capital of France is Paris."}]}
354
+ ],
355
+ ],
356
+ default=[]
357
+ )
336
358
  image: Optional[File] = Field(
337
359
  description="The image to use for the model",
338
360
  default=None
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: inferencesh
3
- Version: 0.2.4
3
+ Version: 0.2.6
4
4
  Summary: inference.sh Python SDK
5
5
  Author: Inference Shell Inc.
6
6
  Author-email: "Inference Shell Inc." <hello@inference.sh>
File without changes
File without changes
File without changes
File without changes