flashdata-dev commited on
Commit
7953e73
·
verified ·
1 Parent(s): c27ff60

Clarify capability names and simplify documentation

Browse files
Files changed (4) hide show
  1. README.md +37 -40
  2. index.html +5 -5
  3. task.json +6 -5
  4. tool.py +1 -1
README.md CHANGED
@@ -1,12 +1,13 @@
1
  ---
2
- title: "Google Search for AI agent research"
3
- emoji: 🔎
4
- colorFrom: blue
5
- colorTo: indigo
6
- sdk: static
7
- app_file: index.html
 
8
  pinned: false
9
- license: mit
10
  tags:
11
  - smolagents
12
  - tool
@@ -14,25 +15,27 @@ tags:
14
  - google-search
15
  ---
16
 
17
- # Google Search for AI agent research — FlashData
18
 
19
- Give a research agent current web evidence before it answers a question. Search a focused question, keep each title, snippet and source URL, and pass that evidence to your own agent for a cited answer.
20
 
21
- **Try this task:** Find official documentation about tool calling for an AI research assistant.
22
 
23
- [FlashData google search documentation](https://flashdata.dev/docs/sources/google_search?utm_source=hugging-face&utm_medium=integration&utm_campaign=intent_gtm_2026q4&utm_content=google-search-agent-flashdata) · [Create a FlashData account](https://flashdata.dev/signup)
24
 
25
- ## Run it
26
 
27
- Open the Space to edit a request and inspect a documentation response sample. The interactive page runs locally in your browser; it does not send a FlashData query or collect an API key. The Python tool runs in your own process.
28
 
29
- Use Python 3.10 or newer. Install the pinned dependencies:
 
 
30
 
31
  ```sh
32
  python -m pip install "smolagents==1.26.0" "langchain-flashdata==0.2.1"
33
  ```
34
 
35
- Create an API key in the FlashData console, fund the required credits, and supply the key in your local environment. Review `tool.py` before enabling remote code execution.
36
 
37
  ```python
38
  import getpass
@@ -45,39 +48,33 @@ result = tool(**{'gl': 'us', 'hl': 'en', 'num': 5, 'query': 'site:docs.langchain
45
  print(result)
46
  ```
47
 
48
- This is a native smolagents Tool with typed task inputs. Add the loaded tool to your own agent; model choice, prompts and model fees remain under your control. Direct calls above do not need a model.
49
 
50
  ## Inputs
51
 
52
- | Parameter | Type | Required / default | Details |
53
- | --- | --- | --- | --- |
54
- | `query` | string | Required | Search query, between 1 and 2,000 characters. |
55
- | `num` | integer | 10 | num minimum=1, maximum=100 |
56
- | `page` | integer | 1 | page minimum=1, maximum=100 |
57
- | `autocorrect` | boolean | True | autocorrect |
58
- | `gl` | string | None | Two-letter country code, for example us. pattern=^[A-Za-z]{2}$ |
59
- | `hl` | string | None | Interface language code, for example en. pattern=^[A-Za-z0-9-]{1,35}$ |
60
- | `location` | string | None | Optional geographic search location. |
61
- | `tbs` | string | None | Optional Google time filter, for example qdr:w. |
62
-
63
- Optional `None` values are omitted; the documented adapter defaults apply.
64
-
65
- Full validation rules are in `input-schema.json`.
66
-
67
- ## Output and next step
68
 
69
- The useful data is at `results.0.organic`. Relevant fields: `title`, `link`, `snippet`, `position`.
70
 
71
- Keep the link with every claim in the agent context. Fetch and check the original page separately when full text or a direct quotation is needed.
72
 
73
- The Space includes a recorded documentation example and its original request. It is not a fresh result for the task prompt above. Optional fields may be absent.
74
 
75
- ## Costs, limits and failures
76
 
77
- Returns search results and available SERP fields, not arbitrary webpage full text. This tool supplies evidence; an agent and model are configured separately.
78
 
79
- The script/tool is MIT licensed and free to install. **FlashData API calls are paid**; installation does not include free data queries. Check current [FlashData pricing](https://flashdata.dev/pricing) and your console balance. Platform, model and customer storage charges are separate. Each search/page is a separate request; Extended Search has its own rate. Downloads are charged by delivered data volume.
80
 
81
- An uncertain timeout can still represent a charged request. Check Jobs in the FlashData console before trying again; this integration does not automatically retry paid submissions. A 401 means the key was rejected, 402 means insufficient credits, and 429 means a rate or quota limit.
82
 
83
- [Get started with this FlashData capability](https://flashdata.dev/docs/sources/google_search?utm_source=hugging-face&utm_medium=integration&utm_campaign=intent_gtm_2026q4&utm_content=google-search-agent-flashdata)
 
1
  ---
2
+ title: "Google Search"
3
+ short_description: "Google results with titles, URLs, snippets and rankings."
4
+ emoji: "🔎"
5
+ colorFrom: "blue"
6
+ colorTo: "indigo"
7
+ sdk: "static"
8
+ app_file: "index.html"
9
  pinned: false
10
+ license: "mit"
11
  tags:
12
  - smolagents
13
  - tool
 
15
  - google-search
16
  ---
17
 
18
+ # Google Search
19
 
20
+ Search Google and return ranked titles, URLs, snippets and positions as JSON. Filter by country, language, location or date, and request additional pages.
21
 
22
+ [API documentation](https://flashdata.dev/docs/sources/google_search?utm_source=hugging-face&utm_medium=integration&utm_campaign=intent_gtm_2026q4&utm_content=google-search-agent-flashdata) · [Get an API key](https://flashdata.dev/app/api-keys) · [Pricing](https://flashdata.dev/pricing)
23
 
24
+ Requires your own FlashData API key and paid Credits. The Python tool is free to install.
25
 
26
+ ## Try the inputs
27
 
28
+ Edit the JSON in this Space, generate a Python call, and inspect the included sample response or paste your own JSON. This page runs locally in your browser; it does not run a data query or collect your API key.
29
 
30
+ ## Run with Python
31
+
32
+ Use Python 3.10 or newer:
33
 
34
  ```sh
35
  python -m pip install "smolagents==1.26.0" "langchain-flashdata==0.2.1"
36
  ```
37
 
38
+ Review [tool.py](tool.py) before enabling `trust_remote_code`. Run locally with your key:
39
 
40
  ```python
41
  import getpass
 
48
  print(result)
49
  ```
50
 
51
+ The same loaded tool can be used with smolagents. A direct Python call does not require a model.
52
 
53
  ## Inputs
54
 
55
+ | Parameter | Required / default | Details |
56
+ | --- | --- | --- |
57
+ | `query` | Required | Search query, between 1 and 2,000 characters. |
58
+ | `num` | 10 | num minimum=1, maximum=100 |
59
+ | `page` | 1 | page minimum=1, maximum=100 |
60
+ | `autocorrect` | True | autocorrect |
61
+ | `gl` | None | Two-letter country code, for example us. |
62
+ | `hl` | None | Interface language code, for example en. |
63
+ | `location` | None | Optional geographic search location. |
64
+ | `tbs` | None | Optional Google time filter, for example qdr:w. |
 
 
 
 
 
 
65
 
66
+ See [input-schema.json](input-schema.json) for full validation rules. Optional `None` values are omitted; adapter defaults apply.
67
 
68
+ ## Output
69
 
70
+ Read `results.0.organic`. Fields: `title`, `link`, `snippet`, `position`. Optional fields may be absent.
71
 
72
+ [example.json](example.json) contains a recorded response and its original request, not a new result for the input shown in the Space.
73
 
74
+ ## Limits and cost
75
 
76
+ Returns search results, not webpage full text.
77
 
78
+ Each data request uses FlashData Credits. Check [current pricing](https://flashdata.dev/pricing) before running. Any model or hosting charges are separate.
79
 
80
+ For an uncertain timeout, check your FlashData Jobs before retrying; this tool does not automatically retry paid submissions.
index.html CHANGED
@@ -3,18 +3,18 @@
3
  <head>
4
  <meta charset="UTF-8">
5
  <meta name="viewport" content="width=device-width,initial-scale=1">
6
- <title>FlashData research tool</title>
7
  <link rel="stylesheet" href="style.css">
8
  </head>
9
  <body>
10
  <main>
11
- <header><a href="https://flashdata.dev" class="brand" target="_blank" rel="noopener">FLASHDATA</a><span>Research tools for AI agents</span></header>
12
- <section class="intro"><p class="eyebrow">SMOLAGENTS TOOL · PYTHON</p><h1 id="title">Loading tool…</h1><p id="scenario"></p><a id="docs" class="cta" target="_blank" rel="noopener">Get an API key and read the docs ↗</a></section>
13
  <div class="grid">
14
  <section class="panel"><h2>Build a request</h2><p id="task"></p><label for="parameters">Tool inputs (JSON)</label><textarea id="parameters" spellcheck="false"></textarea><button id="generate" type="button">Generate Python call</button><p id="input-status" role="status"></p><pre><code id="python"></code></pre><p class="hint">Run this code in your Python environment. Your API key is entered there, not on this page.</p></section>
15
- <section class="panel"><h2>Inspect the response</h2><p class="hint">This is a recorded documentation sample, not a live response to the request on the left. You can paste your own response JSON to explore its fields.</p><details><summary>Original sample request</summary><pre id="sample-request"></pre></details><label for="response">Response JSON</label><textarea id="response" spellcheck="false"></textarea><button id="inspect" type="button">Inspect results</button><p id="response-status" role="status"></p><div id="results"></div></section>
16
  </div>
17
- <section class="panel next"><h2>Use the result</h2><p id="next"></p><h3>Limits and costs</h3><p id="limit"></p><p>The tool is free to install. <strong>FlashData API calls are paid.</strong> Platform, model and customer storage costs are separate. No API or model call is made by this page. <a href="https://flashdata.dev/pricing" target="_blank" rel="noopener">Check pricing ↗</a></p><p>For an uncertain timeout, check Jobs before retrying a paid submission. Download jobs must be read with their saved ID; do not submit again while pending.</p></section>
18
  <footer><a id="source" target="_blank" rel="noopener">Review tool.py</a><a id="readme" target="_blank" rel="noopener">Installation and input reference</a><span>MIT licensed integration · FlashData API terms apply separately</span></footer>
19
  </main>
20
  <script type="module" src="app.js"></script>
 
3
  <head>
4
  <meta charset="UTF-8">
5
  <meta name="viewport" content="width=device-width,initial-scale=1">
6
+ <title>Search and video data tools</title>
7
  <link rel="stylesheet" href="style.css">
8
  </head>
9
  <body>
10
  <main>
11
+ <header><a href="https://flashdata.dev" class="brand" target="_blank" rel="noopener">FLASHDATA</a><span>Search &amp; video data</span></header>
12
+ <section class="intro"><p class="eyebrow">PYTHON TOOL · REQUEST EXAMPLES</p><h1 id="title">Loading tool…</h1><p id="scenario"></p><a id="docs" class="cta" target="_blank" rel="noopener">API documentation &amp; setup ↗</a></section>
13
  <div class="grid">
14
  <section class="panel"><h2>Build a request</h2><p id="task"></p><label for="parameters">Tool inputs (JSON)</label><textarea id="parameters" spellcheck="false"></textarea><button id="generate" type="button">Generate Python call</button><p id="input-status" role="status"></p><pre><code id="python"></code></pre><p class="hint">Run this code in your Python environment. Your API key is entered there, not on this page.</p></section>
15
+ <section class="panel"><h2>Inspect the response</h2><p class="hint">View the included sample or paste your own response JSON. Editing the request does not run a query.</p><details><summary>Original sample request</summary><pre id="sample-request"></pre></details><label for="response">Response JSON</label><textarea id="response" spellcheck="false"></textarea><button id="inspect" type="button">Inspect results</button><p id="response-status" role="status"></p><div id="results"></div></section>
16
  </div>
17
+ <section class="panel next"><h2>Use the result</h2><p id="next"></p><h3>Limits and costs</h3><p id="limit"></p><p>Requires your FlashData API key. <strong>Data calls use paid Credits.</strong> This page only prepares code and displays JSON. <a href="https://flashdata.dev/pricing" target="_blank" rel="noopener">Check pricing ↗</a></p><p>Check FlashData Jobs before retrying a request that timed out.</p></section>
18
  <footer><a id="source" target="_blank" rel="noopener">Review tool.py</a><a id="readme" target="_blank" rel="noopener">Installation and input reference</a><span>MIT licensed integration · FlashData API terms apply separately</span></footer>
19
  </main>
20
  <script type="module" src="app.js"></script>
task.json CHANGED
@@ -1,8 +1,8 @@
1
  {
2
  "slug": "google-search-agent-flashdata",
3
- "title": "Google Search for AI agent research \u2014 FlashData",
4
- "scenario": "Give a research agent current web evidence before it answers a question. Search a focused question, keep each title, snippet and source URL, and pass that evidence to your own agent for a cited answer.",
5
- "task": "Find official documentation about tool calling for an AI research assistant.",
6
  "input": {
7
  "query": "site:docs.langchain.com tool calling",
8
  "num": 5,
@@ -16,8 +16,9 @@
16
  "snippet",
17
  "position"
18
  ],
19
- "next": "Keep the link with every claim in the agent context. Fetch and check the original page separately when full text or a direct quotation is needed.",
20
- "limit": "Returns search results and available SERP fields, not arbitrary webpage full text. This tool supplies evidence; an agent and model are configured separately.",
 
21
  "source": "google_search",
22
  "repo_id": "flashdata-dev/google-search-agent-flashdata"
23
  }
 
1
  {
2
  "slug": "google-search-agent-flashdata",
3
+ "title": "Google Search",
4
+ "scenario": "Search Google and return ranked titles, URLs, snippets and positions as JSON. Filter by country, language, location or date, and request additional pages.",
5
+ "task": "Try a query with a country and language filter.",
6
  "input": {
7
  "query": "site:docs.langchain.com tool calling",
8
  "num": 5,
 
16
  "snippet",
17
  "position"
18
  ],
19
+ "next": "Use results.0.organic to export titles, links, snippets and positions.",
20
+ "limit": "Returns search results, not webpage full text.",
21
+ "short_description": "Google results with titles, URLs, snippets and rankings.",
22
  "source": "google_search",
23
  "repo_id": "flashdata-dev/google-search-agent-flashdata"
24
  }
tool.py CHANGED
@@ -3,7 +3,7 @@ from smolagents import Tool
3
 
4
  class FlashDataTool(Tool):
5
  name = 'google_search'
6
- description = 'Give a research agent current web evidence before it answers a question. Search a focused question, keep each title, snippet and source URL, and pass that evidence to your own agent for a cited answer. Returns search results and available SERP fields, not arbitrary webpage full text. This tool supplies evidence; an agent and model are configured separately. Uses paid FlashData API credits. Never automatically retry an uncertain submission; check Jobs first.'
7
  inputs = {'autocorrect': {'description': 'Autocorrect. Default: True.', 'nullable': True, 'type': 'boolean'},
8
  'gl': {'description': 'Two-letter country code, for example us. pattern: ^[A-Za-z]{2}$. Default: '
9
  'None.',
 
3
 
4
  class FlashDataTool(Tool):
5
  name = 'google_search'
6
+ description = 'Search Google and return ranked titles, URLs, snippets and positions as JSON. Filter by country, language, location or date, and request additional pages. Returns search results, not webpage full text. Uses paid FlashData API credits. Never automatically retry an uncertain submission; check Jobs first.'
7
  inputs = {'autocorrect': {'description': 'Autocorrect. Default: True.', 'nullable': True, 'type': 'boolean'},
8
  'gl': {'description': 'Two-letter country code, for example us. pattern: ^[A-Za-z]{2}$. Default: '
9
  'None.',