agenthub-python 0.4.12__tar.gz → 0.4.13__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.
Files changed (39) hide show
  1. {agenthub_python-0.4.12 → agenthub_python-0.4.13}/PKG-INFO +1 -1
  2. {agenthub_python-0.4.12 → agenthub_python-0.4.13}/agenthub/openai_chat/client.py +16 -3
  3. {agenthub_python-0.4.12 → agenthub_python-0.4.13}/pyproject.toml +1 -1
  4. {agenthub_python-0.4.12 → agenthub_python-0.4.13}/pyproject.toml.orig +1 -1
  5. {agenthub_python-0.4.12 → agenthub_python-0.4.13}/README.md +0 -0
  6. {agenthub_python-0.4.12 → agenthub_python-0.4.13}/agenthub/__init__.py +0 -0
  7. {agenthub_python-0.4.12 → agenthub_python-0.4.13}/agenthub/abort_signal.py +0 -0
  8. {agenthub_python-0.4.12 → agenthub_python-0.4.13}/agenthub/ant_messages/__init__.py +0 -0
  9. {agenthub_python-0.4.12 → agenthub_python-0.4.13}/agenthub/ant_messages/client.py +0 -0
  10. {agenthub_python-0.4.12 → agenthub_python-0.4.13}/agenthub/auto_client.py +0 -0
  11. {agenthub_python-0.4.12 → agenthub_python-0.4.13}/agenthub/base_client.py +0 -0
  12. {agenthub_python-0.4.12 → agenthub_python-0.4.13}/agenthub/claude5/__init__.py +0 -0
  13. {agenthub_python-0.4.12 → agenthub_python-0.4.13}/agenthub/claude5/client.py +0 -0
  14. {agenthub_python-0.4.12 → agenthub_python-0.4.13}/agenthub/deepseek_v4/__init__.py +0 -0
  15. {agenthub_python-0.4.12 → agenthub_python-0.4.13}/agenthub/deepseek_v4/client.py +0 -0
  16. {agenthub_python-0.4.12 → agenthub_python-0.4.13}/agenthub/errors.py +0 -0
  17. {agenthub_python-0.4.12 → agenthub_python-0.4.13}/agenthub/gemini3_8/__init__.py +0 -0
  18. {agenthub_python-0.4.12 → agenthub_python-0.4.13}/agenthub/gemini3_8/client.py +0 -0
  19. {agenthub_python-0.4.12 → agenthub_python-0.4.13}/agenthub/glm5_3/__init__.py +0 -0
  20. {agenthub_python-0.4.12 → agenthub_python-0.4.13}/agenthub/glm5_3/client.py +0 -0
  21. {agenthub_python-0.4.12 → agenthub_python-0.4.13}/agenthub/gpt6/__init__.py +0 -0
  22. {agenthub_python-0.4.12 → agenthub_python-0.4.13}/agenthub/gpt6/client.py +0 -0
  23. {agenthub_python-0.4.12 → agenthub_python-0.4.13}/agenthub/integration/__init__.py +0 -0
  24. {agenthub_python-0.4.12 → agenthub_python-0.4.13}/agenthub/integration/playground.py +0 -0
  25. {agenthub_python-0.4.12 → agenthub_python-0.4.13}/agenthub/integration/tracer.py +0 -0
  26. {agenthub_python-0.4.12 → agenthub_python-0.4.13}/agenthub/kimi_k3/__init__.py +0 -0
  27. {agenthub_python-0.4.12 → agenthub_python-0.4.13}/agenthub/kimi_k3/client.py +0 -0
  28. {agenthub_python-0.4.12 → agenthub_python-0.4.13}/agenthub/minimax_m3/__init__.py +0 -0
  29. {agenthub_python-0.4.12 → agenthub_python-0.4.13}/agenthub/minimax_m3/client.py +0 -0
  30. {agenthub_python-0.4.12 → agenthub_python-0.4.13}/agenthub/openai_chat/__init__.py +0 -0
  31. {agenthub_python-0.4.12 → agenthub_python-0.4.13}/agenthub/openai_chat_vllm_adapter/__init__.py +0 -0
  32. {agenthub_python-0.4.12 → agenthub_python-0.4.13}/agenthub/openai_chat_vllm_adapter/client.py +0 -0
  33. {agenthub_python-0.4.12 → agenthub_python-0.4.13}/agenthub/openai_embedding/__init__.py +0 -0
  34. {agenthub_python-0.4.12 → agenthub_python-0.4.13}/agenthub/openai_embedding/client.py +0 -0
  35. {agenthub_python-0.4.12 → agenthub_python-0.4.13}/agenthub/openai_responses/__init__.py +0 -0
  36. {agenthub_python-0.4.12 → agenthub_python-0.4.13}/agenthub/openai_responses/client.py +0 -0
  37. {agenthub_python-0.4.12 → agenthub_python-0.4.13}/agenthub/registry.py +0 -0
  38. {agenthub_python-0.4.12 → agenthub_python-0.4.13}/agenthub/types.py +0 -0
  39. {agenthub_python-0.4.12 → agenthub_python-0.4.13}/agenthub/utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: agenthub-python
3
- Version: 0.4.12
3
+ Version: 0.4.13
4
4
  Summary: AgentHub is the LLM API Hub for the Agent era, built for high-precision autonomous agents.
5
5
  Keywords: agent,llm,gemini,claude,gpt
6
6
  Author: PrismShadow
@@ -143,6 +143,14 @@ class OpenaiChatClient(LLMClient):
143
143
  List of OpenAI Chat Completions message dictionaries
144
144
  """
145
145
  openai_messages = []
146
+ # The reasoning field this upstream has produced so far, if any. A turn the model
147
+ # answered without thinking still has to carry that field, empty, when it made tool
148
+ # calls: DeepSeek stops thinking part-way through a long tool chain, and then rejects
149
+ # the replay of that turn with "the reasoning_content in the thinking mode must be
150
+ # passed back to the API". It waives that only for tool_call ids it issued itself,
151
+ # which a relay that reissues ids takes away. A conversation that never produced a
152
+ # reasoning field never receives one.
153
+ replay_fields: set[str | None] = set()
146
154
 
147
155
  for msg in messages:
148
156
  content_parts = [] # may be empty for tool results
@@ -158,6 +166,8 @@ class OpenaiChatClient(LLMClient):
158
166
  elif item["type"] == "thinking":
159
167
  thinking += item["thinking"]
160
168
  thinking_fields.add((item.get("fidelity") or {}).get("reasoning_field"))
169
+ if item["thinking"]:
170
+ replay_fields.add((item.get("fidelity") or {}).get("reasoning_field"))
161
171
  elif item["type"] == "tool_call":
162
172
  tool_calls.append(
163
173
  {
@@ -201,12 +211,15 @@ class OpenaiChatClient(LLMClient):
201
211
  if tool_calls:
202
212
  message["tool_calls"] = tool_calls
203
213
 
204
- if thinking:
214
+ # This turn's own fidelity when it thought; otherwise the field the upstream has
215
+ # produced, with `thinking` still "" — the empty value keeps the turn replayable.
216
+ fields = thinking_fields if thinking else replay_fields
217
+ if thinking or (tool_calls and replay_fields):
205
218
  # send thinking back through the exact field the upstream produced (recorded
206
219
  # in the item fidelity); servers may reject the spelling they did not emit
207
- if thinking_fields == {"reasoning_content"}:
220
+ if fields == {"reasoning_content"}:
208
221
  message["reasoning_content"] = thinking
209
- elif thinking_fields == {"reasoning"}:
222
+ elif fields == {"reasoning"}:
210
223
  message["reasoning"] = thinking
211
224
  else:
212
225
  message["reasoning_content"] = thinking # vLLM & siliconflow compatibility
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "agenthub-python"
3
- version = "0.4.12"
3
+ version = "0.4.13"
4
4
  description = "AgentHub is the LLM API Hub for the Agent era, built for high-precision autonomous agents."
5
5
  keywords = [
6
6
  "agent",
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "agenthub-python"
3
- version = "0.4.12"
3
+ version = "0.4.13"
4
4
  description = "AgentHub is the LLM API Hub for the Agent era, built for high-precision autonomous agents."
5
5
  keywords = ["agent", "llm", "gemini", "claude", "gpt"]
6
6
  readme = "README.md"