Skip to content

Commit

Permalink
update cookbook
Browse files Browse the repository at this point in the history
  • Loading branch information
dirkbrnd committed Feb 12, 2025
1 parent 989f275 commit db1c109
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions cookbook/models/google/gemini/structured_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,20 @@ class MovieScript(BaseModel):
)


movie_agent = Agent(
structured_output_agent = Agent(
model=Gemini(id="gemini-2.0-flash-exp"),
description="You help people write movie scripts.",
structured_outputs=True,
response_model=MovieScript,
)

# Get the response in a variable
# run: RunResponse = movie_agent.run("New York")
# pprint(run.content)
structured_output_agent.print_response("New York")

movie_agent.print_response("New York")

# json_agent = Agent(
# model=Gemini(id="gemini-2.0-flash-exp"),
# description="You help people write movie scripts.",
# response_model=MovieScript,
# )
#
# json_agent.print_response("New York")

0 comments on commit db1c109

Please sign in to comment.