REDROOM
PHP 8.2.30
Path:
Logout
Edit File
Size: 1.26 KB
Close
//opt/hc_python/lib/python3.12/site-packages/sentry_sdk/integrations/openai_agents/spans/ai_client.py
Text
Base64
import sentry_sdk from sentry_sdk.consts import OP, SPANDATA from ..consts import SPAN_ORIGIN from ..utils import ( _set_agent_data, _set_input_data, _set_output_data, _set_usage_data, _create_mcp_execute_tool_spans, ) from typing import TYPE_CHECKING if TYPE_CHECKING: from agents import Agent from typing import Any def ai_client_span(agent, get_response_kwargs): # type: (Agent, dict[str, Any]) -> sentry_sdk.tracing.Span # TODO-anton: implement other types of operations. Now "chat" is hardcoded. model_name = agent.model.model if hasattr(agent.model, "model") else agent.model span = sentry_sdk.start_span( op=OP.GEN_AI_CHAT, description=f"chat {model_name}", origin=SPAN_ORIGIN, ) # TODO-anton: remove hardcoded stuff and replace something that also works for embedding and so on span.set_data(SPANDATA.GEN_AI_OPERATION_NAME, "chat") _set_agent_data(span, agent) _set_input_data(span, get_response_kwargs) return span def update_ai_client_span(span, agent, get_response_kwargs, result): # type: (sentry_sdk.tracing.Span, Agent, dict[str, Any], Any) -> None _set_usage_data(span, result.usage) _set_output_data(span, result) _create_mcp_execute_tool_spans(span, result)
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 1 × Files: 6
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
__pycache__
DIR
-
drwxr-xr-x
2025-12-03 08:02:53
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
agent_workflow.py
469 B
lrw-r--r--
2025-12-03 08:02:53
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
ai_client.py
1.26 KB
lrw-r--r--
2025-12-03 08:02:53
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
execute_tool.py
1.38 KB
lrw-r--r--
2025-12-03 08:02:53
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
handoff.py
525 B
lrw-r--r--
2025-12-03 08:02:53
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
invoke_agent.py
2.43 KB
lrw-r--r--
2025-12-03 08:02:53
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
__init__.py
353 B
lrw-r--r--
2025-12-03 08:02:53
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).