Add Google AI Studio /v1/files upload API support (#9645)

* test: fix import for test

* fix: fix bad error string

* docs: cleanup files docs

* fix(files/main.py): cleanup error string

* style: initial commit with a provider/config pattern for files api

google ai studio files api onboarding

* fix: test

* feat(gemini/files/transformation.py): support gemini files api response transformation

* fix(gemini/files/transformation.py): return file id as gemini uri

allows id to be passed in to chat completion request, just like openai

* feat(llm_http_handler.py): support async route for files api on llm_http_handler

* fix: fix linting errors

* fix: fix model info check

* fix: fix ruff errors

* fix: fix linting errors

* Revert "fix: fix linting errors"

This reverts commit 926a5a527f.

* fix: fix linting errors

* test: fix test

* test: fix tests
This commit is contained in:
Krish Dholakia 2025-04-02 08:56:58 -07:00 committed by GitHub
parent d1abb9b68b
commit 0519c0c507
40 changed files with 1006 additions and 245 deletions

View file

@ -62,7 +62,7 @@ def get_files_provider_config(
if custom_llm_provider == "vertex_ai":
return None
if files_config is None:
raise ValueError("files_config is not set, set it on your config.yaml file.")
raise ValueError("files_settings is not set, set it on your config.yaml file.")
for setting in files_config:
if setting.get("custom_llm_provider") == custom_llm_provider:
return setting