Merge pull request #985 from estill01/patch-1

Enable setting default `model` value for `LiteLLM`, `Chat`, `Completions`
This commit is contained in:
Krish Dholakia 2023-12-09 13:59:00 -08:00 committed by GitHub
commit cc4a1d2603
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -105,9 +105,10 @@ class Completions():
def __init__(self, params): def __init__(self, params):
self.params = params self.params = params
def create(self, model, messages, **kwargs): def create(self, messages, model=None, **kwargs):
for k, v in kwargs.items(): for k, v in kwargs.items():
self.params[k] = v self.params[k] = v
model = model or self.params.get('model')
response = completion(model=model, messages=messages, **self.params) response = completion(model=model, messages=messages, **self.params)
return response return response