I noticed that it will take one more pormpt_token when ‘function_call’ on ‘none’ than on ‘auto’
so if i set ‘funtion_call’ on ‘auto’
completion = client.chat.completions.create(
model="gpt-3.5-turbo-0125",
messages=[{"role": "system", "content": ''},
{"role": "user", "content": 'whats the weather in hanover'},
],
functions=functions,
**function_call='auto'**
)
gpt will execute the function call correctly. with 81 prompt_tokens.
"choices": [
{
"finish_reason": "function_call",
"index": 0,
"logprobs": null,
"message": {
"content": null,
"function_call": {
"arguments": "{\"location\":\"Hanover\"}",
"name": "get_current_weather"
},
"role": "assistant"
}
}
],
"usage": {
"completion_tokens": 16,
"prompt_tokens": **81**,
"total_tokens": 97
}
and then i set it to ‘none’, model will only chat with me. and you can see it takes one more prompt_tokens than ‘auto’.
"choices": [
{
"finish_reason": "stop",
"index": 0,
"logprobs": null,
"message": {
"content": "Sure, let me check the current weather in Hanover for you.",
"role": "assistant"
}
}
],
"usage": {
"completion_tokens": 14,
"prompt_tokens": **82**,
"total_tokens": 96
}
so, What is this one token under the API hood?