lm-deluge 0.0.64__tar.gz → 0.0.66__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 lm-deluge might be problematic. Click here for more details.
- {lm_deluge-0.0.64/src/lm_deluge.egg-info → lm_deluge-0.0.66}/PKG-INFO +1 -1
- {lm_deluge-0.0.64 → lm_deluge-0.0.66}/pyproject.toml +1 -1
- {lm_deluge-0.0.64 → lm_deluge-0.0.66}/src/lm_deluge/api_requests/anthropic.py +3 -0
- {lm_deluge-0.0.64 → lm_deluge-0.0.66}/src/lm_deluge/api_requests/openai.py +3 -2
- {lm_deluge-0.0.64 → lm_deluge-0.0.66}/src/lm_deluge/prompt.py +12 -0
- {lm_deluge-0.0.64 → lm_deluge-0.0.66}/src/lm_deluge/tool.py +6 -1
- {lm_deluge-0.0.64 → lm_deluge-0.0.66/src/lm_deluge.egg-info}/PKG-INFO +1 -1
- {lm_deluge-0.0.64 → lm_deluge-0.0.66}/LICENSE +0 -0
- {lm_deluge-0.0.64 → lm_deluge-0.0.66}/README.md +0 -0
- {lm_deluge-0.0.64 → lm_deluge-0.0.66}/setup.cfg +0 -0
- {lm_deluge-0.0.64 → lm_deluge-0.0.66}/src/lm_deluge/__init__.py +0 -0
- {lm_deluge-0.0.64 → lm_deluge-0.0.66}/src/lm_deluge/api_requests/__init__.py +0 -0
- {lm_deluge-0.0.64 → lm_deluge-0.0.66}/src/lm_deluge/api_requests/base.py +0 -0
- {lm_deluge-0.0.64 → lm_deluge-0.0.66}/src/lm_deluge/api_requests/bedrock.py +0 -0
- {lm_deluge-0.0.64 → lm_deluge-0.0.66}/src/lm_deluge/api_requests/common.py +0 -0
- {lm_deluge-0.0.64 → lm_deluge-0.0.66}/src/lm_deluge/api_requests/deprecated/bedrock.py +0 -0
- {lm_deluge-0.0.64 → lm_deluge-0.0.66}/src/lm_deluge/api_requests/deprecated/cohere.py +0 -0
- {lm_deluge-0.0.64 → lm_deluge-0.0.66}/src/lm_deluge/api_requests/deprecated/deepseek.py +0 -0
- {lm_deluge-0.0.64 → lm_deluge-0.0.66}/src/lm_deluge/api_requests/deprecated/mistral.py +0 -0
- {lm_deluge-0.0.64 → lm_deluge-0.0.66}/src/lm_deluge/api_requests/deprecated/vertex.py +0 -0
- {lm_deluge-0.0.64 → lm_deluge-0.0.66}/src/lm_deluge/api_requests/gemini.py +0 -0
- {lm_deluge-0.0.64 → lm_deluge-0.0.66}/src/lm_deluge/api_requests/mistral.py +0 -0
- {lm_deluge-0.0.64 → lm_deluge-0.0.66}/src/lm_deluge/api_requests/response.py +0 -0
- {lm_deluge-0.0.64 → lm_deluge-0.0.66}/src/lm_deluge/batches.py +0 -0
- {lm_deluge-0.0.64 → lm_deluge-0.0.66}/src/lm_deluge/built_in_tools/anthropic/__init__.py +0 -0
- {lm_deluge-0.0.64 → lm_deluge-0.0.66}/src/lm_deluge/built_in_tools/anthropic/bash.py +0 -0
- {lm_deluge-0.0.64 → lm_deluge-0.0.66}/src/lm_deluge/built_in_tools/anthropic/computer_use.py +0 -0
- {lm_deluge-0.0.64 → lm_deluge-0.0.66}/src/lm_deluge/built_in_tools/anthropic/editor.py +0 -0
- {lm_deluge-0.0.64 → lm_deluge-0.0.66}/src/lm_deluge/built_in_tools/base.py +0 -0
- {lm_deluge-0.0.64 → lm_deluge-0.0.66}/src/lm_deluge/built_in_tools/openai.py +0 -0
- {lm_deluge-0.0.64 → lm_deluge-0.0.66}/src/lm_deluge/cache.py +0 -0
- {lm_deluge-0.0.64 → lm_deluge-0.0.66}/src/lm_deluge/cli.py +0 -0
- {lm_deluge-0.0.64 → lm_deluge-0.0.66}/src/lm_deluge/client.py +0 -0
- {lm_deluge-0.0.64 → lm_deluge-0.0.66}/src/lm_deluge/config.py +0 -0
- {lm_deluge-0.0.64 → lm_deluge-0.0.66}/src/lm_deluge/embed.py +0 -0
- {lm_deluge-0.0.64 → lm_deluge-0.0.66}/src/lm_deluge/errors.py +0 -0
- {lm_deluge-0.0.64 → lm_deluge-0.0.66}/src/lm_deluge/file.py +0 -0
- {lm_deluge-0.0.64 → lm_deluge-0.0.66}/src/lm_deluge/image.py +0 -0
- {lm_deluge-0.0.64 → lm_deluge-0.0.66}/src/lm_deluge/llm_tools/__init__.py +0 -0
- {lm_deluge-0.0.64 → lm_deluge-0.0.66}/src/lm_deluge/llm_tools/classify.py +0 -0
- {lm_deluge-0.0.64 → lm_deluge-0.0.66}/src/lm_deluge/llm_tools/extract.py +0 -0
- {lm_deluge-0.0.64 → lm_deluge-0.0.66}/src/lm_deluge/llm_tools/locate.py +0 -0
- {lm_deluge-0.0.64 → lm_deluge-0.0.66}/src/lm_deluge/llm_tools/ocr.py +0 -0
- {lm_deluge-0.0.64 → lm_deluge-0.0.66}/src/lm_deluge/llm_tools/score.py +0 -0
- {lm_deluge-0.0.64 → lm_deluge-0.0.66}/src/lm_deluge/llm_tools/translate.py +0 -0
- {lm_deluge-0.0.64 → lm_deluge-0.0.66}/src/lm_deluge/models/__init__.py +0 -0
- {lm_deluge-0.0.64 → lm_deluge-0.0.66}/src/lm_deluge/models/anthropic.py +0 -0
- {lm_deluge-0.0.64 → lm_deluge-0.0.66}/src/lm_deluge/models/bedrock.py +0 -0
- {lm_deluge-0.0.64 → lm_deluge-0.0.66}/src/lm_deluge/models/cerebras.py +0 -0
- {lm_deluge-0.0.64 → lm_deluge-0.0.66}/src/lm_deluge/models/cohere.py +0 -0
- {lm_deluge-0.0.64 → lm_deluge-0.0.66}/src/lm_deluge/models/deepseek.py +0 -0
- {lm_deluge-0.0.64 → lm_deluge-0.0.66}/src/lm_deluge/models/fireworks.py +0 -0
- {lm_deluge-0.0.64 → lm_deluge-0.0.66}/src/lm_deluge/models/google.py +0 -0
- {lm_deluge-0.0.64 → lm_deluge-0.0.66}/src/lm_deluge/models/grok.py +0 -0
- {lm_deluge-0.0.64 → lm_deluge-0.0.66}/src/lm_deluge/models/groq.py +0 -0
- {lm_deluge-0.0.64 → lm_deluge-0.0.66}/src/lm_deluge/models/meta.py +0 -0
- {lm_deluge-0.0.64 → lm_deluge-0.0.66}/src/lm_deluge/models/mistral.py +0 -0
- {lm_deluge-0.0.64 → lm_deluge-0.0.66}/src/lm_deluge/models/openai.py +0 -0
- {lm_deluge-0.0.64 → lm_deluge-0.0.66}/src/lm_deluge/models/openrouter.py +0 -0
- {lm_deluge-0.0.64 → lm_deluge-0.0.66}/src/lm_deluge/models/together.py +0 -0
- {lm_deluge-0.0.64 → lm_deluge-0.0.66}/src/lm_deluge/presets/cerebras.py +0 -0
- {lm_deluge-0.0.64 → lm_deluge-0.0.66}/src/lm_deluge/presets/meta.py +0 -0
- {lm_deluge-0.0.64 → lm_deluge-0.0.66}/src/lm_deluge/request_context.py +0 -0
- {lm_deluge-0.0.64 → lm_deluge-0.0.66}/src/lm_deluge/rerank.py +0 -0
- {lm_deluge-0.0.64 → lm_deluge-0.0.66}/src/lm_deluge/tracker.py +0 -0
- {lm_deluge-0.0.64 → lm_deluge-0.0.66}/src/lm_deluge/usage.py +0 -0
- {lm_deluge-0.0.64 → lm_deluge-0.0.66}/src/lm_deluge/util/harmony.py +0 -0
- {lm_deluge-0.0.64 → lm_deluge-0.0.66}/src/lm_deluge/util/json.py +0 -0
- {lm_deluge-0.0.64 → lm_deluge-0.0.66}/src/lm_deluge/util/logprobs.py +0 -0
- {lm_deluge-0.0.64 → lm_deluge-0.0.66}/src/lm_deluge/util/spatial.py +0 -0
- {lm_deluge-0.0.64 → lm_deluge-0.0.66}/src/lm_deluge/util/validation.py +0 -0
- {lm_deluge-0.0.64 → lm_deluge-0.0.66}/src/lm_deluge/util/xml.py +0 -0
- {lm_deluge-0.0.64 → lm_deluge-0.0.66}/src/lm_deluge/warnings.py +0 -0
- {lm_deluge-0.0.64 → lm_deluge-0.0.66}/src/lm_deluge.egg-info/SOURCES.txt +0 -0
- {lm_deluge-0.0.64 → lm_deluge-0.0.66}/src/lm_deluge.egg-info/dependency_links.txt +0 -0
- {lm_deluge-0.0.64 → lm_deluge-0.0.66}/src/lm_deluge.egg-info/requires.txt +0 -0
- {lm_deluge-0.0.64 → lm_deluge-0.0.66}/src/lm_deluge.egg-info/top_level.txt +0 -0
- {lm_deluge-0.0.64 → lm_deluge-0.0.66}/tests/test_builtin_tools.py +0 -0
- {lm_deluge-0.0.64 → lm_deluge-0.0.66}/tests/test_file_upload.py +0 -0
- {lm_deluge-0.0.64 → lm_deluge-0.0.66}/tests/test_native_mcp_server.py +0 -0
- {lm_deluge-0.0.64 → lm_deluge-0.0.66}/tests/test_openrouter_generic.py +0 -0
|
@@ -90,6 +90,9 @@ def _build_anthropic_request(
|
|
|
90
90
|
for tool in tools:
|
|
91
91
|
if isinstance(tool, Tool):
|
|
92
92
|
tool_definitions.append(tool.dump_for("anthropic"))
|
|
93
|
+
elif isinstance(tool, dict) and "url" in tool:
|
|
94
|
+
_add_beta(base_headers, "mcp-client-2025-04-04")
|
|
95
|
+
mcp_servers.append(tool)
|
|
93
96
|
elif isinstance(tool, dict):
|
|
94
97
|
tool_definitions.append(tool)
|
|
95
98
|
# add betas if needed
|
|
@@ -184,7 +184,8 @@ class OpenAIRequest(APIRequestBase):
|
|
|
184
184
|
|
|
185
185
|
content = Message("assistant", parts)
|
|
186
186
|
|
|
187
|
-
usage
|
|
187
|
+
if "usage" in data and data["usage"] is not None:
|
|
188
|
+
usage = Usage.from_openai_usage(data["usage"])
|
|
188
189
|
if (
|
|
189
190
|
self.context.sampling_params.logprobs
|
|
190
191
|
and "logprobs" in data["choices"][0]
|
|
@@ -472,7 +473,7 @@ class OpenAIResponsesRequest(APIRequestBase):
|
|
|
472
473
|
content = Message("assistant", parts)
|
|
473
474
|
|
|
474
475
|
# Extract usage information
|
|
475
|
-
if "usage" in data:
|
|
476
|
+
if "usage" in data and data["usage"] is not None:
|
|
476
477
|
usage = Usage.from_openai_usage(data["usage"])
|
|
477
478
|
|
|
478
479
|
except Exception as e:
|
|
@@ -329,6 +329,18 @@ class Message:
|
|
|
329
329
|
"""Get all thinking parts with proper typing."""
|
|
330
330
|
return [part for part in self.parts if part.type == "thinking"] # type: ignore
|
|
331
331
|
|
|
332
|
+
# @staticmethod
|
|
333
|
+
# def dump_part(part: Part):
|
|
334
|
+
# if isinstance(value, Text):
|
|
335
|
+
# return {"type": "text", "text": value.text}
|
|
336
|
+
# if isinstance(value, Image):
|
|
337
|
+
# w, h = value.size
|
|
338
|
+
# return {"type": "image", "tag": f"<Image ({w}×{h})>"}
|
|
339
|
+
# if isinstance(value, File):
|
|
340
|
+
# size = value.size
|
|
341
|
+
# return {"type": "file", "tag": f"<File ({size} bytes)>"}
|
|
342
|
+
# return repr(value)
|
|
343
|
+
|
|
332
344
|
def to_log(self) -> dict:
|
|
333
345
|
"""
|
|
334
346
|
Return a JSON-serialisable dict that fully captures the message.
|
|
@@ -602,7 +602,8 @@ class Tool(BaseModel):
|
|
|
602
602
|
def _add_additional_properties_recursive(
|
|
603
603
|
schema: dict | list | Any, remove_defaults: bool = False
|
|
604
604
|
) -> dict | list | Any:
|
|
605
|
-
"""Recursively add additionalProperties: false to all object-type schemas.
|
|
605
|
+
"""Recursively add additionalProperties: false to all object-type schemas.
|
|
606
|
+
In strict mode (when remove_defaults=True), also makes all properties required."""
|
|
606
607
|
if isinstance(schema, dict):
|
|
607
608
|
# Copy the dictionary to avoid modifying the original
|
|
608
609
|
new_schema = schema.copy()
|
|
@@ -618,6 +619,10 @@ class Tool(BaseModel):
|
|
|
618
619
|
if new_schema.get("type") == "object":
|
|
619
620
|
new_schema["additionalProperties"] = False
|
|
620
621
|
|
|
622
|
+
# In strict mode, all properties must be required
|
|
623
|
+
if remove_defaults and "properties" in new_schema:
|
|
624
|
+
new_schema["required"] = list(new_schema["properties"].keys())
|
|
625
|
+
|
|
621
626
|
# Remove default values if requested (for strict mode)
|
|
622
627
|
if remove_defaults and "default" in new_schema:
|
|
623
628
|
del new_schema["default"]
|
|
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
|
|
File without changes
|
{lm_deluge-0.0.64 → lm_deluge-0.0.66}/src/lm_deluge/built_in_tools/anthropic/computer_use.py
RENAMED
|
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
|
|
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
|
|
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
|
|
File without changes
|