Fixed openai api endpoint
Publish Metadata Agent Image (dev) / build-and-push-image (push) Successful in 4m0s
Publish Web Player Image (dev) / build-and-push-image (push) Successful in 4m23s

This commit is contained in:
2026-04-07 19:52:03 +01:00
parent 70a947a8c1
commit 2d7ac3d8ce
2 changed files with 32 additions and 2 deletions
Generated
-1
View File
@@ -1191,7 +1191,6 @@ dependencies = [
"tokio",
"tokio-util",
"tower 0.4.13",
"tower-http",
"tracing",
"tracing-subscriber",
"urlencoding",
+32 -1
View File
@@ -131,6 +131,14 @@ struct ChatMessage {
struct ChatResponseFormat {
#[serde(rename = "type")]
kind: String,
json_schema: JsonSchemaWrapper,
}
#[derive(Serialize)]
struct JsonSchemaWrapper {
name: String,
strict: bool,
schema: serde_json::Value,
}
#[derive(Deserialize)]
@@ -171,7 +179,30 @@ pub async fn call_ollama(
content: user_message.to_owned(),
},
],
response_format: ChatResponseFormat { kind: "json_object".to_owned() },
response_format: ChatResponseFormat {
kind: "json_schema".to_owned(),
json_schema: JsonSchemaWrapper {
name: "normalized_metadata".to_owned(),
strict: true,
schema: serde_json::json!({
"type": "object",
"properties": {
"artist": { "type": ["string", "null"] },
"album": { "type": ["string", "null"] },
"title": { "type": ["string", "null"] },
"year": { "type": ["integer", "null"] },
"track_number": { "type": ["integer", "null"] },
"genre": { "type": ["string", "null"] },
"featured_artists": { "type": "array", "items": { "type": "string" } },
"release_type": { "type": ["string", "null"] },
"confidence": { "type": ["number", "null"] },
"notes": { "type": ["string", "null"] }
},
"required": ["artist", "album", "title", "year", "track_number", "genre", "featured_artists", "release_type", "confidence", "notes"],
"additionalProperties": false
}),
},
},
stream: false,
temperature: 0.1,
};