lm-deluge 0.0.62__tar.gz → 0.0.64__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.62/src/lm_deluge.egg-info → lm_deluge-0.0.64}/PKG-INFO +1 -1
- {lm_deluge-0.0.62 → lm_deluge-0.0.64}/pyproject.toml +1 -1
- {lm_deluge-0.0.62 → lm_deluge-0.0.64}/src/lm_deluge/client.py +4 -4
- {lm_deluge-0.0.62 → lm_deluge-0.0.64}/src/lm_deluge/config.py +1 -1
- {lm_deluge-0.0.62 → lm_deluge-0.0.64}/src/lm_deluge/tool.py +51 -0
- {lm_deluge-0.0.62 → lm_deluge-0.0.64/src/lm_deluge.egg-info}/PKG-INFO +1 -1
- {lm_deluge-0.0.62 → lm_deluge-0.0.64}/LICENSE +0 -0
- {lm_deluge-0.0.62 → lm_deluge-0.0.64}/README.md +0 -0
- {lm_deluge-0.0.62 → lm_deluge-0.0.64}/setup.cfg +0 -0
- {lm_deluge-0.0.62 → lm_deluge-0.0.64}/src/lm_deluge/__init__.py +0 -0
- {lm_deluge-0.0.62 → lm_deluge-0.0.64}/src/lm_deluge/api_requests/__init__.py +0 -0
- {lm_deluge-0.0.62 → lm_deluge-0.0.64}/src/lm_deluge/api_requests/anthropic.py +0 -0
- {lm_deluge-0.0.62 → lm_deluge-0.0.64}/src/lm_deluge/api_requests/base.py +0 -0
- {lm_deluge-0.0.62 → lm_deluge-0.0.64}/src/lm_deluge/api_requests/bedrock.py +0 -0
- {lm_deluge-0.0.62 → lm_deluge-0.0.64}/src/lm_deluge/api_requests/common.py +0 -0
- {lm_deluge-0.0.62 → lm_deluge-0.0.64}/src/lm_deluge/api_requests/deprecated/bedrock.py +0 -0
- {lm_deluge-0.0.62 → lm_deluge-0.0.64}/src/lm_deluge/api_requests/deprecated/cohere.py +0 -0
- {lm_deluge-0.0.62 → lm_deluge-0.0.64}/src/lm_deluge/api_requests/deprecated/deepseek.py +0 -0
- {lm_deluge-0.0.62 → lm_deluge-0.0.64}/src/lm_deluge/api_requests/deprecated/mistral.py +0 -0
- {lm_deluge-0.0.62 → lm_deluge-0.0.64}/src/lm_deluge/api_requests/deprecated/vertex.py +0 -0
- {lm_deluge-0.0.62 → lm_deluge-0.0.64}/src/lm_deluge/api_requests/gemini.py +0 -0
- {lm_deluge-0.0.62 → lm_deluge-0.0.64}/src/lm_deluge/api_requests/mistral.py +0 -0
- {lm_deluge-0.0.62 → lm_deluge-0.0.64}/src/lm_deluge/api_requests/openai.py +0 -0
- {lm_deluge-0.0.62 → lm_deluge-0.0.64}/src/lm_deluge/api_requests/response.py +0 -0
- {lm_deluge-0.0.62 → lm_deluge-0.0.64}/src/lm_deluge/batches.py +0 -0
- {lm_deluge-0.0.62 → lm_deluge-0.0.64}/src/lm_deluge/built_in_tools/anthropic/__init__.py +0 -0
- {lm_deluge-0.0.62 → lm_deluge-0.0.64}/src/lm_deluge/built_in_tools/anthropic/bash.py +0 -0
- {lm_deluge-0.0.62 → lm_deluge-0.0.64}/src/lm_deluge/built_in_tools/anthropic/computer_use.py +0 -0
- {lm_deluge-0.0.62 → lm_deluge-0.0.64}/src/lm_deluge/built_in_tools/anthropic/editor.py +0 -0
- {lm_deluge-0.0.62 → lm_deluge-0.0.64}/src/lm_deluge/built_in_tools/base.py +0 -0
- {lm_deluge-0.0.62 → lm_deluge-0.0.64}/src/lm_deluge/built_in_tools/openai.py +0 -0
- {lm_deluge-0.0.62 → lm_deluge-0.0.64}/src/lm_deluge/cache.py +0 -0
- {lm_deluge-0.0.62 → lm_deluge-0.0.64}/src/lm_deluge/cli.py +0 -0
- {lm_deluge-0.0.62 → lm_deluge-0.0.64}/src/lm_deluge/embed.py +0 -0
- {lm_deluge-0.0.62 → lm_deluge-0.0.64}/src/lm_deluge/errors.py +0 -0
- {lm_deluge-0.0.62 → lm_deluge-0.0.64}/src/lm_deluge/file.py +0 -0
- {lm_deluge-0.0.62 → lm_deluge-0.0.64}/src/lm_deluge/image.py +0 -0
- {lm_deluge-0.0.62 → lm_deluge-0.0.64}/src/lm_deluge/llm_tools/__init__.py +0 -0
- {lm_deluge-0.0.62 → lm_deluge-0.0.64}/src/lm_deluge/llm_tools/classify.py +0 -0
- {lm_deluge-0.0.62 → lm_deluge-0.0.64}/src/lm_deluge/llm_tools/extract.py +0 -0
- {lm_deluge-0.0.62 → lm_deluge-0.0.64}/src/lm_deluge/llm_tools/locate.py +0 -0
- {lm_deluge-0.0.62 → lm_deluge-0.0.64}/src/lm_deluge/llm_tools/ocr.py +0 -0
- {lm_deluge-0.0.62 → lm_deluge-0.0.64}/src/lm_deluge/llm_tools/score.py +0 -0
- {lm_deluge-0.0.62 → lm_deluge-0.0.64}/src/lm_deluge/llm_tools/translate.py +0 -0
- {lm_deluge-0.0.62 → lm_deluge-0.0.64}/src/lm_deluge/models/__init__.py +0 -0
- {lm_deluge-0.0.62 → lm_deluge-0.0.64}/src/lm_deluge/models/anthropic.py +0 -0
- {lm_deluge-0.0.62 → lm_deluge-0.0.64}/src/lm_deluge/models/bedrock.py +0 -0
- {lm_deluge-0.0.62 → lm_deluge-0.0.64}/src/lm_deluge/models/cerebras.py +0 -0
- {lm_deluge-0.0.62 → lm_deluge-0.0.64}/src/lm_deluge/models/cohere.py +0 -0
- {lm_deluge-0.0.62 → lm_deluge-0.0.64}/src/lm_deluge/models/deepseek.py +0 -0
- {lm_deluge-0.0.62 → lm_deluge-0.0.64}/src/lm_deluge/models/fireworks.py +0 -0
- {lm_deluge-0.0.62 → lm_deluge-0.0.64}/src/lm_deluge/models/google.py +0 -0
- {lm_deluge-0.0.62 → lm_deluge-0.0.64}/src/lm_deluge/models/grok.py +0 -0
- {lm_deluge-0.0.62 → lm_deluge-0.0.64}/src/lm_deluge/models/groq.py +0 -0
- {lm_deluge-0.0.62 → lm_deluge-0.0.64}/src/lm_deluge/models/meta.py +0 -0
- {lm_deluge-0.0.62 → lm_deluge-0.0.64}/src/lm_deluge/models/mistral.py +0 -0
- {lm_deluge-0.0.62 → lm_deluge-0.0.64}/src/lm_deluge/models/openai.py +0 -0
- {lm_deluge-0.0.62 → lm_deluge-0.0.64}/src/lm_deluge/models/openrouter.py +0 -0
- {lm_deluge-0.0.62 → lm_deluge-0.0.64}/src/lm_deluge/models/together.py +0 -0
- {lm_deluge-0.0.62 → lm_deluge-0.0.64}/src/lm_deluge/presets/cerebras.py +0 -0
- {lm_deluge-0.0.62 → lm_deluge-0.0.64}/src/lm_deluge/presets/meta.py +0 -0
- {lm_deluge-0.0.62 → lm_deluge-0.0.64}/src/lm_deluge/prompt.py +0 -0
- {lm_deluge-0.0.62 → lm_deluge-0.0.64}/src/lm_deluge/request_context.py +0 -0
- {lm_deluge-0.0.62 → lm_deluge-0.0.64}/src/lm_deluge/rerank.py +0 -0
- {lm_deluge-0.0.62 → lm_deluge-0.0.64}/src/lm_deluge/tracker.py +0 -0
- {lm_deluge-0.0.62 → lm_deluge-0.0.64}/src/lm_deluge/usage.py +0 -0
- {lm_deluge-0.0.62 → lm_deluge-0.0.64}/src/lm_deluge/util/harmony.py +0 -0
- {lm_deluge-0.0.62 → lm_deluge-0.0.64}/src/lm_deluge/util/json.py +0 -0
- {lm_deluge-0.0.62 → lm_deluge-0.0.64}/src/lm_deluge/util/logprobs.py +0 -0
- {lm_deluge-0.0.62 → lm_deluge-0.0.64}/src/lm_deluge/util/spatial.py +0 -0
- {lm_deluge-0.0.62 → lm_deluge-0.0.64}/src/lm_deluge/util/validation.py +0 -0
- {lm_deluge-0.0.62 → lm_deluge-0.0.64}/src/lm_deluge/util/xml.py +0 -0
- {lm_deluge-0.0.62 → lm_deluge-0.0.64}/src/lm_deluge/warnings.py +0 -0
- {lm_deluge-0.0.62 → lm_deluge-0.0.64}/src/lm_deluge.egg-info/SOURCES.txt +0 -0
- {lm_deluge-0.0.62 → lm_deluge-0.0.64}/src/lm_deluge.egg-info/dependency_links.txt +0 -0
- {lm_deluge-0.0.62 → lm_deluge-0.0.64}/src/lm_deluge.egg-info/requires.txt +0 -0
- {lm_deluge-0.0.62 → lm_deluge-0.0.64}/src/lm_deluge.egg-info/top_level.txt +0 -0
- {lm_deluge-0.0.62 → lm_deluge-0.0.64}/tests/test_builtin_tools.py +0 -0
- {lm_deluge-0.0.62 → lm_deluge-0.0.64}/tests/test_file_upload.py +0 -0
- {lm_deluge-0.0.62 → lm_deluge-0.0.64}/tests/test_native_mcp_server.py +0 -0
- {lm_deluge-0.0.62 → lm_deluge-0.0.64}/tests/test_openrouter_generic.py +0 -0
|
@@ -70,7 +70,7 @@ class _LLMClient(BaseModel):
|
|
|
70
70
|
top_p: float = 1.0
|
|
71
71
|
json_mode: bool = False
|
|
72
72
|
max_new_tokens: int = 512
|
|
73
|
-
reasoning_effort: Literal["low", "medium", "high", None] = None
|
|
73
|
+
reasoning_effort: Literal["low", "medium", "high", "minimal", "none", None] = None
|
|
74
74
|
logprobs: bool = False
|
|
75
75
|
top_logprobs: int | None = None
|
|
76
76
|
force_local_mcp: bool = False
|
|
@@ -957,7 +957,7 @@ def LLMClient(
|
|
|
957
957
|
top_p: float = 1.0,
|
|
958
958
|
json_mode: bool = False,
|
|
959
959
|
max_new_tokens: int = 512,
|
|
960
|
-
reasoning_effort: Literal["low", "medium", "high", None] = None,
|
|
960
|
+
reasoning_effort: Literal["low", "medium", "high", "minimal", "none", None] = None,
|
|
961
961
|
logprobs: bool = False,
|
|
962
962
|
top_logprobs: int | None = None,
|
|
963
963
|
force_local_mcp: bool = False,
|
|
@@ -986,7 +986,7 @@ def LLMClient(
|
|
|
986
986
|
top_p: float = 1.0,
|
|
987
987
|
json_mode: bool = False,
|
|
988
988
|
max_new_tokens: int = 512,
|
|
989
|
-
reasoning_effort: Literal["low", "medium", "high", None] = None,
|
|
989
|
+
reasoning_effort: Literal["low", "medium", "high", "minimal", "none", None] = None,
|
|
990
990
|
logprobs: bool = False,
|
|
991
991
|
top_logprobs: int | None = None,
|
|
992
992
|
force_local_mcp: bool = False,
|
|
@@ -1014,7 +1014,7 @@ def LLMClient(
|
|
|
1014
1014
|
top_p: float = 1.0,
|
|
1015
1015
|
json_mode: bool = False,
|
|
1016
1016
|
max_new_tokens: int = 512,
|
|
1017
|
-
reasoning_effort: Literal["low", "medium", "high", None] = None,
|
|
1017
|
+
reasoning_effort: Literal["low", "medium", "high", "minimal", "none", None] = None,
|
|
1018
1018
|
logprobs: bool = False,
|
|
1019
1019
|
top_logprobs: int | None = None,
|
|
1020
1020
|
force_local_mcp: bool = False,
|
|
@@ -8,7 +8,7 @@ class SamplingParams(BaseModel):
|
|
|
8
8
|
top_p: float = 1.0
|
|
9
9
|
json_mode: bool = False
|
|
10
10
|
max_new_tokens: int = 512
|
|
11
|
-
reasoning_effort: Literal["low", "medium", "high", "none", None] = None
|
|
11
|
+
reasoning_effort: Literal["low", "medium", "high", "minimal", "none", None] = None
|
|
12
12
|
logprobs: bool = False
|
|
13
13
|
top_logprobs: int | None = None
|
|
14
14
|
|
|
@@ -239,6 +239,9 @@ async def _load_all_mcp_tools(client: Client) -> list["Tool"]:
|
|
|
239
239
|
|
|
240
240
|
tools: list[Tool] = []
|
|
241
241
|
for m in metas:
|
|
242
|
+
# Extract definitions from the schema (could be $defs or definitions)
|
|
243
|
+
definitions = m.inputSchema.get("$defs") or m.inputSchema.get("definitions")
|
|
244
|
+
|
|
242
245
|
tools.append(
|
|
243
246
|
Tool(
|
|
244
247
|
name=m.name,
|
|
@@ -246,6 +249,7 @@ async def _load_all_mcp_tools(client: Client) -> list["Tool"]:
|
|
|
246
249
|
parameters=m.inputSchema.get("properties", {}),
|
|
247
250
|
required=m.inputSchema.get("required", []),
|
|
248
251
|
additionalProperties=m.inputSchema.get("additionalProperties"),
|
|
252
|
+
definitions=definitions,
|
|
249
253
|
run=make_runner(m.name),
|
|
250
254
|
)
|
|
251
255
|
)
|
|
@@ -268,6 +272,8 @@ class Tool(BaseModel):
|
|
|
268
272
|
is_built_in: bool = False
|
|
269
273
|
type: str | None = None
|
|
270
274
|
built_in_args: dict[str, Any] = Field(default_factory=dict)
|
|
275
|
+
# JSON Schema definitions (for $ref support)
|
|
276
|
+
definitions: dict[str, Any] | None = None
|
|
271
277
|
|
|
272
278
|
@field_validator("name")
|
|
273
279
|
@classmethod
|
|
@@ -562,6 +568,34 @@ class Tool(BaseModel):
|
|
|
562
568
|
"""
|
|
563
569
|
return _python_type_to_json_schema_enhanced(python_type)
|
|
564
570
|
|
|
571
|
+
def _is_strict_mode_compatible(self) -> bool:
|
|
572
|
+
"""
|
|
573
|
+
Check if this tool's schema is compatible with OpenAI strict mode.
|
|
574
|
+
Strict mode requires all objects to have defined properties.
|
|
575
|
+
"""
|
|
576
|
+
|
|
577
|
+
def has_undefined_objects(schema: dict | list | Any) -> bool:
|
|
578
|
+
"""Recursively check for objects without defined properties."""
|
|
579
|
+
if isinstance(schema, dict):
|
|
580
|
+
# Check if this is an object type without properties
|
|
581
|
+
if schema.get("type") == "object":
|
|
582
|
+
# If additionalProperties is True or properties is missing/empty
|
|
583
|
+
if schema.get("additionalProperties") is True:
|
|
584
|
+
return True
|
|
585
|
+
if "properties" not in schema or not schema["properties"]:
|
|
586
|
+
return True
|
|
587
|
+
# Recursively check nested schemas
|
|
588
|
+
for value in schema.values():
|
|
589
|
+
if has_undefined_objects(value):
|
|
590
|
+
return True
|
|
591
|
+
elif isinstance(schema, list):
|
|
592
|
+
for item in schema:
|
|
593
|
+
if has_undefined_objects(item):
|
|
594
|
+
return True
|
|
595
|
+
return False
|
|
596
|
+
|
|
597
|
+
return not has_undefined_objects(self.parameters or {})
|
|
598
|
+
|
|
565
599
|
def _json_schema(
|
|
566
600
|
self, include_additional_properties=False, remove_defaults=False
|
|
567
601
|
) -> dict[str, Any]:
|
|
@@ -614,6 +648,14 @@ class Tool(BaseModel):
|
|
|
614
648
|
else:
|
|
615
649
|
processed_parameters = self.parameters
|
|
616
650
|
|
|
651
|
+
# Process definitions too
|
|
652
|
+
if self.definitions and include_additional_properties:
|
|
653
|
+
processed_definitions = _add_additional_properties_recursive(
|
|
654
|
+
self.definitions, remove_defaults
|
|
655
|
+
)
|
|
656
|
+
else:
|
|
657
|
+
processed_definitions = self.definitions
|
|
658
|
+
|
|
617
659
|
res = {
|
|
618
660
|
"type": "object",
|
|
619
661
|
"properties": processed_parameters,
|
|
@@ -623,6 +665,10 @@ class Tool(BaseModel):
|
|
|
623
665
|
if include_additional_properties:
|
|
624
666
|
res["additionalProperties"] = False
|
|
625
667
|
|
|
668
|
+
# Include definitions if present (for $ref support)
|
|
669
|
+
if processed_definitions:
|
|
670
|
+
res["$defs"] = processed_definitions
|
|
671
|
+
|
|
626
672
|
return res
|
|
627
673
|
|
|
628
674
|
# ---------- dumpers ----------
|
|
@@ -631,6 +677,11 @@ class Tool(BaseModel):
|
|
|
631
677
|
) -> dict[str, Any]:
|
|
632
678
|
if self.is_built_in:
|
|
633
679
|
return {"type": self.type, **self.built_in_args, **kwargs}
|
|
680
|
+
|
|
681
|
+
# Check if schema is compatible with strict mode
|
|
682
|
+
if strict and not self._is_strict_mode_compatible():
|
|
683
|
+
strict = False
|
|
684
|
+
|
|
634
685
|
if strict:
|
|
635
686
|
# For strict mode, remove defaults and make all parameters required
|
|
636
687
|
schema = self._json_schema(
|
|
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
|
{lm_deluge-0.0.62 → lm_deluge-0.0.64}/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
|