Merge branch 'dev' of https://github.com/geekan/MetaGPT into geekan/dev

This commit is contained in:
莘权 马 2023-12-28 12:04:30 +08:00
commit 1f3fcdb2dc
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)