agenthub-python 0.4.3__tar.gz → 0.4.4__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.
- {agenthub_python-0.4.3 → agenthub_python-0.4.4}/PKG-INFO +1 -1
- {agenthub_python-0.4.3 → agenthub_python-0.4.4}/agenthub/ant_messages/client.py +1 -0
- {agenthub_python-0.4.3 → agenthub_python-0.4.4}/agenthub/claude5/client.py +2 -0
- {agenthub_python-0.4.3 → agenthub_python-0.4.4}/agenthub/deepseek_v4/client.py +10 -3
- {agenthub_python-0.4.3 → agenthub_python-0.4.4}/agenthub/gemini3_7/client.py +9 -5
- {agenthub_python-0.4.3 → agenthub_python-0.4.4}/agenthub/glm5_3/client.py +2 -0
- {agenthub_python-0.4.3 → agenthub_python-0.4.4}/agenthub/gpt5_6/client.py +1 -0
- {agenthub_python-0.4.3 → agenthub_python-0.4.4}/agenthub/integration/playground.py +2 -1
- {agenthub_python-0.4.3 → agenthub_python-0.4.4}/agenthub/kimi_k3/client.py +2 -0
- {agenthub_python-0.4.3 → agenthub_python-0.4.4}/agenthub/minimax_m3/client.py +2 -0
- {agenthub_python-0.4.3 → agenthub_python-0.4.4}/agenthub/openai_responses/client.py +1 -0
- {agenthub_python-0.4.3 → agenthub_python-0.4.4}/agenthub/types.py +1 -0
- {agenthub_python-0.4.3 → agenthub_python-0.4.4}/pyproject.toml +1 -1
- {agenthub_python-0.4.3 → agenthub_python-0.4.4}/pyproject.toml.orig +1 -1
- {agenthub_python-0.4.3 → agenthub_python-0.4.4}/README.md +0 -0
- {agenthub_python-0.4.3 → agenthub_python-0.4.4}/agenthub/__init__.py +0 -0
- {agenthub_python-0.4.3 → agenthub_python-0.4.4}/agenthub/abort_signal.py +0 -0
- {agenthub_python-0.4.3 → agenthub_python-0.4.4}/agenthub/ant_messages/__init__.py +0 -0
- {agenthub_python-0.4.3 → agenthub_python-0.4.4}/agenthub/auto_client.py +0 -0
- {agenthub_python-0.4.3 → agenthub_python-0.4.4}/agenthub/base_client.py +0 -0
- {agenthub_python-0.4.3 → agenthub_python-0.4.4}/agenthub/claude5/__init__.py +0 -0
- {agenthub_python-0.4.3 → agenthub_python-0.4.4}/agenthub/deepseek_v4/__init__.py +0 -0
- {agenthub_python-0.4.3 → agenthub_python-0.4.4}/agenthub/errors.py +0 -0
- {agenthub_python-0.4.3 → agenthub_python-0.4.4}/agenthub/gemini3_7/__init__.py +0 -0
- {agenthub_python-0.4.3 → agenthub_python-0.4.4}/agenthub/glm5_3/__init__.py +0 -0
- {agenthub_python-0.4.3 → agenthub_python-0.4.4}/agenthub/gpt5_6/__init__.py +0 -0
- {agenthub_python-0.4.3 → agenthub_python-0.4.4}/agenthub/integration/__init__.py +0 -0
- {agenthub_python-0.4.3 → agenthub_python-0.4.4}/agenthub/integration/tracer.py +0 -0
- {agenthub_python-0.4.3 → agenthub_python-0.4.4}/agenthub/kimi_k3/__init__.py +0 -0
- {agenthub_python-0.4.3 → agenthub_python-0.4.4}/agenthub/minimax_m3/__init__.py +0 -0
- {agenthub_python-0.4.3 → agenthub_python-0.4.4}/agenthub/openai_chat/__init__.py +0 -0
- {agenthub_python-0.4.3 → agenthub_python-0.4.4}/agenthub/openai_chat/client.py +0 -0
- {agenthub_python-0.4.3 → agenthub_python-0.4.4}/agenthub/openai_embedding/__init__.py +0 -0
- {agenthub_python-0.4.3 → agenthub_python-0.4.4}/agenthub/openai_embedding/client.py +0 -0
- {agenthub_python-0.4.3 → agenthub_python-0.4.4}/agenthub/openai_responses/__init__.py +0 -0
- {agenthub_python-0.4.3 → agenthub_python-0.4.4}/agenthub/registry.py +0 -0
- {agenthub_python-0.4.3 → agenthub_python-0.4.4}/agenthub/utils.py +0 -0
|
@@ -75,6 +75,7 @@ class AntMessagesClient(LLMClient):
|
|
|
75
75
|
ThinkingLevel.MEDIUM: {"thinking": {"type": "adaptive"}, "output_config": {"effort": "medium"}},
|
|
76
76
|
ThinkingLevel.HIGH: {"thinking": {"type": "adaptive"}, "output_config": {"effort": "high"}},
|
|
77
77
|
ThinkingLevel.XHIGH: {"thinking": {"type": "adaptive"}, "output_config": {"effort": "xhigh"}},
|
|
78
|
+
ThinkingLevel.MAX: {"thinking": {"type": "adaptive"}, "output_config": {"effort": "max"}},
|
|
78
79
|
}
|
|
79
80
|
return mapping.get(thinking_level)
|
|
80
81
|
|
|
@@ -115,6 +115,8 @@ class Claude5Client(LLMClient):
|
|
|
115
115
|
"thinking": {"type": "adaptive"},
|
|
116
116
|
"output_config": {"effort": "high" if "4-6" in self._model else "xhigh"},
|
|
117
117
|
},
|
|
118
|
+
# every model this client serves is 4.6 or later, and max spans that whole range
|
|
119
|
+
ThinkingLevel.MAX: {"thinking": {"type": "adaptive"}, "output_config": {"effort": "max"}},
|
|
118
120
|
}
|
|
119
121
|
return mapping.get(thinking_level)
|
|
120
122
|
|
|
@@ -54,17 +54,24 @@ class DeepSeekV4Client(LLMClient):
|
|
|
54
54
|
ThinkingLevel.MEDIUM: {"type": "enabled"},
|
|
55
55
|
ThinkingLevel.HIGH: {"type": "enabled"},
|
|
56
56
|
ThinkingLevel.XHIGH: {"type": "enabled"},
|
|
57
|
+
ThinkingLevel.MAX: {"type": "enabled"},
|
|
57
58
|
}
|
|
58
59
|
return mapping[thinking_level]
|
|
59
60
|
|
|
60
61
|
def _convert_reasoning_effort(self, thinking_level: ThinkingLevel) -> str | None:
|
|
61
|
-
"""Convert ThinkingLevel enum to DeepSeek's reasoning_effort.
|
|
62
|
+
"""Convert ThinkingLevel enum to DeepSeek's reasoning_effort.
|
|
63
|
+
|
|
64
|
+
DeepSeek accepts low/high/max and maps medium and xhigh onto high server-side
|
|
65
|
+
(llmsdk_docs/deepseek_v4/docs/thinking-mode.md), so this sends the value the
|
|
66
|
+
server would settle on anyway.
|
|
67
|
+
"""
|
|
62
68
|
mapping = {
|
|
63
69
|
ThinkingLevel.NONE: None,
|
|
64
|
-
ThinkingLevel.LOW: "
|
|
70
|
+
ThinkingLevel.LOW: "low",
|
|
65
71
|
ThinkingLevel.MEDIUM: "high",
|
|
66
72
|
ThinkingLevel.HIGH: "high",
|
|
67
|
-
ThinkingLevel.XHIGH: "
|
|
73
|
+
ThinkingLevel.XHIGH: "high",
|
|
74
|
+
ThinkingLevel.MAX: "max",
|
|
68
75
|
}
|
|
69
76
|
return mapping[thinking_level]
|
|
70
77
|
|
|
@@ -142,6 +142,8 @@ class Gemini3_7Client(LLMClient):
|
|
|
142
142
|
ThinkingLevel.MEDIUM: types.ThinkingLevel.MEDIUM,
|
|
143
143
|
ThinkingLevel.HIGH: types.ThinkingLevel.HIGH,
|
|
144
144
|
ThinkingLevel.XHIGH: types.ThinkingLevel.HIGH,
|
|
145
|
+
# Gemini stops at "high", so both top levels land there before per-model clamping
|
|
146
|
+
ThinkingLevel.MAX: types.ThinkingLevel.HIGH,
|
|
145
147
|
}
|
|
146
148
|
level = mapping.get(thinking_level)
|
|
147
149
|
if level is None:
|
|
@@ -201,6 +203,8 @@ class Gemini3_7Client(LLMClient):
|
|
|
201
203
|
"sampling parameters starting with the 3.6 generation.",
|
|
202
204
|
)
|
|
203
205
|
|
|
206
|
+
# include_thoughts asks for thought summaries, but whether generateContent returns any
|
|
207
|
+
# is model-dependent (llmsdk_docs/gemini3_7/docs/thinking.md)
|
|
204
208
|
thinking_summary = config.get("thinking_summary")
|
|
205
209
|
thinking_level = config.get("thinking_level")
|
|
206
210
|
if thinking_summary is not None or thinking_level is not None:
|
|
@@ -376,11 +380,6 @@ class Gemini3_7Client(LLMClient):
|
|
|
376
380
|
usage_metadata: UsageMetadata | None = None
|
|
377
381
|
finish_reason: FinishReason | None = None
|
|
378
382
|
|
|
379
|
-
if not model_output.candidates and not model_output.usage_metadata:
|
|
380
|
-
# gateways inject heartbeat chunks on long generations; they map to a chunk with
|
|
381
|
-
# neither candidates nor usage, so there is nothing to emit
|
|
382
|
-
event_type = "unused"
|
|
383
|
-
|
|
384
383
|
if model_output.candidates:
|
|
385
384
|
candidate = model_output.candidates[0]
|
|
386
385
|
content = getattr(candidate, "content", None)
|
|
@@ -441,6 +440,11 @@ class Gemini3_7Client(LLMClient):
|
|
|
441
440
|
"response_tokens": model_output.usage_metadata.candidates_token_count,
|
|
442
441
|
}
|
|
443
442
|
|
|
443
|
+
if not content_items and usage_metadata is None and finish_reason is None:
|
|
444
|
+
# nothing was read out of the chunk, so there is nothing to emit: a gateway
|
|
445
|
+
# heartbeat looks like this, and so does any other chunk we take no value from
|
|
446
|
+
event_type = "unused"
|
|
447
|
+
|
|
444
448
|
return {
|
|
445
449
|
"role": "assistant",
|
|
446
450
|
"event_type": event_type,
|
|
@@ -81,6 +81,7 @@ class GLM5_3Client(LLMClient):
|
|
|
81
81
|
ThinkingLevel.MEDIUM: "high",
|
|
82
82
|
ThinkingLevel.HIGH: "high",
|
|
83
83
|
ThinkingLevel.XHIGH: "max",
|
|
84
|
+
ThinkingLevel.MAX: "max",
|
|
84
85
|
}
|
|
85
86
|
return mapping.get(thinking_level)
|
|
86
87
|
if "glm-5.2" in model:
|
|
@@ -90,6 +91,7 @@ class GLM5_3Client(LLMClient):
|
|
|
90
91
|
ThinkingLevel.MEDIUM: "medium",
|
|
91
92
|
ThinkingLevel.HIGH: "high",
|
|
92
93
|
ThinkingLevel.XHIGH: "xhigh",
|
|
94
|
+
ThinkingLevel.MAX: "max",
|
|
93
95
|
}
|
|
94
96
|
return mapping.get(thinking_level)
|
|
95
97
|
return None
|
|
@@ -286,7 +286,8 @@ def create_chat_app() -> Flask:
|
|
|
286
286
|
<button type="button" role="option" aria-selected="false" class="w-full px-3 py-2 text-left hover:bg-gray-50 focus:bg-gray-50 focus:outline-none" data-combobox-option data-value="low" data-label="Low" data-description="Low thinking budget" onclick="selectComboboxOption('thinkingLevelCombobox', this)">Low</button>
|
|
287
287
|
<button type="button" role="option" aria-selected="false" class="w-full px-3 py-2 text-left hover:bg-gray-50 focus:bg-gray-50 focus:outline-none" data-combobox-option data-value="medium" data-label="Medium" data-description="Medium thinking budget" onclick="selectComboboxOption('thinkingLevelCombobox', this)">Medium</button>
|
|
288
288
|
<button type="button" role="option" aria-selected="false" class="w-full px-3 py-2 text-left hover:bg-gray-50 focus:bg-gray-50 focus:outline-none" data-combobox-option data-value="high" data-label="High" data-description="High thinking budget" onclick="selectComboboxOption('thinkingLevelCombobox', this)">High</button>
|
|
289
|
-
<button type="button" role="option" aria-selected="false" class="w-full px-3 py-2 text-left hover:bg-gray-50 focus:bg-gray-50 focus:outline-none" data-combobox-option data-value="xhigh" data-label="XHigh" data-description="
|
|
289
|
+
<button type="button" role="option" aria-selected="false" class="w-full px-3 py-2 text-left hover:bg-gray-50 focus:bg-gray-50 focus:outline-none" data-combobox-option data-value="xhigh" data-label="XHigh" data-description="Extended thinking budget" onclick="selectComboboxOption('thinkingLevelCombobox', this)">XHigh</button>
|
|
290
|
+
<button type="button" role="option" aria-selected="false" class="w-full px-3 py-2 text-left hover:bg-gray-50 focus:bg-gray-50 focus:outline-none" data-combobox-option data-value="max" data-label="Max" data-description="Maximum thinking budget" onclick="selectComboboxOption('thinkingLevelCombobox', this)">Max</button>
|
|
290
291
|
</div>
|
|
291
292
|
</div>
|
|
292
293
|
</div>
|
|
@@ -78,6 +78,7 @@ class KimiK3Client(LLMClient):
|
|
|
78
78
|
ThinkingLevel.MEDIUM: {"type": "enabled", "keep": "all"},
|
|
79
79
|
ThinkingLevel.HIGH: {"type": "enabled", "keep": "all"},
|
|
80
80
|
ThinkingLevel.XHIGH: {"type": "enabled", "keep": "all"},
|
|
81
|
+
ThinkingLevel.MAX: {"type": "enabled", "keep": "all"},
|
|
81
82
|
}
|
|
82
83
|
return mapping.get(thinking_level)
|
|
83
84
|
|
|
@@ -92,6 +93,7 @@ class KimiK3Client(LLMClient):
|
|
|
92
93
|
ThinkingLevel.MEDIUM: "high",
|
|
93
94
|
ThinkingLevel.HIGH: "high",
|
|
94
95
|
ThinkingLevel.XHIGH: "max",
|
|
96
|
+
ThinkingLevel.MAX: "max",
|
|
95
97
|
}
|
|
96
98
|
return mapping.get(thinking_level)
|
|
97
99
|
|
|
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
|