mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-27 03:34:10 +00:00
fix: allow api base to be set for all providers
enables proxy use cases
This commit is contained in:
parent
72f55a4e6c
commit
00993f3575
7 changed files with 76 additions and 11 deletions
|
@ -100,6 +100,7 @@ def validate_environment(api_key):
|
|||
def completion(
|
||||
model: str,
|
||||
messages: list,
|
||||
api_base: str,
|
||||
model_response: ModelResponse,
|
||||
print_verbose: Callable,
|
||||
encoding,
|
||||
|
@ -110,7 +111,7 @@ def completion(
|
|||
logger_fn=None,
|
||||
):
|
||||
headers = validate_environment(api_key)
|
||||
completion_url = "https://api.cohere.ai/v1/generate"
|
||||
completion_url = api_base
|
||||
model = model
|
||||
prompt = " ".join(message["content"] for message in messages)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue