mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 03:04:13 +00:00
Merge pull request #985 from estill01/patch-1
Enable setting default `model` value for `LiteLLM`, `Chat`, `Completions`
This commit is contained in:
commit
cc4a1d2603
1 changed files with 4 additions and 3 deletions
|
@ -99,17 +99,18 @@ class Chat():
|
|||
def __init__(self, params):
|
||||
self.params = params
|
||||
self.completions = Completions(self.params)
|
||||
|
||||
|
||||
class Completions():
|
||||
|
||||
def __init__(self, params):
|
||||
self.params = params
|
||||
|
||||
def create(self, model, messages, **kwargs):
|
||||
def create(self, messages, model=None, **kwargs):
|
||||
for k, v in kwargs.items():
|
||||
self.params[k] = v
|
||||
model = model or self.params.get('model')
|
||||
response = completion(model=model, messages=messages, **self.params)
|
||||
return response
|
||||
return response
|
||||
|
||||
@client
|
||||
async def acompletion(*args, **kwargs):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue