Replies: 1 comment
-
if (
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This I'm trying to figure out a way to capture usage. And in _raw_response I'm got-
ChatCompletion(id='chatcmpl-AJHni8VbinfvMlISa7oqM9ayC2UxQ', choices=[Choice(finish_reason='stop', index=0, logprobs=None, message=ChatCompletionMessage(content=None, refusal=None, role='assistant', function_call=None, tool_calls=[ChatCompletionMessageToolCall(id='call_IYAnmrlFFREWtjOGHJrq53xM', function=Function(arguments='{"name":"John Doe","age":30}', name='UserInfo'), type='function')]))], created=1729160022, model='gpt-3.5-turbo-0125', object='chat.completion', service_tier=None, system_fingerprint=None, usage=CompletionUsage(completion_tokens=10, prompt_tokens=79, total_tokens=89, completion_tokens_details=None, prompt_tokens_details=None))
which is instance of "openai.types.chat.chat_completion.ChatCompletion"
usage=CompletionUsage(completion_tokens=10, prompt_tokens=79, total_tokens=89, completion_tokens_details=None, prompt_tokens_details=None))
Now here I'm looking out a authentic way to read usage and token.
is there any exposed method, or can utilise hooks for this. please help
Refer Sample Test Code Here
Beta Was this translation helpful? Give feedback.
All reactions