PHP 8.2.30
Preview: handoff.py Size: 525 B
/opt/hc_python/lib/python3.12/site-packages/sentry_sdk/integrations/openai_agents/spans/handoff.py

import sentry_sdk
from sentry_sdk.consts import OP, SPANDATA

from ..consts import SPAN_ORIGIN

from typing import TYPE_CHECKING

if TYPE_CHECKING:
    import agents


def handoff_span(context, from_agent, to_agent_name):
    # type: (agents.RunContextWrapper, agents.Agent, str) -> None
    with sentry_sdk.start_span(
        op=OP.GEN_AI_HANDOFF,
        name=f"handoff from {from_agent.name} to {to_agent_name}",
        origin=SPAN_ORIGIN,
    ) as span:
        span.set_data(SPANDATA.GEN_AI_OPERATION_NAME, "handoff")

Directory Contents

Dirs: 1 × Files: 6

Name Size Perms Modified Actions
- drwxr-xr-x 2025-12-03 08:02:53
Edit Download
469 B lrw-r--r-- 2025-12-03 08:02:53
Edit Download
1.26 KB lrw-r--r-- 2025-12-03 08:02:53
Edit Download
1.38 KB lrw-r--r-- 2025-12-03 08:02:53
Edit Download
525 B lrw-r--r-- 2025-12-03 08:02:53
Edit Download
2.43 KB lrw-r--r-- 2025-12-03 08:02:53
Edit Download
353 B lrw-r--r-- 2025-12-03 08:02:53
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).