agenthub-python 0.4.6__tar.gz → 0.4.7__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.6 → agenthub_python-0.4.7}/PKG-INFO +1 -1
- {agenthub_python-0.4.6 → agenthub_python-0.4.7}/agenthub/gemini3_7/client.py +26 -1
- {agenthub_python-0.4.6 → agenthub_python-0.4.7}/pyproject.toml +1 -1
- {agenthub_python-0.4.6 → agenthub_python-0.4.7}/pyproject.toml.orig +1 -1
- {agenthub_python-0.4.6 → agenthub_python-0.4.7}/README.md +0 -0
- {agenthub_python-0.4.6 → agenthub_python-0.4.7}/agenthub/__init__.py +0 -0
- {agenthub_python-0.4.6 → agenthub_python-0.4.7}/agenthub/abort_signal.py +0 -0
- {agenthub_python-0.4.6 → agenthub_python-0.4.7}/agenthub/ant_messages/__init__.py +0 -0
- {agenthub_python-0.4.6 → agenthub_python-0.4.7}/agenthub/ant_messages/client.py +0 -0
- {agenthub_python-0.4.6 → agenthub_python-0.4.7}/agenthub/auto_client.py +0 -0
- {agenthub_python-0.4.6 → agenthub_python-0.4.7}/agenthub/base_client.py +0 -0
- {agenthub_python-0.4.6 → agenthub_python-0.4.7}/agenthub/claude5/__init__.py +0 -0
- {agenthub_python-0.4.6 → agenthub_python-0.4.7}/agenthub/claude5/client.py +0 -0
- {agenthub_python-0.4.6 → agenthub_python-0.4.7}/agenthub/deepseek_v4/__init__.py +0 -0
- {agenthub_python-0.4.6 → agenthub_python-0.4.7}/agenthub/deepseek_v4/client.py +0 -0
- {agenthub_python-0.4.6 → agenthub_python-0.4.7}/agenthub/errors.py +0 -0
- {agenthub_python-0.4.6 → agenthub_python-0.4.7}/agenthub/gemini3_7/__init__.py +0 -0
- {agenthub_python-0.4.6 → agenthub_python-0.4.7}/agenthub/glm5_3/__init__.py +0 -0
- {agenthub_python-0.4.6 → agenthub_python-0.4.7}/agenthub/glm5_3/client.py +0 -0
- {agenthub_python-0.4.6 → agenthub_python-0.4.7}/agenthub/gpt5_6/__init__.py +0 -0
- {agenthub_python-0.4.6 → agenthub_python-0.4.7}/agenthub/gpt5_6/client.py +0 -0
- {agenthub_python-0.4.6 → agenthub_python-0.4.7}/agenthub/integration/__init__.py +0 -0
- {agenthub_python-0.4.6 → agenthub_python-0.4.7}/agenthub/integration/playground.py +0 -0
- {agenthub_python-0.4.6 → agenthub_python-0.4.7}/agenthub/integration/tracer.py +0 -0
- {agenthub_python-0.4.6 → agenthub_python-0.4.7}/agenthub/kimi_k3/__init__.py +0 -0
- {agenthub_python-0.4.6 → agenthub_python-0.4.7}/agenthub/kimi_k3/client.py +0 -0
- {agenthub_python-0.4.6 → agenthub_python-0.4.7}/agenthub/minimax_m3/__init__.py +0 -0
- {agenthub_python-0.4.6 → agenthub_python-0.4.7}/agenthub/minimax_m3/client.py +0 -0
- {agenthub_python-0.4.6 → agenthub_python-0.4.7}/agenthub/openai_chat/__init__.py +0 -0
- {agenthub_python-0.4.6 → agenthub_python-0.4.7}/agenthub/openai_chat/client.py +0 -0
- {agenthub_python-0.4.6 → agenthub_python-0.4.7}/agenthub/openai_embedding/__init__.py +0 -0
- {agenthub_python-0.4.6 → agenthub_python-0.4.7}/agenthub/openai_embedding/client.py +0 -0
- {agenthub_python-0.4.6 → agenthub_python-0.4.7}/agenthub/openai_responses/__init__.py +0 -0
- {agenthub_python-0.4.6 → agenthub_python-0.4.7}/agenthub/openai_responses/client.py +0 -0
- {agenthub_python-0.4.6 → agenthub_python-0.4.7}/agenthub/registry.py +0 -0
- {agenthub_python-0.4.6 → agenthub_python-0.4.7}/agenthub/types.py +0 -0
- {agenthub_python-0.4.6 → agenthub_python-0.4.7}/agenthub/utils.py +0 -0
|
@@ -43,6 +43,24 @@ from ..types import (
|
|
|
43
43
|
from ..utils import is_debug_enabled
|
|
44
44
|
|
|
45
45
|
|
|
46
|
+
def _split_function_response_runs(parts: list[types.Part]) -> list[list[types.Part]]:
|
|
47
|
+
"""Split parts into consecutive runs of function_response and other parts.
|
|
48
|
+
|
|
49
|
+
Vertex AI requires function responses to sit in a content of their own (see the call
|
|
50
|
+
site); order is preserved, and a message without function responses — or with nothing
|
|
51
|
+
else — comes back as one run.
|
|
52
|
+
"""
|
|
53
|
+
runs: list[list[types.Part]] = []
|
|
54
|
+
last_is_response: bool | None = None
|
|
55
|
+
for part in parts:
|
|
56
|
+
is_response = part.function_response is not None
|
|
57
|
+
if is_response != last_is_response:
|
|
58
|
+
runs.append([])
|
|
59
|
+
last_is_response = is_response
|
|
60
|
+
runs[-1].append(part)
|
|
61
|
+
return runs if runs else [parts]
|
|
62
|
+
|
|
63
|
+
|
|
46
64
|
class Gemini3_7Client(LLMClient):
|
|
47
65
|
"""Unified client for the Gemini family, named for the newest generation it serves (3.7).
|
|
48
66
|
|
|
@@ -377,7 +395,14 @@ class Gemini3_7Client(LLMClient):
|
|
|
377
395
|
else:
|
|
378
396
|
raise ValueError(f"Unknown item: {item}")
|
|
379
397
|
|
|
380
|
-
|
|
398
|
+
# Vertex AI rejects a content that mixes function_response parts with any other
|
|
399
|
+
# part kind — the request fails with a misleading 400, "Requests ending with a
|
|
400
|
+
# model turn are not supported" (the Gemini API endpoint accepts the mix). Split
|
|
401
|
+
# such a message into consecutive same-role contents: each run of function
|
|
402
|
+
# responses becomes its own content, the surrounding parts keep theirs, and the
|
|
403
|
+
# part order is preserved. Homogeneous messages stay a single content.
|
|
404
|
+
for run_parts in _split_function_response_runs(parts):
|
|
405
|
+
contents.append(types.Content(role=mapping[msg["role"]], parts=run_parts))
|
|
381
406
|
|
|
382
407
|
return contents
|
|
383
408
|
|
|
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
|