Skip to content

Commit

Permalink
Merge pull request #985 from estill01/patch-1
Browse files Browse the repository at this point in the history
Enable setting default `model` value for `LiteLLM`, `Chat`, `Completions`
  • Loading branch information
krrishdholakia authored Dec 9, 2023
2 parents 5e5ffc3 + 737abbb commit cc4a1d2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions litellm/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit cc4a1d2

Please sign in to comment.