mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-27 11:43:54 +00:00
(feat) native perplexity support
This commit is contained in:
parent
06abb9d146
commit
d4c81814f1
2 changed files with 3 additions and 2 deletions
|
@ -258,6 +258,7 @@ provider_list: List = [
|
||||||
"oobabooga",
|
"oobabooga",
|
||||||
"ollama",
|
"ollama",
|
||||||
"deepinfra",
|
"deepinfra",
|
||||||
|
"perplexity",
|
||||||
"custom", # custom apis
|
"custom", # custom apis
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
|
@ -263,7 +263,7 @@ def completion(
|
||||||
if deployment_id != None: # azure llms
|
if deployment_id != None: # azure llms
|
||||||
model=deployment_id
|
model=deployment_id
|
||||||
custom_llm_provider="azure"
|
custom_llm_provider="azure"
|
||||||
model, custom_llm_provider, dynamic_api_key = get_llm_provider(model=model, custom_llm_provider=custom_llm_provider, api_base=api_base)
|
model, custom_llm_provider, dynamic_api_key, api_base = get_llm_provider(model=model, custom_llm_provider=custom_llm_provider, api_base=api_base)
|
||||||
model_api_key = get_api_key(llm_provider=custom_llm_provider, dynamic_api_key=api_key) # get the api key from the environment if required for the model
|
model_api_key = get_api_key(llm_provider=custom_llm_provider, dynamic_api_key=api_key) # get the api key from the environment if required for the model
|
||||||
if model_api_key and "sk-litellm" in model_api_key:
|
if model_api_key and "sk-litellm" in model_api_key:
|
||||||
api_base = "https://proxy.litellm.ai"
|
api_base = "https://proxy.litellm.ai"
|
||||||
|
@ -1497,7 +1497,7 @@ def embedding(
|
||||||
Raises:
|
Raises:
|
||||||
- exception_type: If an exception occurs during the API call.
|
- exception_type: If an exception occurs during the API call.
|
||||||
"""
|
"""
|
||||||
model, custom_llm_provider, dynamic_api_key = get_llm_provider(model, custom_llm_provider)
|
model, custom_llm_provider, dynamic_api_key, api_base = get_llm_provider(model, custom_llm_provider)
|
||||||
try:
|
try:
|
||||||
response = None
|
response = None
|
||||||
logging = litellm_logging_obj
|
logging = litellm_logging_obj
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue