Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using Gemini with LiteLLM - I get the following error
File "/Users/handrew/env/lib/python3.11/site-packages/agents/extensions/models/litellm_model.py", line 111, in get_response input_tokens_details=InputTokensDetails( ^^^^^^^^^^^^^^^^^^^ File "/Users/handrew/env/lib/python3.11/site-packages/pydantic/main.py", line 253, in __init__ validated_self = self.__pydantic_validator__.validate_python(data, self_instance=self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pydantic_core._pydantic_core.ValidationError: 1 validation error for InputTokensDetails cached_tokens Input should be a valid integer [type=int_type, input_value=None, input_type=NoneType]
Issue is that getattr will return None if the attribute exists but is literally None. Just have to add "or 0".
getattr
None
I will write a PR.
The text was updated successfully, but these errors were encountered:
fix Gemini token validation issue with LiteLLM (#735)
1364f44
Fix for #734
thanks for fixing!
Sorry, something went wrong.
No branches or pull requests
Using Gemini with LiteLLM - I get the following error
Issue is that
getattr
will return None if the attribute exists but is literallyNone
. Just have to add "or 0".I will write a PR.
The text was updated successfully, but these errors were encountered: