Skip to content

Structured output from the LLM Agent... #557

Open
@rajib76

Description

@rajib76

I want to create a structured output from the agent. Basically I would like to give it a pydantic schema and expect the output to be mapped to that schema. How do I do that with ADK. For example in the below example, I want each of the discussion items as a str in a List.

meeting_notes_agent = LlmAgent(
    name="NotesCreator",
    description="Creates notes from an meeting transcript",
    instruction="""
    You are an expert notes extractor. You will extract meeting notes from a given meeting transcript. 
    Here is the transcript for you.
    {meeting_transcript}
    """,
    output_key="notes_output"

)

I will create a pydantic object as below

class Note:
   note_item: str = Field(description="a specific discussion point in the transcript")

class Notes
   note_items: list[Note]

Metadata

Metadata

Assignees

Labels

questionFurther information is requested

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions