Closed abhatia-07 closed 8 months ago
The token count for Tools is still having a difference of 1. Request Body:
{ "model": "gpt-4", "messages": [ { "role": "assistant", "content": null, "tool_calls": [ { "id": "call_Id8ycVMsW8gdsf7kSXfgAcf1", "type": "function", "function": { "name": "get_current_weather", "arguments": "{\n \"location\": \"Boston, MA\"\n}" } } ] }, { "role": "tool", "tool_call_id": "call_Id8ycVMsW8gdsf7kSXfgAcf1", "name": "get_current_weather", "content": "29 degree celcius" } ] }
My count: 34 OpenAI Count: 35
My guess is that even "tool" role requires 3 tokens.
Thanks
I just saw you've reopened #4 , closing this one as duplicate.
The token count for Tools is still having a difference of 1. Request Body:
My count: 34 OpenAI Count: 35
My guess is that even "tool" role requires 3 tokens.
Thanks