Skip to content

Commit

Permalink
fix(llm): drop unsupported params
Browse files Browse the repository at this point in the history
  • Loading branch information
idiotWu committed Dec 27, 2024
1 parent 7c4b106 commit cd49422
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions npiai/llm/llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from typing import List, Union
import os
import asyncio
from litellm import acompletion, ModelResponse, CustomStreamWrapper
from litellm import acompletion, ModelResponse, CustomStreamWrapper, drop_params


class Provider(Enum):
Expand All @@ -27,7 +27,9 @@ def get_provider(self) -> Provider:

# TODO: kwargs typings
async def completion(self, **kwargs) -> Union[ModelResponse, CustomStreamWrapper]:
return await acompletion(model=self.model, api_key=self.api_key, **kwargs)
return await acompletion(
model=self.model, api_key=self.api_key, drop_params=True, **kwargs
)

def completion_sync(self, **kwargs) -> Union[ModelResponse, CustomStreamWrapper]:
return asyncio.run(self.completion(**kwargs))
Expand Down

0 comments on commit cd49422

Please sign in to comment.