inferencesh 0.4.22__tar.gz → 0.4.23__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.22/src/inferencesh.egg-info → inferencesh-0.4.23}/PKG-INFO +1 -1
- {inferencesh-0.4.22 → inferencesh-0.4.23}/pyproject.toml +1 -1
- {inferencesh-0.4.22 → inferencesh-0.4.23}/src/inferencesh/models/llm.py +10 -1
- {inferencesh-0.4.22 → inferencesh-0.4.23/src/inferencesh.egg-info}/PKG-INFO +1 -1
- {inferencesh-0.4.22 → inferencesh-0.4.23}/LICENSE +0 -0
- {inferencesh-0.4.22 → inferencesh-0.4.23}/README.md +0 -0
- {inferencesh-0.4.22 → inferencesh-0.4.23}/setup.cfg +0 -0
- {inferencesh-0.4.22 → inferencesh-0.4.23}/src/inferencesh/__init__.py +0 -0
- {inferencesh-0.4.22 → inferencesh-0.4.23}/src/inferencesh/client.py +0 -0
- {inferencesh-0.4.22 → inferencesh-0.4.23}/src/inferencesh/models/__init__.py +0 -0
- {inferencesh-0.4.22 → inferencesh-0.4.23}/src/inferencesh/models/base.py +0 -0
- {inferencesh-0.4.22 → inferencesh-0.4.23}/src/inferencesh/models/file.py +0 -0
- {inferencesh-0.4.22 → inferencesh-0.4.23}/src/inferencesh/utils/__init__.py +0 -0
- {inferencesh-0.4.22 → inferencesh-0.4.23}/src/inferencesh/utils/download.py +0 -0
- {inferencesh-0.4.22 → inferencesh-0.4.23}/src/inferencesh/utils/storage.py +0 -0
- {inferencesh-0.4.22 → inferencesh-0.4.23}/src/inferencesh.egg-info/SOURCES.txt +0 -0
- {inferencesh-0.4.22 → inferencesh-0.4.23}/src/inferencesh.egg-info/dependency_links.txt +0 -0
- {inferencesh-0.4.22 → inferencesh-0.4.23}/src/inferencesh.egg-info/entry_points.txt +0 -0
- {inferencesh-0.4.22 → inferencesh-0.4.23}/src/inferencesh.egg-info/requires.txt +0 -0
- {inferencesh-0.4.22 → inferencesh-0.4.23}/src/inferencesh.egg-info/top_level.txt +0 -0
- {inferencesh-0.4.22 → inferencesh-0.4.23}/tests/test_client.py +0 -0
- {inferencesh-0.4.22 → inferencesh-0.4.23}/tests/test_sdk.py +0 -0
|
@@ -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
|
|
@@ -216,6 +217,10 @@ def build_messages(
|
|
|
216
217
|
def render_message(msg: ContextMessage, allow_multipart: bool) -> str | List[dict]:
|
|
217
218
|
parts = []
|
|
218
219
|
text = transform_user_message(msg.text) if transform_user_message and msg.role == ContextMessageRole.USER else msg.text
|
|
220
|
+
if msg.tool_calls:
|
|
221
|
+
for tool_call in msg.tool_calls:
|
|
222
|
+
tool_call_string = json.dumps(tool_call)
|
|
223
|
+
text += f"\n\nTool call: {tool_call_string}"
|
|
219
224
|
if text:
|
|
220
225
|
parts.append({"type": "text", "text": text})
|
|
221
226
|
if msg.image:
|
|
@@ -228,7 +233,11 @@ def build_messages(
|
|
|
228
233
|
return parts
|
|
229
234
|
if len(parts) == 1 and parts[0]["type"] == "text":
|
|
230
235
|
return parts[0]["text"]
|
|
231
|
-
|
|
236
|
+
if len(parts) > 1:
|
|
237
|
+
if parts.any(lambda x: x["type"] == "image_url"):
|
|
238
|
+
raise ValueError("Image content requires multipart support")
|
|
239
|
+
return parts
|
|
240
|
+
raise ValueError("Invalid message content")
|
|
232
241
|
|
|
233
242
|
messages = [{"role": "system", "content": input_data.system_prompt}] if input_data.system_prompt is not None and input_data.system_prompt != "" else []
|
|
234
243
|
|
|
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
|