Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update web_search.py #796

Merged
merged 1 commit into from
Sep 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions sdk/eidolon_ai_sdk/builtins/logic_units/web_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,17 +69,20 @@ async def go_to_url(self, url: str) -> str:
raise ValueError(f"Summarizer {self.spec.summarizer} not supported")


# Requires custom search engine + token setup in google project. See more at https://developers.google.com/custom-search/v1/reference/rest/v1/cse/list
# Requires Google project, Custom Search Engine ID, and API key.
# For CSE_ID see https://programmablesearchengine.google.com/controlpanel/all
# For CSE_TOKEN (API KEY) see https://developers.google.com/custom-search/v1/introduction
# Add CSE_ID and CSE_TOKEN to .env and restart server
class SearchSpec(BaseModel):
cse_id: str = Field(
default_factory=lambda: os.environ["CSE_ID"],
validate_default=True,
desctiption="Google Custom Search Engine Id.",
description="Google Custom Search Engine Id.",
)
cse_token: str = Field(
default_factory=lambda: os.environ["CSE_TOKEN"],
validate_default=True,
desctiption="Google Project dev token, must have search permissions.",
description="Google Project dev token, must have search permissions.",
)
name: str = "search"
description: str = None
Expand Down
Loading