from agenticai_core.designtime.models import App, Agent, OrchestratorType
from agenticai_core.designtime.models.llm_model import LlmModel, LlmModelConfig
from agenticai_core.designtime.models.prompt import Prompt
from agenticai_core.designtime.models.tool import Tool, ToolsRegistry
from agenticai_core.runtime.agents.abstract_orchestrator import AbstractOrchestrator
# 1. Register tools
@Tool.register(name="search", description="Search knowledge base")
def search(query: str):
return {"results": []}
# 2. Create agents
agent = Agent(
name="Assistant",
description="General purpose assistant",
role="WORKER",
sub_type="REACT",
type="AUTONOMOUS",
llm_model=LlmModel(
model="gpt-4o",
provider="Open AI",
connection_name="Default",
modelConfig=LlmModelConfig(temperature=0.7, max_tokens=1600)
),
prompt=Prompt(
system="You are a helpful assistant.",
custom="Help users with their questions."
)
)
# 3. Create app
app = App(
name="My App",
description="AI Assistant Application",
orchestrationType=OrchestratorType.CUSTOM_SUPERVISOR,
agents=[agent]
)
# 4. Create orchestrator
class MyOrchestrator(AbstractOrchestrator):
def __init__(self, agents):
super().__init__(name="MyOrchestrator", agents=agents)
# 5. Start
if __name__ == "__main__":
app.start(
orchestrator_cls=MyOrchestrator,
port=8080
)