mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-04-25 08:46:48 +02:00
refine code
This commit is contained in:
parent
ba477a93d5
commit
cd29edcc4f
5 changed files with 14 additions and 23 deletions
|
|
@ -78,11 +78,11 @@ class Context(BaseModel):
|
|||
# return self._llm
|
||||
|
||||
def llm(self, name: Optional[str] = None, provider: LLMType = LLMType.OPENAI) -> BaseLLM:
|
||||
"""Return a LLM instance, fixme: support multiple llm instances"""
|
||||
if self._llm is None:
|
||||
self._llm = create_llm_instance(self.config.get_llm_config(name, provider))
|
||||
if self._llm.cost_manager is None:
|
||||
self._llm.cost_manager = self.cost_manager
|
||||
"""Return a LLM instance, fixme: support cache"""
|
||||
# if self._llm is None:
|
||||
self._llm = create_llm_instance(self.config.get_llm_config(name, provider))
|
||||
if self._llm.cost_manager is None:
|
||||
self._llm.cost_manager = self.cost_manager
|
||||
return self._llm
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue