tina-python 0.6.7__tar.gz → 0.6.8__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.
- {tina_python-0.6.7/tina_python.egg-info → tina_python-0.6.8}/PKG-INFO +1 -1
- {tina_python-0.6.7 → tina_python-0.6.8}/pyproject.toml +1 -1
- {tina_python-0.6.7 → tina_python-0.6.8}/setup.py +1 -1
- {tina_python-0.6.7 → tina_python-0.6.8}/tina/__init__.py +1 -1
- {tina_python-0.6.7 → tina_python-0.6.8}/tina/utils/tui/context_manager.py +18 -3
- {tina_python-0.6.7 → tina_python-0.6.8}/tina/utils/tui/tui.py +1545 -1428
- {tina_python-0.6.7 → tina_python-0.6.8/tina_python.egg-info}/PKG-INFO +1 -1
- {tina_python-0.6.7 → tina_python-0.6.8}/LICENSE +0 -0
- {tina_python-0.6.7 → tina_python-0.6.8}/MANIFEST.in +0 -0
- {tina_python-0.6.7 → tina_python-0.6.8}/README.md +0 -0
- {tina_python-0.6.7 → tina_python-0.6.8}/setup.cfg +0 -0
- {tina_python-0.6.7 → tina_python-0.6.8}/tina/agent/__init__.py +0 -0
- {tina_python-0.6.7 → tina_python-0.6.8}/tina/agent/agent.py +0 -0
- {tina_python-0.6.7 → tina_python-0.6.8}/tina/agent/core/__init__.py +0 -0
- {tina_python-0.6.7 → tina_python-0.6.8}/tina/agent/core/agent_response.py +0 -0
- {tina_python-0.6.7 → tina_python-0.6.8}/tina/agent/core/agent_runtime.py +0 -0
- {tina_python-0.6.7 → tina_python-0.6.8}/tina/agent/core/context_manager.py +0 -0
- {tina_python-0.6.7 → tina_python-0.6.8}/tina/agent/core/events.py +0 -0
- {tina_python-0.6.7 → tina_python-0.6.8}/tina/agent/core/executor.py +0 -0
- {tina_python-0.6.7 → tina_python-0.6.8}/tina/agent/core/keyword_actions.py +0 -0
- {tina_python-0.6.7 → tina_python-0.6.8}/tina/agent/core/prompt.py +0 -0
- {tina_python-0.6.7 → tina_python-0.6.8}/tina/agent/core/state.py +0 -0
- {tina_python-0.6.7 → tina_python-0.6.8}/tina/agent/core/tools.py +0 -0
- {tina_python-0.6.7 → tina_python-0.6.8}/tina/agent/multimodal_agent.py +0 -0
- {tina_python-0.6.7 → tina_python-0.6.8}/tina/core/__init__.py +0 -0
- {tina_python-0.6.7 → tina_python-0.6.8}/tina/core/error.py +0 -0
- {tina_python-0.6.7 → tina_python-0.6.8}/tina/core/logger.py +0 -0
- {tina_python-0.6.7 → tina_python-0.6.8}/tina/llm/BaseNewAPI.py +0 -0
- {tina_python-0.6.7 → tina_python-0.6.8}/tina/llm/__init__.py +0 -0
- {tina_python-0.6.7 → tina_python-0.6.8}/tina/llm/base_api.py +0 -0
- {tina_python-0.6.7 → tina_python-0.6.8}/tina/llm/base_multimodal_api.py +0 -0
- {tina_python-0.6.7 → tina_python-0.6.8}/tina/llm/ollama_api.py +0 -0
- {tina_python-0.6.7 → tina_python-0.6.8}/tina/mcp/__init__.py +0 -0
- {tina_python-0.6.7 → tina_python-0.6.8}/tina/mcp/client.py +0 -0
- {tina_python-0.6.7 → tina_python-0.6.8}/tina/mcp/mcp_tools_executor.py +0 -0
- {tina_python-0.6.7 → tina_python-0.6.8}/tina/py.typed +0 -0
- {tina_python-0.6.7 → tina_python-0.6.8}/tina/utils/__init__.py +0 -0
- {tina_python-0.6.7 → tina_python-0.6.8}/tina/utils/agent_worker.py +0 -0
- {tina_python-0.6.7 → tina_python-0.6.8}/tina/utils/deepseek.py +0 -0
- {tina_python-0.6.7 → tina_python-0.6.8}/tina/utils/doc_parser.py +0 -0
- {tina_python-0.6.7 → tina_python-0.6.8}/tina/utils/env_reader.py +0 -0
- {tina_python-0.6.7 → tina_python-0.6.8}/tina/utils/multimodal_formatter.py +0 -0
- {tina_python-0.6.7 → tina_python-0.6.8}/tina/utils/output_parser.py +0 -0
- {tina_python-0.6.7 → tina_python-0.6.8}/tina/utils/run_agent_in_cli.py +0 -0
- {tina_python-0.6.7 → tina_python-0.6.8}/tina/utils/system_tools.py +0 -0
- {tina_python-0.6.7 → tina_python-0.6.8}/tina/utils/timer.py +0 -0
- {tina_python-0.6.7 → tina_python-0.6.8}/tina/utils/tui/__init__.py +0 -0
- {tina_python-0.6.7 → tina_python-0.6.8}/tina/utils/tui/token.py +0 -0
- {tina_python-0.6.7 → tina_python-0.6.8}/tina/utils/type_mapper.py +0 -0
- {tina_python-0.6.7 → tina_python-0.6.8}/tina_python.egg-info/SOURCES.txt +0 -0
- {tina_python-0.6.7 → tina_python-0.6.8}/tina_python.egg-info/dependency_links.txt +0 -0
- {tina_python-0.6.7 → tina_python-0.6.8}/tina_python.egg-info/requires.txt +0 -0
- {tina_python-0.6.7 → tina_python-0.6.8}/tina_python.egg-info/top_level.txt +0 -0
|
@@ -378,8 +378,9 @@ class TuiMessageStore:
|
|
|
378
378
|
index = chunk.get("tool_index")
|
|
379
379
|
|
|
380
380
|
if index is not None:
|
|
381
|
-
# 并发调用:按 index
|
|
382
|
-
|
|
381
|
+
# 并发调用:按 index 定位,绝不按名字串到别的调用上。
|
|
382
|
+
# 已完成的旧卡片不复用(每次 LLM 响应的 index 都从 0 重新开始)
|
|
383
|
+
block = self._routed_tool_by_index(index)
|
|
383
384
|
if block is None:
|
|
384
385
|
block = self._start_tool(name or "unknown", index=index)
|
|
385
386
|
else:
|
|
@@ -403,7 +404,7 @@ class TuiMessageStore:
|
|
|
403
404
|
index = call.get("index")
|
|
404
405
|
call_id = call.get("id")
|
|
405
406
|
|
|
406
|
-
block = self.
|
|
407
|
+
block = self._routed_tool_by_index(index)
|
|
407
408
|
if block is None and call_id:
|
|
408
409
|
block = self._tool_by_id.get(call_id)
|
|
409
410
|
if block is None and name:
|
|
@@ -449,6 +450,20 @@ class TuiMessageStore:
|
|
|
449
450
|
self._notify("update", block)
|
|
450
451
|
return block
|
|
451
452
|
|
|
453
|
+
@staticmethod
|
|
454
|
+
def _is_active_tool(block: TuiBlock | None) -> bool:
|
|
455
|
+
"""工具卡片是否仍在进行中(可用于承接后续流式片段)"""
|
|
456
|
+
return block is not None and block["status"] in ("building", "calling")
|
|
457
|
+
|
|
458
|
+
def _routed_tool_by_index(self, index: int | None) -> TuiBlock | None:
|
|
459
|
+
"""按 index 取当前轮次的工具卡片;已完成的不复用,避免跨轮次串卡"""
|
|
460
|
+
if index is None:
|
|
461
|
+
return None
|
|
462
|
+
block = self._tool_by_index.get(index)
|
|
463
|
+
if not self._is_active_tool(block):
|
|
464
|
+
return None
|
|
465
|
+
return block
|
|
466
|
+
|
|
452
467
|
def _start_tool(
|
|
453
468
|
self, name: str, index: int | None = None, tool_id: str | None = None
|
|
454
469
|
) -> TuiBlock:
|