🌟 The Multi-Agent Framework: First AI Software Company, Towards Natural Language Programming
feat: +LLMType
莘权 马3a4f31b51787
diff --git a/metagpt/actions/action.py b/metagpt/actions/action.pyindex e4b9613ad..c52caaa40 100644--- a/metagpt/actions/action.py+++ b/metagpt/actions/action.py@@ -5,6 +5,7 @@@Author : alexanderwu@File : action.py@Modified By: mashenquan, 2023/8/20. Add function return annotations.+@Modified By: mashenquan, 2023/9/8. Replace LLM with LLMFactory"""from __future__ import annotations@@ -14,16 +15,17 @@ from typing import Optionalfrom tenacity import retry, stop_after_attempt, wait_fixedfrom metagpt.actions.action_output import ActionOutput-from metagpt.llm import LLM+from metagpt.llm import LLMFactoryfrom metagpt.logs import logger+from metagpt.provider.base_gpt_api import BaseGPTAPIfrom metagpt.utils.common import OutputParserclass Action(ABC):- def __init__(self, name: str = "", context=None, llm: LLM = None):+ def __init__(self, name: str = "", context=None, llm: BaseGPTAPI = None):self.name: str = nameif llm is None:- llm = LLM()+ llm = LLMFactory.new_llm()self.llm = llmself.context = contextself.prefix = ""