fix client_kwargs due to previous PR delete sync client

This commit is contained in:
better629 2023-12-28 09:34:51 +08:00
parent 641c71bf18
commit 1f9234eee8
2 changed files with 4 additions and 6 deletions

View file

@ -85,10 +85,9 @@ class FireworksLLM(OpenAILLM):
self._init_client()
self.model = self.config.fireworks_api_model # `self.model` should after `_make_client` to rewrite it
def _make_client_kwargs(self) -> (dict, dict):
def _make_client_kwargs(self) -> dict:
kwargs = dict(api_key=self.config.fireworks_api_key, base_url=self.config.fireworks_api_base)
async_kwargs = kwargs.copy()
return kwargs, async_kwargs
return kwargs
def _update_costs(self, usage: CompletionUsage):
if self.config.calc_usage and usage:

View file

@ -48,10 +48,9 @@ class OpenLLMGPTAPI(OpenAILLM):
self._init_client()
self.model = self.config.open_llm_api_model # `self.model` should after `_make_client` to rewrite it
def _make_client_kwargs(self) -> (dict, dict):
def _make_client_kwargs(self) -> dict:
kwargs = dict(api_key="sk-xxx", base_url=self.config.open_llm_api_base)
async_kwargs = kwargs.copy()
return kwargs, async_kwargs
return kwargs
def _calc_usage(self, messages: list[dict], rsp: str) -> CompletionUsage:
usage = CompletionUsage(prompt_tokens=0, completion_tokens=0, total_tokens=0)