Use strict OpenRouter schema for analysis
All checks were successful
Build and deploy Worker / build (push) Successful in 2m44s
All checks were successful
Build and deploy Worker / build (push) Successful in 2m44s
This commit is contained in:
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user