Hi, I was developing a chatbot, I have a module with ai and other where I add openai tools, I try to add the history, but I get an error about role.
I add this 2 messages in a history about tool calls to pass them in openai.
ā Example of the history:
[
{
"role": "assistant",
"content": "Hello! š I'm here to help you find the perfect car to meet your needs. Let's get started with a few questions! \n\nFirst, how many cars are you looking to buy? š¤"
},
{
"role": "user",
"content": "5"
},
{
"role": "assistant",
"tool_calls": [
{
"id": "call_o4MJVo9DLWzF6FvXehtnOUoA",
"type": "function",
"function": {
"name": "RegistrarCantidadAutos",
"arguments": "{"cantidad":"5"}"
}
}
],
"content": ""
},
{
"role": "tool",
"content": "5 autos",
"name": "RegistrarCantidadAutos",
"tool_call_id": "call_o4MJVo9DLWzF6FvXehtnOUoA"
}
]