-
Notifications
You must be signed in to change notification settings - Fork 7
Document Google News search tool #190
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
Closed
Closed
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,118 @@ | ||
| # Search | ||
|
|
||
| import ToolInfo from "@/components/ToolInfo"; | ||
| import Badges from "@/components/Badges"; | ||
| import TabbedCodeBlock from "@/components/TabbedCodeBlock"; | ||
| import TableOfContents from "@/components/TableOfContents"; | ||
|
|
||
| <ToolInfo | ||
| description="Enable agents to search for news stories with Google News." | ||
| author="Arcade" | ||
| codeLink="https://github.com/ArcadeAI/arcade-ai/tree/main/toolkits/search" | ||
| authType="API Key" | ||
| versions={["0.1.0"]} | ||
| /> | ||
|
|
||
| <Badges repo="arcadeai/arcade_search" /> | ||
|
|
||
| The Arcade Google News toolkit provides a pre-built set of tools for interacting with Google News. These tools make it easy to build agents and AI apps that can: | ||
|
|
||
| - Search for news stories with Google News. | ||
|
|
||
| ## Install | ||
|
|
||
| ```bash | ||
| pip install arcade_search | ||
| ``` | ||
|
|
||
| <Note> | ||
| pip installing the toolkit is only needed if you are [self-hosting](/home/install/overview) Arcade. You do not need to install the toolkit if you're using Arcade Cloud. | ||
| </Note> | ||
|
|
||
| ## Default parameters | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. consider placing below tools and Auth section. Seems unlikely that someone wants to know how to set a default parameter before seeing the tools |
||
|
|
||
| Language and Country are configurable through environment variables. When set, they will be used as default for Google News tools. | ||
|
|
||
| Providing a different value as `language_code` or `country_code` argument in the tool call will override the default value. | ||
|
|
||
| **Language** | ||
|
|
||
| The language code is a 2-character code that determines the language in which the API will search and return news articles. There are two environment variables: | ||
|
|
||
| - `ARCADE_GOOGLE_LANGUAGE`: a default value for all Google search tools. If not set, defaults to 'en' (English). | ||
| - `ARCADE_GOOGLE_NEWS_LANGUAGE`: a default value for the news search tools. If not set, defaults to `ARCADE_GOOGLE_LANGUAGE`. | ||
|
|
||
| A list of supported language codes can be found [here](/toolkits/search/reference#languagecodes). | ||
|
|
||
| **Country** | ||
|
|
||
| The country code is a 2-character code that determines the country in which the API will search for news articles. There are two environment variables: | ||
|
|
||
| - `ARCADE_GOOGLE_NEWS_COUNTRY`: a default value for the `SearchNews` tool. If not set, defaults to `None` (search news globally). | ||
|
|
||
| A list of supported country codes can be found [here](/toolkits/search/reference#countrycodes). | ||
|
|
||
| ## Available Tools | ||
|
|
||
| <TableOfContents | ||
| headers={["Tool Name", "Description"]} | ||
| data={ | ||
| [ | ||
| ["SearchNews", "Search for news stories with Google News."], | ||
| ] | ||
| } | ||
| /> | ||
|
|
||
| <Tip> | ||
| If you need to perform an action that's not listed here, you can [get in touch | ||
| with us](mailto:[email protected]) to request a new tool, or [create your | ||
| own tools](/home/build-tools/create-a-toolkit). | ||
| </Tip> | ||
|
|
||
| ## SearchNews | ||
|
|
||
| <br /> | ||
| <TabbedCodeBlock | ||
| tabs={[ | ||
| { | ||
| label: "Call the Tool Directly", | ||
| content: { | ||
| Python: [ | ||
| "/examples/integrations/toolkits/search/search_news_example_call_tool.py", | ||
| ], | ||
| JavaScript: ["/examples/integrations/toolkits/search/search_news_example_call_tool.js"], | ||
| }, | ||
| }, | ||
| { | ||
| label: "Execute the Tool with OpenAI", | ||
| content: { | ||
| Python: [ | ||
| "/examples/integrations/toolkits/search/search_news_example_llm_oai.py", | ||
| ], | ||
| JavaScript: ["/examples/integrations/toolkits/search/search_news_example_llm_oai.js"], | ||
| }, | ||
| }, | ||
| ]} | ||
| /> | ||
|
|
||
| Search for news stories with Google News. | ||
|
|
||
| **Auth:** | ||
|
|
||
| - **Environment Variables Required:** | ||
| - `SERP_API_KEY`: Your SerpAPI API key. | ||
|
|
||
| **Parameters** | ||
|
|
||
| - **`query`** _(string, required)_ Keywords to search for news articles. E.g. 'Apple launches new iPhone'. | ||
| - **`country_code`** _(string, optional, Defaults to `None`)_ 2-character country code to search for news articles. E.g. 'us' (United States). Defaults to `None` (search news globally). | ||
| - **`language`** _(string, optional, Defaults to 'en' English)_ 2-character language code to search for news articles. E.g. 'en' (English). Defaults to 'en' (English). | ||
| - **`limit`** _(int, optional, Defaults to 10)_ Maximum number of news articles to return. Defaults to None (returns all results found by the API). | ||
|
|
||
| ## Auth | ||
|
|
||
| The Arcade Google Maps toolkit uses the [SerpAPI](https://serpapi.com/) to get directions and search Google Maps. | ||
|
|
||
| **Global Environment Variables:** | ||
|
|
||
| - `SERP_API_KEY`: Your SerpAPI API key. | ||
File renamed without changes.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
--> Google News