mirror of
https://github.com/tiennm99/DocsGPT.git
synced 2026-10-14 20:16:48 +00:00
Skip trace work when disabled; share the agent span builder
With TRACES_ENABLED off, LLM calls record no GenAI metrics, and a streamed answer is joined into a preview only when a span keeps it. Agent runs and continuations build their invoke_agent span in one place, which now reads the model from model_id. The trace panel shows a stream's model time next to how long it was open. Adds missing type hints.
This commit is contained in:
1 parent
699906a015
commit
0bbbac0eb2
18 files changed
+88
-35
No files matched your search
@@ -30,7 +30,7 @@ from docsgpt.storage.db.session import db_readonly, db_session
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def record_tool_span_start(call: Any, **attributes: Any):
|
||||
def record_tool_span_start(call: Any, **attributes: Any) -> Any:
|
||||
"""Open an ``execute_tool`` span for ``call`` (no-op without an active trace)."""
|
||||
llm_name = getattr(call, "name", None) or "unknown"
|
||||
base = {
|
||||
|
||||
Reference in new issue
Block a user