diff --git a/pages/toolkits/search/google_jobs.mdx b/pages/toolkits/search/google_jobs.mdx new file mode 100644 index 000000000..3e797721f --- /dev/null +++ b/pages/toolkits/search/google_jobs.mdx @@ -0,0 +1,92 @@ +# Search + +import ToolInfo from "@/components/ToolInfo"; +import Badges from "@/components/Badges"; +import TabbedCodeBlock from "@/components/TabbedCodeBlock"; +import TableOfContents from "@/components/TableOfContents"; + + + + + +The Arcade Google Jobs toolkit provides a pre-built set of tools for interacting with Google Jobs. These tools make it easy to build agents and AI apps that can: + +- Search for job openings with Google Jobs. + +## Install + +```bash +pip install arcade_search +``` + + + 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. + + +## Available Tools + + + + + If you need to perform an action that's not listed here, you can [get in touch + with us](mailto:contact@arcade.dev) to request a new tool, or [create your + own tools](/home/build-tools/create-a-toolkit). + + +## SearchJobs + +
+ + +Search for job openings with Google Jobs. + +**Auth:** + +- **Environment Variables Required:** + - `SERP_API_KEY`: Your SerpAPI API key. + +**Parameters** + +- **`query`** _(string, required)_ Search query. Provide a job title, company name, and/or any keywords in general representing what kind of jobs the user is looking for. +- **`location`** _(string, optional, Defaults to `None`)_ Location to search for jobs. E.g. 'United States' or 'New York, NY'. Defaults to None. +- **`language`** _(string, optional, Defaults to 'en' English)_ 2-character language code to use in the Google Maps search. +- **`limit`** _(int, optional, Defaults to 10)_ Maximum number of results to retrieve. Defaults to 10 (max supported by the API). +- **`next_page_token`** _(string, optional, Defaults to `None`)_ Next page token to paginate results. Defaults to None (start from the first page). + +## 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. diff --git a/pages/toolkits/development/search.mdx b/pages/toolkits/search/google_search.mdx similarity index 100% rename from pages/toolkits/development/search.mdx rename to pages/toolkits/search/google_search.mdx diff --git a/pages/toolkits/search/reference.mdx b/pages/toolkits/search/reference.mdx new file mode 100644 index 000000000..6ffac4851 --- /dev/null +++ b/pages/toolkits/search/reference.mdx @@ -0,0 +1,20 @@ +# Reference for Search Toolkit + +## GoogleMapsDistanceUnit + +Distance unit to use in the Google Maps search. + +- **`KM`**: Kilometers. +- **`MI`**: Miles. + +## GoogleMapsTravelMode + +Travel mode to use in the Google Maps search. + +- **`BEST`**: Best mode. +- **`DRIVING`**: Driving mode. +- **`MOTORCYCLE`**: Motorcycle mode. +- **`PUBLIC_TRANSPORTATION`**: Public transportation mode. +- **`WALKING`**: Walking mode. +- **`BICYCLE`**: Bicycling mode. +- **`FLIGHT`**: Flight mode. diff --git a/public/examples/integrations/toolkits/search/search_jobs_example_call_tool.js b/public/examples/integrations/toolkits/search/search_jobs_example_call_tool.js new file mode 100644 index 000000000..5c4c56478 --- /dev/null +++ b/public/examples/integrations/toolkits/search/search_jobs_example_call_tool.js @@ -0,0 +1,21 @@ +import { Arcade } from "@arcadeai/arcadejs"; + +const client = new Arcade(); // Automatically finds the `ARCADE_API_KEY` env variable + +const USER_ID = "you@example.com"; +const TOOL_NAME = "Search.SearchJobs"; + +const toolInput = { + query: "software engineer", + location: "United States", + language: "en", + limit: 10, +}; + +const response = await client.tools.execute({ + tool_name: TOOL_NAME, + input: toolInput, + user_id: USER_ID, +}); + +console.log(response); diff --git a/public/examples/integrations/toolkits/search/search_jobs_example_call_tool.py b/public/examples/integrations/toolkits/search/search_jobs_example_call_tool.py new file mode 100644 index 000000000..bede86bf3 --- /dev/null +++ b/public/examples/integrations/toolkits/search/search_jobs_example_call_tool.py @@ -0,0 +1,20 @@ +from arcadepy import Arcade + +client = Arcade() # Automatically finds the `ARCADE_API_KEY` env variable + +USER_ID = "you@example.com" +TOOL_NAME = "Search.SearchJobs" + +tool_input = { + "query": "software engineer", + "location": "United States", + "language": "en", + "limit": 10, +} + +response = client.tools.execute( + tool_name=TOOL_NAME, + input=tool_input, + user_id=USER_ID, +) +print(response) diff --git a/public/examples/integrations/toolkits/search/search_jobs_example_llm_oai.js b/public/examples/integrations/toolkits/search/search_jobs_example_llm_oai.js new file mode 100644 index 000000000..23b900118 --- /dev/null +++ b/public/examples/integrations/toolkits/search/search_jobs_example_llm_oai.js @@ -0,0 +1,21 @@ +import OpenAI from "openai"; + +const USER_ID = "you@example.com"; +const PROMPT = + "Search for 'software engineer' job openings in the United States."; +const TOOL_NAME = "Search.SearchJobs"; + +const client = new OpenAI({ + baseURL: "https://api.arcade.dev", + apiKey: process.env.ARCADE_API_KEY, +}); + +const response = await client.chat.completions.create({ + messages: [{ role: "user", content: PROMPT }], + model: "gpt-4o-mini", + user: USER_ID, + tools: [TOOL_NAME], + tool_choice: "generate", +}); + +console.log(response.choices[0].message.content); diff --git a/public/examples/integrations/toolkits/search/search_jobs_example_llm_oai.py b/public/examples/integrations/toolkits/search/search_jobs_example_llm_oai.py new file mode 100644 index 000000000..5c7d1f9e1 --- /dev/null +++ b/public/examples/integrations/toolkits/search/search_jobs_example_llm_oai.py @@ -0,0 +1,21 @@ +import os +from openai import OpenAI + +USER_ID = "you@example.com" +PROMPT = "Search for 'software engineer' job openings in the United States." +TOOL_NAME = "Search.SearchJobs" + +client = OpenAI( + base_url="https://api.arcade.dev", api_key=os.environ.get("ARCADE_API_KEY") +) + +response = client.chat.completions.create( + messages=[ + {"role": "user", "content": PROMPT}, + ], + model="gpt-4o-mini", + user=USER_ID, + tools=[TOOL_NAME], + tool_choice="generate", +) +print(response.choices[0].message.content) diff --git a/public/images/icons/google_maps.png b/public/images/icons/google_maps.png new file mode 100644 index 000000000..01fb5c76e Binary files /dev/null and b/public/images/icons/google_maps.png differ diff --git a/src/components/custom/Toolkits/toolkits-config.ts b/src/components/custom/Toolkits/toolkits-config.ts index 87d4fe292..312af6533 100644 --- a/src/components/custom/Toolkits/toolkits-config.ts +++ b/src/components/custom/Toolkits/toolkits-config.ts @@ -19,6 +19,7 @@ export const categories: Category[] = [ { id: "social", name: "Social & Communication" }, { id: "development", name: "Developer Tools" }, { id: "entertainment", name: "Entertainment" }, + { id: "search", name: "Search" }, ]; export const tools: Tool[] = [ @@ -118,11 +119,19 @@ export const tools: Tool[] = [ type: "arcade", }, { - name: "Search", - image: "serpapi", - summary: "Perform web searches and retrieve relevant information", - link: "/toolkits/development/search", - category: "development", + name: "Google Search", + image: "google_search", + summary: "Perform Google searches and retrieve relevant information", + link: "/toolkits/search/google_search", + category: "search", + type: "arcade", + }, + { + name: "Google Jobs", + image: "google_jobs", + summary: "Search for job openings with Google Jobs", + link: "/toolkits/search/google_jobs", + category: "search", type: "arcade", }, {