remove global config

This commit is contained in:
shenchucheng 2024-08-13 22:34:12 +08:00
parent 6e0990f251
commit 2968c181c1
39 changed files with 193 additions and 123 deletions

View file

@ -5,12 +5,23 @@
@Author : alexanderwu
@File : browser_config.py
"""
from enum import Enum
from typing import Literal
from metagpt.tools import WebBrowserEngineType
from metagpt.utils.yaml_model import YamlModel
class WebBrowserEngineType(Enum):
PLAYWRIGHT = "playwright"
SELENIUM = "selenium"
CUSTOM = "custom"
@classmethod
def __missing__(cls, key):
"""Default type conversion"""
return cls.CUSTOM
class BrowserConfig(YamlModel):
"""Config for Browser"""

View file

@ -5,14 +5,23 @@
@Author : alexanderwu
@File : search_config.py
"""
from enum import Enum
from typing import Callable, Optional
from pydantic import ConfigDict, Field
from metagpt.tools import SearchEngineType
from metagpt.utils.yaml_model import YamlModel
class SearchEngineType(Enum):
SERPAPI_GOOGLE = "serpapi"
SERPER_GOOGLE = "serper"
DIRECT_GOOGLE = "google"
DUCK_DUCK_GO = "ddg"
CUSTOM_ENGINE = "custom"
BING = "bing"
class SearchConfig(YamlModel):
"""Config for Search"""