diff --git a/src/jobs/analyze-voice-experience.ts b/src/jobs/analyze-voice-experience.ts index b1a0bb8..4c51051 100644 --- a/src/jobs/analyze-voice-experience.ts +++ b/src/jobs/analyze-voice-experience.ts @@ -86,9 +86,40 @@ async function buildPlaceAnalysis(input: { }, body: JSON.stringify({ model: config.openRouterModel, + provider: { require_parameters: true }, temperature: 0.1, - max_tokens: 900, - response_format: { type: 'json_object' }, + max_tokens: 2000, + response_format: { + type: 'json_schema', + json_schema: { + name: 'place_analysis', + strict: true, + schema: { + type: 'object', + additionalProperties: false, + required: ['placeName', 'tags', 'signals', 'summary'], + properties: { + placeName: { type: 'string' }, + tags: { type: 'array', items: { type: 'string' } }, + signals: { + type: 'array', + items: { + type: 'object', + additionalProperties: false, + required: ['axis', 'leaf', 'evidence', 'confidence'], + properties: { + axis: { type: 'string' }, + leaf: { type: 'string' }, + evidence: { type: 'string' }, + confidence: { type: 'number', minimum: 0, maximum: 1 }, + }, + }, + }, + summary: { type: 'string' }, + }, + }, + }, + }, messages: [ { role: 'system',