Documentation Index
Fetch the complete documentation index at: https://docs-v1.agno.com/llms.txt
Use this file to discover all available pages before exploring further.
Code
cookbook/apps/fastapi/basic.py
You are viewing v1 docs. For the latest documentation, visit docs.agno.com
Expose your Agno Agent as a FastAPI app
Documentation Index
Fetch the complete documentation index at: https://docs-v1.agno.com/llms.txt
Use this file to discover all available pages before exploring further.
from agno.agent import Agent
from agno.app.fastapi.app import FastAPIApp
from agno.models.openai import OpenAIChat
basic_agent = Agent(
name="Basic Agent",
model=OpenAIChat(id="gpt-4o"),
add_history_to_messages=True,
num_history_responses=3,
add_datetime_to_instructions=True,
markdown=True,
)
fastapi_app = FastAPIApp(
agents=[basic_agent],
name="Basic Agent",
app_id="basic_agent",
description="A basic agent that can answer questions and help with tasks.",
)
app = fastapi_app.get_app()
if __name__ == "__main__":
fastapi_app.serve(app="basic:app", port=8001, reload=True)
Was this page helpful?