mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 10:44:24 +00:00
bump version
This commit is contained in:
parent
b0a2e57a8a
commit
8acf959430
2 changed files with 13 additions and 1 deletions
|
@ -1411,6 +1411,18 @@ def valid_model(model):
|
|||
except:
|
||||
raise InvalidRequestError(message="", model=model, llm_provider="")
|
||||
|
||||
# check valid api key
|
||||
def check_valid_key(model: str, api_key: str):
|
||||
messages = [{"role": "user", "content": "Hey, how's it going?"}]
|
||||
try:
|
||||
litellm.completion(model=model, messages=messages, api_key=api_key)
|
||||
return True
|
||||
except AuthenticationError as e:
|
||||
return False
|
||||
except Exception as e:
|
||||
raise ValueError(str(e))
|
||||
|
||||
|
||||
|
||||
# integration helper function
|
||||
def modify_integration(integration_name, integration_params):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue