Fix LLM API key (#4623)

* Fix LLM API key

* Remove unused import

* Update web/src/app/admin/configuration/llm/LLMProviderUpdateForm.tsx

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>

---------

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
This commit is contained in:
Chris Weaver
2025-04-27 16:10:36 -07:00
committed by GitHub
parent bbd0874200
commit ea0664e203
4 changed files with 33 additions and 26 deletions

View File

@@ -70,7 +70,7 @@ def test_llm_configuration(
name=test_llm_request.name, db_session=db_session
)
# if an API key is not provided, use the existing provider's API key
if existing_provider and test_api_key is None:
if existing_provider and not test_llm_request.api_key_changed:
test_api_key = existing_provider.api_key
# For this "testing" workflow, we do *not* need the actual `max_input_tokens`.

View File

@@ -28,7 +28,10 @@ class TestLLMRequest(BaseModel):
fast_default_model_name: str | None = None
deployment_name: str | None = None
model_configurations: list["ModelConfigurationUpsertRequest"] = []
model_configurations: list["ModelConfigurationUpsertRequest"]
# if try and use the existing API key
api_key_changed: bool
class LLMProviderDescriptor(BaseModel):