mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-05-05 05:42:37 +02:00
add discovery_service_url for GoogleAPIWrapper
This commit is contained in:
parent
f9eb9cb7d2
commit
9b360265a9
2 changed files with 4 additions and 1 deletions
|
|
@ -19,6 +19,7 @@ class SearchConfig(YamlModel):
|
|||
api_type: SearchEngineType = SearchEngineType.DUCK_DUCK_GO
|
||||
api_key: str = ""
|
||||
cse_id: str = "" # for google
|
||||
discovery_service_url: str = "" # for google
|
||||
search_func: Optional[Callable] = None
|
||||
params: dict = Field(
|
||||
default_factory=lambda: {
|
||||
|
|
|
|||
|
|
@ -26,6 +26,8 @@ class GoogleAPIWrapper(BaseModel):
|
|||
|
||||
api_key: str
|
||||
cse_id: str
|
||||
discovery_service_url: Optional[str] = None
|
||||
|
||||
loop: Optional[asyncio.AbstractEventLoop] = None
|
||||
executor: Optional[futures.Executor] = None
|
||||
proxy: Optional[str] = None
|
||||
|
|
@ -56,7 +58,7 @@ class GoogleAPIWrapper(BaseModel):
|
|||
|
||||
@property
|
||||
def google_api_client(self):
|
||||
build_kwargs = {"developerKey": self.api_key}
|
||||
build_kwargs = {"developerKey": self.api_key, "discoveryServiceUrl": self.discovery_service_url}
|
||||
if self.proxy:
|
||||
parse_result = urlparse(self.proxy)
|
||||
proxy_type = parse_result.scheme
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue