Wraps a BaseAgent or BaseNode in an App if not already one.
(agent_or_app: Union[BaseAgent, App, Any], app_name: str)
| 58 | |
| 59 | |
| 60 | def _to_app(agent_or_app: Union[BaseAgent, App, Any], app_name: str) -> App: |
| 61 | """Wraps a BaseAgent or BaseNode in an App if not already one.""" |
| 62 | if isinstance(agent_or_app, App): |
| 63 | return agent_or_app |
| 64 | return App(name=app_name, root_agent=agent_or_app) |
| 65 | |
| 66 | |
| 67 | async def run_input_file( |
no test coverage detected