forked from openai/openai-agents-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path__init__.py
More file actions
25 lines (17 loc) · 858 Bytes
/
__init__.py
File metadata and controls
25 lines (17 loc) · 858 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
from __future__ import annotations
from typing import TYPE_CHECKING, Any
from .tool_output_trimmer import ToolOutputTrimmer
if TYPE_CHECKING:
from .agentspan import AgentspanRunResult, AgentspanRunner
__all__ = ["ToolOutputTrimmer", "AgentspanRunner", "AgentspanRunResult"]
def __getattr__(name: str) -> Any:
if name in ("AgentspanRunner", "AgentspanRunResult"):
try:
from .agentspan import AgentspanRunResult, AgentspanRunner # noqa: F401
return AgentspanRunner if name == "AgentspanRunner" else AgentspanRunResult
except ImportError as e:
raise ImportError(
f"{name} requires the 'agentspan' package. "
"Install it with: pip install openai-agents[agentspan]"
) from e
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")