-
Notifications
You must be signed in to change notification settings - Fork 65
Open
Description
To Reproduce:
A request with the schema property fails with a 400
One without succeeds.
Same API Key same code just removed the schema property on the request
let builder = LLMBuilder::new()
.backend(self.model.provider())
.api_key(&self.api_key)
.model(self.model.to_string())
.max_tokens(self.max_tokens)
.temperature(self.temperature)
.stream(false)
.system("DO thing")
.schema(output_schema);fails with 400
let builder = LLMBuilder::new()
.backend(self.model.provider())
.api_key(&self.api_key)
.model(self.model.to_string())
.max_tokens(self.max_tokens)
.temperature(self.temperature)
.stream(false)
.system("DO thing");That does the thing.
This is using gemini-2.0-flash with which I have verified works with curl.
curl "https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash:generateContent?key=$GOOGLE_KEY" -H 'Content-Type: application/json' -d '{
"contents": [{
"parts":[
{ "text": "List a few popular cookie recipes, and include the amounts of ingredients." }
]
}],
"generationConfig": {
"responseMimeType": "application/json",
"responseSchema": {
"type": "ARRAY",
"items": {
"type": "OBJECT",
"properties": {
"recipeName": { "type": "STRING" },
"ingredients": {
"type": "ARRAY",
"items": { "type": "STRING" }
}
},
"propertyOrdering": ["recipeName", "ingredients"]
}
}
}
}' 2> /dev/null | headIt works for Anthropic and Deepseek v3-coder
Not tried with Open AI
Metadata
Metadata
Assignees
Labels
No labels