add params to search engine

This commit is contained in:
geekan 2024-03-21 14:52:17 +08:00
parent fcb2ea4863
commit 8486e52048
3 changed files with 11 additions and 6 deletions

View file

@ -7,6 +7,8 @@
"""
from typing import Callable, Optional
from pydantic import Field
from metagpt.tools import SearchEngineType
from metagpt.utils.yaml_model import YamlModel
@ -18,4 +20,11 @@ class SearchConfig(YamlModel):
api_key: str = ""
cse_id: str = "" # for google
search_func: Optional[Callable] = None
params: dict = {}
params: dict = Field(
default_factory=lambda: {
"engine": "google",
"google_domain": "google.com",
"gl": "us",
"hl": "en",
}
)