INNER CODE UNIT · Python
LoadedAgentFile
omnirexflora-labs/omnicoreagent · src/omnicoreagent/serve/cli.py:30
class LoadedAgentFile:
"""What an agent file defines: the agent, and optionally its own routes
(``router`` or ``routers``) and the paths they serve without a token
(``public_paths``)."""
agent: Any
routers: list[Any] = field(default_factory=list)
public_paths: list[str] = field(default_factory=list)
def load_agent_file(path: str) -> LoadedAgentFile:
module = _load_module(path)
if hasattr(module, "agent"):
agent = module.agent
elif hasattr(module, "create_agent"):
agent = module.create_agent()
else:
raise click.ClickException(