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
Entering new AgentExecutor chain...
05/18/2024 12:37:09 PM - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK"
Hi! How can I help you today?
I'm facing the same issue as well. I keep getting 0 as the token count when using get_openai_callback, irrespective of any agent_type, like tool_calling or openai-tools
rafboh
changed the title
get_openai_callback does not returns token usage when used with openai tools agent
get_openai_callback does not return token usage when used with openai tools agent
May 19, 2024
Solved ! So easy, self.agent_executor = AgentExecutor(
agent=agent, tools=active_tools, verbose=True, stream_runnable=False
) stream_runnable must be set to False to make it working in my case
Checked other resources
Example Code
Error Message and Stack Trace (if applicable)
Description
get_openai_callback does not returns token usage when used with openai tools agent
System Info
System Information
Package Information
Packages not installed (Not Necessarily a Problem)
The following packages were not found:
The text was updated successfully, but these errors were encountered: