Closed Dexterity104 closed 3 weeks ago
@Dexterity104 have you updated to the latest python SDK version? The following snippet works fine for me:
chat = co.chat(
message="give me taylor swift details at the time she sung the song '22'",
response_format={
"type": "json_object",
"schema": {
"type": "object",
"properties": {
"name": { "type": "string" },
"age": { "type": "integer" }
},
"required": ["name", "age"]
}
}
)
print(chat)
# {\n "name": "Taylor Swift",\n "age": 22\n}
Hi @Dexterity104, did upgrading your version fix it as Billy mentioned?
@Dexterity104 we're going to close the Issue as we cannot reproduce on the latest version of the SDK. please let us know if you're still encountering issues on the latest version and we can reopen.
I want to get a JSON object from Cohere LLM and that's why I'm gonna use response_format. But the error occurs.![3](https://github.com/user-attachments/assets/53bca6ca-2b2e-425d-be73-ec2f925dae22)
How can I fix this?