|
12 | 12 | # See the License for the specific language governing permissions and |
13 | 13 | # limitations under the License. |
14 | 14 |
|
15 | | -from .base_agent import BaseAgent |
16 | | -from .context import Context |
17 | | -from .invocation_context import InvocationContext |
18 | | -from .live_request_queue import LiveRequest |
19 | | -from .live_request_queue import LiveRequestQueue |
20 | | -from .llm_agent import Agent |
21 | | -from .llm_agent import LlmAgent |
22 | | -from .loop_agent import LoopAgent |
23 | | -from .mcp_instruction_provider import McpInstructionProvider |
24 | | -from .parallel_agent import ParallelAgent |
25 | | -from .run_config import RunConfig |
26 | | -from .sequential_agent import SequentialAgent |
| 15 | +from __future__ import annotations |
| 16 | +from typing import TYPE_CHECKING |
| 17 | + |
| 18 | +if TYPE_CHECKING: |
| 19 | + from .base_agent import BaseAgent |
| 20 | + from .context import Context |
| 21 | + from .invocation_context import InvocationContext |
| 22 | + from .live_request_queue import LiveRequest |
| 23 | + from .live_request_queue import LiveRequestQueue |
| 24 | + from .llm_agent import Agent |
| 25 | + from .llm_agent import LlmAgent |
| 26 | + from .loop_agent import LoopAgent |
| 27 | + from .mcp_instruction_provider import McpInstructionProvider |
| 28 | + from .parallel_agent import ParallelAgent |
| 29 | + from .run_config import RunConfig |
| 30 | + from .sequential_agent import SequentialAgent |
| 31 | + |
| 32 | +def __getattr__(name: str): |
| 33 | + if name == 'BaseAgent': |
| 34 | + from .base_agent import BaseAgent |
| 35 | + return BaseAgent |
| 36 | + if name == 'Context': |
| 37 | + from .context import Context |
| 38 | + return Context |
| 39 | + if name == 'InvocationContext': |
| 40 | + from .invocation_context import InvocationContext |
| 41 | + return InvocationContext |
| 42 | + if name == 'LiveRequest': |
| 43 | + from .live_request_queue import LiveRequest |
| 44 | + return LiveRequest |
| 45 | + if name == 'LiveRequestQueue': |
| 46 | + from .live_request_queue import LiveRequestQueue |
| 47 | + return LiveRequestQueue |
| 48 | + if name == 'Agent': |
| 49 | + from .llm_agent import Agent |
| 50 | + return Agent |
| 51 | + if name == 'LlmAgent': |
| 52 | + from .llm_agent import LlmAgent |
| 53 | + return LlmAgent |
| 54 | + if name == 'LoopAgent': |
| 55 | + from .loop_agent import LoopAgent |
| 56 | + return LoopAgent |
| 57 | + if name == 'McpInstructionProvider': |
| 58 | + from .mcp_instruction_provider import McpInstructionProvider |
| 59 | + return McpInstructionProvider |
| 60 | + if name == 'ParallelAgent': |
| 61 | + from .parallel_agent import ParallelAgent |
| 62 | + return ParallelAgent |
| 63 | + if name == 'RunConfig': |
| 64 | + from .run_config import RunConfig |
| 65 | + return RunConfig |
| 66 | + if name == 'SequentialAgent': |
| 67 | + from .sequential_agent import SequentialAgent |
| 68 | + return SequentialAgent |
| 69 | + raise AttributeError(f"module {__name__} has no attribute {name}") |
27 | 70 |
|
28 | 71 | __all__ = [ |
29 | 72 | 'Agent', |
|
0 commit comments