🌟 The Multi-Agent Framework: First AI Software Company, Towards Natural Language Programming
add with_model to BaseLLM
geekane40fc66f9830
diff --git a/metagpt/provider/base_llm.py b/metagpt/provider/base_llm.pyindex 70de4e10d..71308930a 100644--- a/metagpt/provider/base_llm.py+++ b/metagpt/provider/base_llm.py@@ -39,7 +39,7 @@ class BaseLLM(ABC):# OpenAI / Azure / Othersaclient: Optional[Union[AsyncOpenAI]] = Nonecost_manager: Optional[CostManager] = None- model: Optional[str] = None+ model: Optional[str] = None # deprecatedpricing_plan: Optional[str] = None@abstractmethod@@ -231,3 +231,8 @@ class BaseLLM(ABC):def messages_to_dict(self, messages):"""objects to [{"role": "user", "content": msg}] etc."""return [i.to_dict() for i in messages]++ def with_model(self, model: str):+ """Set model and return self. For example, `with_model("gpt-3.5-turbo")`."""+ self.config.model = model+ return self