mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 11:14:04 +00:00
Fix; persistent 'model' default value
This commit is contained in:
parent
56e95197c6
commit
82fbbf67ca
1 changed files with 1 additions and 6 deletions
|
@ -103,16 +103,11 @@ class Completions():
|
||||||
|
|
||||||
def __init__(self, model, params):
|
def __init__(self, model, params):
|
||||||
self.params = params
|
self.params = params
|
||||||
self.model = model
|
|
||||||
|
|
||||||
def create(self, messages, model=None, **kwargs):
|
def create(self, messages, model=None, **kwargs):
|
||||||
if model is None:
|
|
||||||
if self.model is not None:
|
|
||||||
model = self.model
|
|
||||||
else:
|
|
||||||
raise ValueError("a value for `model` is required)
|
|
||||||
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
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue