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
Hey! I was using 0.4.6.2 with langchain and crewai. It was working, but today I updated g4f to latest version and stoped working consistenly with the following error (random, the code works ~15% of the time):
self.token_cost_process.sum_cached_prompt_tokens(
File "/Users/xxx/miniconda3/envs/crewai/lib/python3.12/site-packages/crewai/agents/agent_builder/utilities/base_token_process.py", line 21, in sum_cached_prompt_tokens
self.cached_prompt_tokens += tokens
TypeError: unsupported operand type(s) for +=: 'int' and 'NoneType'
Here is my code example (not a quickstart to run, just to ilustrate how I'm using g4f):
Thank you for the excellent example; it has been incorporated into the pydantic_ai support by adding completion_tokens_details=None and prompt_tokens_details=None. I will investigate further options. @otomay
Hey! I was using 0.4.6.2 with langchain and crewai. It was working, but today I updated g4f to latest version and stoped working consistenly with the following error (random, the code works ~15% of the time):
Here is my code example (not a quickstart to run, just to ilustrate how I'm using g4f):
I installed both versions and made a post request to each one. Here is the response results for both versions:
0.4.6.2
0.4.7.5
It's clearly that something with tokens has changed, but I can't see why stopped working.
Is there a way to fix it?
The text was updated successfully, but these errors were encountered: