inferencesh 0.4.22__tar.gz → 0.4.24__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.22/src/inferencesh.egg-info → inferencesh-0.4.24}/PKG-INFO +1 -1
  2. {inferencesh-0.4.22 → inferencesh-0.4.24}/pyproject.toml +1 -1
  3. {inferencesh-0.4.22 → inferencesh-0.4.24}/src/inferencesh/models/llm.py +8 -1
  4. {inferencesh-0.4.22 → inferencesh-0.4.24/src/inferencesh.egg-info}/PKG-INFO +1 -1
  5. {inferencesh-0.4.22 → inferencesh-0.4.24}/LICENSE +0 -0
  6. {inferencesh-0.4.22 → inferencesh-0.4.24}/README.md +0 -0
  7. {inferencesh-0.4.22 → inferencesh-0.4.24}/setup.cfg +0 -0
  8. {inferencesh-0.4.22 → inferencesh-0.4.24}/src/inferencesh/__init__.py +0 -0
  9. {inferencesh-0.4.22 → inferencesh-0.4.24}/src/inferencesh/client.py +0 -0
  10. {inferencesh-0.4.22 → inferencesh-0.4.24}/src/inferencesh/models/__init__.py +0 -0
  11. {inferencesh-0.4.22 → inferencesh-0.4.24}/src/inferencesh/models/base.py +0 -0
  12. {inferencesh-0.4.22 → inferencesh-0.4.24}/src/inferencesh/models/file.py +0 -0
  13. {inferencesh-0.4.22 → inferencesh-0.4.24}/src/inferencesh/utils/__init__.py +0 -0
  14. {inferencesh-0.4.22 → inferencesh-0.4.24}/src/inferencesh/utils/download.py +0 -0
  15. {inferencesh-0.4.22 → inferencesh-0.4.24}/src/inferencesh/utils/storage.py +0 -0
  16. {inferencesh-0.4.22 → inferencesh-0.4.24}/src/inferencesh.egg-info/SOURCES.txt +0 -0
  17. {inferencesh-0.4.22 → inferencesh-0.4.24}/src/inferencesh.egg-info/dependency_links.txt +0 -0
  18. {inferencesh-0.4.22 → inferencesh-0.4.24}/src/inferencesh.egg-info/entry_points.txt +0 -0
  19. {inferencesh-0.4.22 → inferencesh-0.4.24}/src/inferencesh.egg-info/requires.txt +0 -0
  20. {inferencesh-0.4.22 → inferencesh-0.4.24}/src/inferencesh.egg-info/top_level.txt +0 -0
  21. {inferencesh-0.4.22 → inferencesh-0.4.24}/tests/test_client.py +0 -0
  22. {inferencesh-0.4.22 → inferencesh-0.4.24}/tests/test_sdk.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: inferencesh
3
- Version: 0.4.22
3
+ Version: 0.4.24
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.22"
7
+ version = "0.4.24"
8
8
  description = "inference.sh Python SDK"
9
9
  authors = [
10
10
  {name = "Inference Shell Inc.", email = "hello@inference.sh"},
@@ -6,6 +6,7 @@ from threading import Thread
6
6
  import time
7
7
  from contextlib import contextmanager
8
8
  import base64
9
+ import json
9
10
 
10
11
  from .base import BaseAppInput, BaseAppOutput
11
12
  from .file import File
@@ -218,6 +219,8 @@ def build_messages(
218
219
  text = transform_user_message(msg.text) if transform_user_message and msg.role == ContextMessageRole.USER else msg.text
219
220
  if text:
220
221
  parts.append({"type": "text", "text": text})
222
+ else:
223
+ parts.append({"type": "text", "text": ""})
221
224
  if msg.image:
222
225
  if msg.image.path:
223
226
  image_data_uri = image_to_base64_data_uri(msg.image.path)
@@ -228,7 +231,11 @@ def build_messages(
228
231
  return parts
229
232
  if len(parts) == 1 and parts[0]["type"] == "text":
230
233
  return parts[0]["text"]
231
- raise ValueError("Image content requires multipart support")
234
+ if len(parts) > 1:
235
+ if parts.any(lambda x: x["type"] == "image_url"):
236
+ raise ValueError("Image content requires multipart support")
237
+ return parts
238
+ raise ValueError("Invalid message content")
232
239
 
233
240
  messages = [{"role": "system", "content": input_data.system_prompt}] if input_data.system_prompt is not None and input_data.system_prompt != "" else []
234
241
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: inferencesh
3
- Version: 0.4.22
3
+ Version: 0.4.24
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
File without changes
File without changes
File without changes