refine code

This commit is contained in:
geekan 2024-01-10 15:34:49 +08:00
parent f5bb850f25
commit 5cd5eebc5b
12 changed files with 67 additions and 56 deletions

View file

@ -14,8 +14,6 @@ from pydantic import BaseModel, ConfigDict, Field, model_validator
from metagpt.actions.action_node import ActionNode
from metagpt.context import ContextMixin
from metagpt.llm import LLM
from metagpt.provider.base_llm import BaseLLM
from metagpt.schema import (
CodeSummarizeContext,
CodingContext,
@ -30,7 +28,6 @@ class Action(SerializationMixin, ContextMixin, BaseModel):
model_config = ConfigDict(arbitrary_types_allowed=True, exclude=["llm"])
name: str = ""
llm: BaseLLM = Field(default_factory=LLM, exclude=True)
i_context: Union[dict, CodingContext, CodeSummarizeContext, TestingContext, RunCodeContext, str, None] = ""
prefix: str = "" # aask*时会加上prefix作为system_message
desc: str = "" # for skill manager

View file

@ -133,7 +133,6 @@ class GenerateTable(Action):
name: str = "GenerateTable"
i_context: Optional[str] = None
llm: BaseLLM = Field(default_factory=LLM)
language: str = "ch"
async def run(self, ocr_results: list, filename: str, *args, **kwargs) -> dict[str, str]:

View file

@ -178,7 +178,6 @@ class WebBrowseAndSummarize(Action):
name: str = "WebBrowseAndSummarize"
i_context: Optional[str] = None
llm: BaseLLM = Field(default_factory=LLM)
desc: str = "Explore the web and provide summaries of articles and webpages."
browse_func: Union[Callable[[list[str]], None], None] = None
web_browser_engine: Optional[WebBrowserEngine] = None