Update GoogleSearchAPIWrapperComponent parameters
This commit is contained in:
parent
6d217fb81e
commit
ab35550240
1 changed files with 3 additions and 8 deletions
|
|
@ -1,10 +1,6 @@
|
||||||
|
|
||||||
from langflow import CustomComponent
|
from langflow import CustomComponent
|
||||||
from typing import Optional, Union, Callable
|
from typing import Union, Callable
|
||||||
|
|
||||||
# Assuming GoogleSearchAPIWrapper is a valid import based on JSON
|
|
||||||
# and it exists in some module that should be imported here.
|
|
||||||
# The import path should be replaced with the correct one once available.
|
|
||||||
from langchain_community.utilities.google_search import GoogleSearchAPIWrapper
|
from langchain_community.utilities.google_search import GoogleSearchAPIWrapper
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -16,12 +12,11 @@ class GoogleSearchAPIWrapperComponent(CustomComponent):
|
||||||
return {
|
return {
|
||||||
"google_api_key": {"display_name": "Google API Key", "password": True},
|
"google_api_key": {"display_name": "Google API Key", "password": True},
|
||||||
"google_cse_id": {"display_name": "Google CSE ID","password":True},
|
"google_cse_id": {"display_name": "Google CSE ID","password":True},
|
||||||
# Fields with "show": False are omitted based on the rules
|
|
||||||
}
|
}
|
||||||
|
|
||||||
def build(
|
def build(
|
||||||
self,
|
self,
|
||||||
google_api_key: Optional[str] = None,
|
google_api_key: str,
|
||||||
google_cse_id: Optional[str] = None,
|
google_cse_id: str,
|
||||||
) -> Union[GoogleSearchAPIWrapper, Callable]:
|
) -> Union[GoogleSearchAPIWrapper, Callable]:
|
||||||
return GoogleSearchAPIWrapper(google_api_key=google_api_key, google_cse_id=google_cse_id)
|
return GoogleSearchAPIWrapper(google_api_key=google_api_key, google_cse_id=google_cse_id)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue