Build structured system prompts from a PromptContext with the prompt catalog.
The prompt catalog builds structured system prompts from a PromptContext:
Copy
Ask AI
from langchain_adk import PromptContext, build_system_promptprompt = build_system_prompt(PromptContext( agent_name="WriterAgent", goal="Write polished articles from research notes.", instructions="Use markdown. Structure with headings. Be thorough.", skills=[ {"name": "AP Style", "content": "Follow AP style guide for all prose."} ], agents=[ {"name": "ResearchAgent", "description": "Retrieves research on any topic."} ], workflow_instructions=( "1. Call ResearchAgent to gather background information.\n" "2. Outline the article structure.\n" "3. Write the full article.\n" "4. Review and refine." ),))agent = LlmAgent(name="WriterAgent", llm=llm, instructions=prompt)
Sections are only included when non-empty — no boilerplate padding.