원클릭으로
structured-output
Force orxhestra agents to return typed Pydantic objects instead of free-form text using output_schema.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Force orxhestra agents to return typed Pydantic objects instead of free-form text using output_schema.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Build orxhestra agent trees from declarative YAML orx files. Covers full schema, models, tools, agents, runner, and server.
Expose orxhestra agents as A2A protocol endpoints or connect to remote A2A agents.
Add callbacks to orxhestra agents for logging, monitoring, and error handling. Covers model and tool callbacks.
Add planners to orxhestra agents for structured reasoning. Covers BasePlanner, PlanReActPlanner, and TaskPlanner.
Add dynamic skills to orxhestra agents. Covers Skill, InMemorySkillStore, and skill discovery/loading tools.
Stream events from orxhestra agents including token-by-token output, sub-agent events via AgentTool, and Runner streaming.
| name | structured-output |
| description | Force orxhestra agents to return typed Pydantic objects instead of free-form text using output_schema. |
Pass output_schema to LlmAgent to get a typed Pydantic object back.
from pydantic import BaseModel, Field
from orxhestra import LlmAgent
from orxhestra.events.event import Event, EventType
class CompanyAnalysis(BaseModel):
name: str = Field(description="Company name")
industry: str = Field(description="Primary industry")
strengths: list[str] = Field(description="Key strengths")
risks: list[str] = Field(description="Key risks")
recommendation: str = Field(description="Buy, Hold, or Sell")
confidence: float = Field(description="Confidence score 0-1")
agent = LlmAgent(
name="AnalystAgent",
model=model,
tools=[get_financials, get_news_sentiment],
output_schema=CompanyAnalysis,
instructions="You are a financial analyst.",
)
async for event in agent.astream("Analyze Apple", ctx=ctx):
if event.is_final_response():
analysis = event.data # CompanyAnalysis instance
print(f"{analysis.name}: {analysis.recommendation} ({analysis.confidence:.0%})")
PydanticOutputParser.get_format_instructions() is appended to the system prompt.PydanticOutputParser.parse() extracts and validates JSON from the response.with_structured_output() is used as a fallback.