from typing import List, Literal
from agno.agent import Agent
from agno.models.openai import OpenAIResponses
from pydantic import BaseModel, Field
class Decision(BaseModel):
call: Literal["BUY", "HOLD", "PASS"] = Field(..., description="The committee decision")
conviction: Literal["low", "medium", "high"] = Field(..., description="Confidence in the call")
allocation_usd: float = Field(..., description="Dollar allocation, 0 if not BUY")
rationale: str = Field(..., description="Why, referencing the analyst inputs")
citations: List[str] = Field(default_factory=list, description="Sources and prior memos used")
chair = Agent(
name="Committee Chair",
model=OpenAIResponses(id="gpt-5.5"),
output_schema=Decision,
instructions=(
"Synthesize the analyst inputs into a decision. Every BUY needs a "
"dollar amount. Every decision must reference at least one risk."
),
)
def briefing(*analyst_outputs: str) -> str:
return "Analyst inputs:\n\n" + "\n\n".join(analyst_outputs)
result = chair.run(briefing(market, fundamentals, technicals, risk)).content
# Decision(call='BUY', conviction='high', allocation_usd=2_000_000.0,
# rationale='Momentum and fundamentals align; sized within the
# sector cap the Risk Officer set.',
# citations=['memo:NVDA-2024Q3', 'research:semiconductors'])