Add gemini audio input support + handle special tokens in sagemaker response#9640
Add gemini audio input support + handle special tokens in sagemaker response#96409 commits merged into
Conversation
…point no team/org split on daily user endpoint
enables passing google cloud bucket urls
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
| ] | ||
| } | ||
| ) | ||
| print("raw_request: ", raw_request) |
Check failure
Code scanning / CodeQL
Clear-text logging of sensitive information
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI about 1 year ago
To fix the problem, we need to ensure that sensitive information is not logged. This can be achieved by scrubbing the raw_request object of any sensitive data before logging it. We can use a utility function to remove or mask sensitive information from the raw_request object before printing it.
- Add a utility function to scrub sensitive information from the
raw_requestobject. - Use this utility function to clean the
raw_requestobject before logging it. - Ensure that the changes are made in the
tests/llm_translation/base_llm_unit_tests.pyfile.
| @@ -11,2 +11,9 @@ | ||
|
|
||
| def scrub_sensitive_data(data): | ||
| if isinstance(data, dict): | ||
| for key in ["client_secret", "api_key", "azure_ad_token", "azure_username", "azure_password"]: | ||
| if key in data: | ||
| data[key] = "REDACTED" | ||
| return data | ||
|
|
||
| sys.path.insert( | ||
| @@ -954,2 +961,3 @@ | ||
| ) | ||
| raw_request = scrub_sensitive_data(raw_request) | ||
| print("raw_request: ", raw_request) |
…when counting sagemaker tokens
|
I'm getting |
Title
Relevant issues
Feature - enables calling gemini with audio input (b64 + file)
Fixes #9574 (comment)
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
tests/litellm/directory, Adding at least 1 test is a hard requirement - see detailsmake test-unit)[https://docs.litellm.ai/docs/extras/contributing_code]Type
🆕 New Feature
🐛 Bug Fix
🧹 Refactoring
📖 Documentation
🚄 Infrastructure
✅ Test
Changes