{
"response_format": {
"type": "json_schema",
"json_schema": {
"name": "financial_analysis",
"strict": true,
"schema": {
"type": "object",
"properties": {
"company": {
"type": "object",
"properties": {
"name": {"type": "string"},
"ticker": {"type": "string"},
"sector": {"type": "string", "enum": ["tech", "finance", "healthcare", "energy", "retail"]}
},
"required": ["name", "ticker", "sector"],
"additionalProperties": false
},
"metrics": {
"type": "object",
"properties": {
"revenue": {"type": "number", "minimum": 0},
"profit_margin": {"type": "number", "minimum": -1, "maximum": 1},
"debt_to_equity": {"type": "number", "minimum": 0}
},
"required": ["revenue"],
"additionalProperties": false
},
"analysis": {
"type": "array",
"items": {
"type": "object",
"properties": {
"category": {"type": "string", "enum": ["growth", "profitability", "valuation", "risk"]},
"score": {"type": "number", "minimum": 1, "maximum": 10},
"reasoning": {"type": "string"},
"confidence": {"type": "number", "minimum": 0, "maximum": 1}
},
"required": ["category", "score", "reasoning"],
"additionalProperties": false
}
},
"recommendation": {
"type": "string",
"enum": ["strong_buy", "buy", "hold", "sell", "strong_sell"]
},
"target_price": {"type": "number", "minimum": 0}
},
"required": ["company", "metrics", "analysis", "recommendation"],
"additionalProperties": false
}
}
}
}