Code
cookbook/models/meta/structured_output.py
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
You are viewing v1 docs. For the latest documentation, visit docs.agno.com
from typing import List
from pydantic import BaseModel, Field
from agno.agent import Agent
from agno.models.meta import Llama
class MovieScript(BaseModel):
name: str = Field(..., description="Name of the movie.")
setting: str = Field(..., description="Provide a setting for the movie.")
ending: str = Field(..., description="Describe the movie ending.")
genre: str = Field(..., description="Genre of the movie.")
characters: List[str] = Field(..., description="List of characters.")
storyline: str = Field(..., description="A 3-sentence storyline.")
agent = Agent(
model=Llama(id="Llama-3.3-70B"),
response_model=MovieScript,
markdown=True,
)
agent.print_response("Generate a movie script outline for a sci-fi adventure.")
Create a virtual environment
Terminal and create a python virtual environment.python3 -m venv .venv
source .venv/bin/activate
Was this page helpful?