mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 10:44:24 +00:00
feat(utils.py): accept 'api_key' as param for validate_environment
Closes https://github.com/BerriAI/litellm/issues/4375
This commit is contained in:
parent
2163434ff3
commit
1ba3fcc3fb
2 changed files with 18 additions and 1 deletions
|
@ -258,6 +258,13 @@ def test_validate_environment_empty_model():
|
|||
raise Exception()
|
||||
|
||||
|
||||
def test_validate_environment_api_key():
|
||||
response_obj = validate_environment(model="gpt-3.5-turbo", api_key="sk-my-test-key")
|
||||
assert (
|
||||
response_obj["keys_in_environment"] is True
|
||||
), f"Missing keys={response_obj['missing_keys']}"
|
||||
|
||||
|
||||
@mock.patch.dict(os.environ, {"OLLAMA_API_BASE": "foo"}, clear=True)
|
||||
def test_validate_environment_ollama():
|
||||
for provider in ["ollama", "ollama_chat"]:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue