You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This probably needs to be an object with the settings possible, like type, properties and required. Properties as its own object - with something dynamic because names like emotion and language are specific for this case.
When I create my own full JSON payload like below, where parameters is a normal object with no " around the parameters content, it works.
{
"tools": [
{
"type": "function",
"function": {
"description": "Classify the relevant information from the phrase.",
"name": "getinformation",
"parameters": {
"type": "object",
"properties": {
"emotion": {
"type": "string",
"description": "The emotion of the phrase."
},
"language": {
"type": "string",
"description": "The language of the phrase."
}
},
"required": [
"emotion",
"language"
]
}
}
}
]
}
Errormessage example:
{
"error": {
"message": ""{'type': 'object', 'properties': {'language': {'type': 'string','description': 'The language of the phrase.' }}}" is not of type 'object' - 'tools.0.function.parameters'",
"type": "invalid_request_error",
"param": null,
"code": null
}
}
The text was updated successfully, but these errors were encountered:
In your framework you have added "parameters" in the ChatToolFunction as a string. I cannot get it to work with just adding JSON in this string.
It is defined as as "object" in the documentation:
https://platform.openai.com/docs/api-reference/chat/create#chat-create-tools
This probably needs to be an object with the settings possible, like type, properties and required. Properties as its own object - with something dynamic because names like emotion and language are specific for this case.
When I create my own full JSON payload like below, where parameters is a normal object with no " around the parameters content, it works.
{
"tools": [
{
"type": "function",
"function": {
"description": "Classify the relevant information from the phrase.",
"name": "getinformation",
"parameters": {
"type": "object",
"properties": {
"emotion": {
"type": "string",
"description": "The emotion of the phrase."
},
"language": {
"type": "string",
"description": "The language of the phrase."
}
},
"required": [
"emotion",
"language"
]
}
}
}
]
}
Errormessage example:
{
"error": {
"message": ""{'type': 'object', 'properties': {'language': {'type': 'string','description': 'The language of the phrase.' }}}" is not of type 'object' - 'tools.0.function.parameters'",
"type": "invalid_request_error",
"param": null,
"code": null
}
}
The text was updated successfully, but these errors were encountered: