flashdata-dev commited on
Commit
a97b9d8
·
verified ·
1 Parent(s): 69772fa

Publish google_videos tool and request guide

Browse files
Files changed (10) hide show
  1. LICENSE +21 -0
  2. README.md +77 -6
  3. app.js +75 -0
  4. example.json +154 -0
  5. index.html +20 -17
  6. input-schema.json +119 -0
  7. requirements.txt +2 -0
  8. style.css +1 -28
  9. task.json +22 -0
  10. tool.py +36 -0
LICENSE ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ MIT License
2
+
3
+ Copyright (c) 2026 FlashData contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
README.md CHANGED
@@ -1,12 +1,83 @@
1
  ---
2
- title: Google Video Research Flashdata
3
- emoji: 📈
4
- colorFrom: yellow
5
- colorTo: pink
6
  sdk: static
 
7
  pinned: false
8
  license: mit
9
- short_description: Google Videos cross-site research
 
 
 
 
10
  ---
11
 
12
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ title: "Google Videos cross-site 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
13
+ - flashdata
14
+ - google-videos
15
  ---
16
 
17
+ # Google Videos cross-site research — FlashData
18
+
19
+ Find useful video explainers across websites for a research assistant. Collect video page links and available durations and publishers before selecting sources for a learning plan.
20
+
21
+ **Try this task:** Find video explainers about retrieval augmented generation across websites.
22
+
23
+ [FlashData google videos documentation](https://flashdata.dev/docs/sources/google_videos?utm_source=hugging-face&utm_medium=integration&utm_campaign=intent_gtm_2026q4&utm_content=google-video-research-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
39
+ import os
40
+ from smolagents import load_tool
41
+
42
+ os.environ["FLASHDATA_API_KEY"] = getpass.getpass("FlashData API key: ")
43
+ tool = load_tool("flashdata-dev/google-video-research-flashdata", trust_remote_code=True)
44
+ result = tool(**{'num': 10, 'query': 'retrieval augmented generation explained'})
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 | None | Requested result count. minimum=1, maximum=100 |
56
+ | `page` | integer | None | Search result page. minimum=1, maximum=100 |
57
+ | `autocorrect` | boolean | None | Enable spelling autocorrection. |
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.videos`. Relevant fields: `title`, `link`, `duration`, `source`, `snippet`.
70
+
71
+ Review the linked video pages and keep their publishers in the learning plan. Retrieve transcripts through a separate supported capability when 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
+ This is Google Videos search across websites. It does not retrieve transcripts or download videos.
78
+
79
+ The tool is MIT licensed. It is 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_videos?utm_source=hugging-face&utm_medium=integration&utm_campaign=intent_gtm_2026q4&utm_content=google-video-research-flashdata)
app.js ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ const byId = id => document.getElementById(id);
2
+ const pythonLiteral = value => {
3
+ if (value === null) return 'None';
4
+ if (typeof value === 'boolean') return value ? 'True' : 'False';
5
+ if (Array.isArray(value)) return `[${value.map(pythonLiteral).join(', ')}]`;
6
+ if (typeof value === 'object') return `{${Object.entries(value).map(([k,v]) => `${JSON.stringify(k)}: ${pythonLiteral(v)}`).join(', ')}}`;
7
+ return JSON.stringify(value);
8
+ };
9
+
10
+ const [task, example, schema] = await Promise.all(['task.json','example.json','input-schema.json'].map(async file => {
11
+ const response = await fetch(file);
12
+ if (!response.ok) throw new Error(`Unable to load ${file}`);
13
+ return response.json();
14
+ }));
15
+
16
+ document.title = task.title;
17
+ for (const key of ['title','scenario','task','next','limit']) byId(key).textContent = task[key];
18
+ byId('docs').href = `https://flashdata.dev/docs/sources/${task.source}?utm_source=hugging-face&utm_medium=integration&utm_campaign=intent_gtm_2026q4&utm_content=${task.slug}`;
19
+ byId('source').href = `https://huggingface.co/spaces/${task.repo_id}/blob/main/tool.py`;
20
+ byId('readme').href = `https://huggingface.co/spaces/${task.repo_id}/blob/main/README.md`;
21
+ byId('parameters').value = JSON.stringify(task.input,null,2);
22
+ byId('response').value = JSON.stringify(example.response,null,2);
23
+ byId('sample-request').textContent = JSON.stringify(example.request,null,2);
24
+
25
+ function generate() {
26
+ try {
27
+ const args = JSON.parse(byId('parameters').value);
28
+ if (!args || Array.isArray(args) || typeof args !== 'object') throw new Error('Enter a JSON object.');
29
+ const allowed = task.source === 'youtube_download' ? ['operation','parameters','job_id'] : Object.keys(schema.properties);
30
+ if (Object.keys(args).some(key => !allowed.includes(key))) throw new Error('Use only the documented inputs; keep credentials in your local environment.');
31
+ const code = [
32
+ '# Install: python -m pip install smolagents==1.26.0 langchain-flashdata==0.2.1',
33
+ 'import getpass', 'import os', 'from smolagents import load_tool', '',
34
+ 'os.environ["FLASHDATA_API_KEY"] = getpass.getpass("FlashData API key: ")',
35
+ ...(task.source === 'youtube_download' && args.operation === 'submit' ? ['os.environ["FLASHDATA_DOWNLOAD_STORAGE"] = getpass.getpass("Customer storage JSON: ")'] : []),
36
+ `tool = load_tool(${JSON.stringify(task.repo_id)}, trust_remote_code=True)`,
37
+ `result = tool(**${pythonLiteral(args)})`, 'print(result)'
38
+ ];
39
+ byId('python').textContent = code.join('\n');
40
+ byId('input-status').textContent = 'Python call generated. The tool validates full parameter constraints before a request.';
41
+ } catch (error) {
42
+ byId('python').textContent = '';
43
+ byId('input-status').textContent = error.message;
44
+ }
45
+ }
46
+
47
+ function inspect() {
48
+ byId('results').replaceChildren();
49
+ try {
50
+ const response = JSON.parse(byId('response').value);
51
+ const selected = task.path.split('.').reduce((value, key) => value?.[key], response);
52
+ if (selected === undefined || selected === null) throw new Error(`No value at ${task.path}. Check the response format; failed or pending requests may have different fields.`);
53
+ const rows = Array.isArray(selected) ? selected : [selected];
54
+ byId('response-status').textContent = `${rows.length} item(s) at ${task.path}. Showing up to 10.`;
55
+ for (const row of rows.slice(0,10)) {
56
+ const card = document.createElement('div'); card.className = 'result';
57
+ const fields = typeof row === 'object' && row !== null ? task.fields.filter(key => Object.hasOwn(row,key)) : [];
58
+ if (!fields.length) { const p=document.createElement('p'); p.className='field'; p.textContent=typeof row === 'string' ? row : JSON.stringify(row); card.append(p); }
59
+ for (const key of fields) {
60
+ const line=document.createElement('p'); line.className='field';
61
+ const label=document.createElement('b'); label.textContent=key+': '; line.append(label);
62
+ const value=row[key];
63
+ if (typeof value === 'string' && /^https?:\/\//.test(value)) {
64
+ const link=document.createElement('a'); link.href=value; link.textContent=value; link.target='_blank'; link.rel='noopener noreferrer'; line.append(link);
65
+ } else line.append(document.createTextNode(typeof value === 'object' ? JSON.stringify(value) : String(value)));
66
+ card.append(line);
67
+ }
68
+ byId('results').append(card);
69
+ }
70
+ } catch (error) { byId('response-status').textContent=error.message; }
71
+ }
72
+
73
+ byId('generate').addEventListener('click',generate);
74
+ byId('inspect').addEventListener('click',inspect);
75
+ generate(); inspect();
example.json ADDED
@@ -0,0 +1,154 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "request": {
3
+ "source": "google_videos",
4
+ "query": "me at the zoo",
5
+ "params": {
6
+ "gl": "us",
7
+ "hl": "en",
8
+ "num": 10,
9
+ "page": 1
10
+ }
11
+ },
12
+ "response": {
13
+ "source": "google_videos",
14
+ "status": "done",
15
+ "results": [
16
+ {
17
+ "searchParameters": {
18
+ "q": "me at the zoo",
19
+ "gl": "us",
20
+ "hl": "en",
21
+ "type": "videos",
22
+ "num": 10,
23
+ "page": 1,
24
+ "engine": "google"
25
+ },
26
+ "videos": [
27
+ {
28
+ "title": "Me at the zoo",
29
+ "link": "https://www.youtube.com/watch?v=jNQXAC9IVRw&vl=en",
30
+ "snippet": "Microplastics are accumulating in human brains at an alarming rate https://www.youtube.com/watch?v=0PT5c1z3LL8 \u201cNanoplastics and Human ...",
31
+ "imageUrl": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTNoybJBMfqr7vwH-saySvflZreMzBKZDBjW_zQMrY81E-xQZBBMzVuRw&s",
32
+ "videoUrl": "https://encrypted-vtbn0.gstatic.com/video?q=tbn:ANd9GcS8uZHJMduuLjzsxqOtyhx8VWeRlui2Fo0sUg",
33
+ "duration": "0:19",
34
+ "source": "YouTube",
35
+ "channel": "jawed",
36
+ "date": "Apr 23, 2005",
37
+ "position": 1
38
+ },
39
+ {
40
+ "title": "Me at the zoo - 20 Years Later",
41
+ "link": "https://www.youtube.com/watch?v=ydEMNzksm2M",
42
+ "snippet": "A FAN RECREATION. same location. same outfit kinda sorta. different guy. 20 years later @jawed New video: https://youtu.be/vRgvdCkzvws How ...",
43
+ "imageUrl": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcR8mNQG1XbHxQwXcM0_B0L3wpgVPSmORnijKhh5knB2aRxvmApdoyigXw&s",
44
+ "videoUrl": "https://encrypted-vtbn0.gstatic.com/video?q=tbn:ANd9GcR1ZyuOVJiBgaK96Ew85Bx19aYKLXddf-dcDQ",
45
+ "duration": "0:45",
46
+ "source": "YouTube",
47
+ "channel": "Cody Hales",
48
+ "date": "Apr 23, 2025",
49
+ "position": 2
50
+ },
51
+ {
52
+ "title": "Me at the zoo",
53
+ "link": "https://youtube.com/watch?v=jNQXAC9IVRw&si=EnSIkaIECMiOmarE",
54
+ "snippet": "Microplastics are accumulating in human brains at an alarming rate https://www.youtube.com/watch?v=0PT5c1z3LL8 \u201cNanoplastics and Human ...",
55
+ "imageUrl": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTNoybJBMfqr7vwH-saySvflZreMzBKZDBjW_zQMrY81E-xQZBBMzVuRw&s",
56
+ "videoUrl": "https://encrypted-vtbn0.gstatic.com/video?q=tbn:ANd9GcS8uZHJMduuLjzsxqOtyhx8VWeRlui2Fo0sUg",
57
+ "duration": "0:19",
58
+ "source": "YouTube",
59
+ "channel": "jawed",
60
+ "date": "Apr 23, 2005",
61
+ "position": 3
62
+ },
63
+ {
64
+ "title": "Me at the Zoo 21 Years Later",
65
+ "link": "https://www.youtube.com/watch?v=NiIqMwDDPQQ",
66
+ "snippet": "YouTube's First Video: Me at the zoo by Jawed Karim in 2005 A Look back some history of Youtube's creation and what happened to the ...",
67
+ "imageUrl": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSELgaIiAXmIin2tym4YpTtUt3a9LT66r3qpMkg3Cm2erBOcUc_cOzfxQ&s",
68
+ "videoUrl": "https://encrypted-vtbn0.gstatic.com/video?q=tbn:ANd9GcRSNKT2ukHk51PE2iHMpOXn0Fk-NYYzcjdtzg",
69
+ "duration": "2:37",
70
+ "source": "YouTube",
71
+ "channel": "AcidGlow",
72
+ "date": "Apr 26, 2026",
73
+ "position": 4
74
+ },
75
+ {
76
+ "title": "Me at the Zoo | 20 years of YouTube",
77
+ "link": "https://www.youtube.com/watch?v=SKcXEYqsX1M",
78
+ "snippet": "20 years ago, the first video was uploaded to YouTube, by Jawed. This is my remake of that first video uploaded to YouTube back on 23rd ...",
79
+ "imageUrl": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRYk6-MZVYhxJohW4sXDVRGWjqp796KjEJgWqKeZtfQAhCtMkyiVfVVjQ&s",
80
+ "videoUrl": "https://encrypted-vtbn0.gstatic.com/video?q=tbn:ANd9GcSPcbOknGe09bBsfDEZ8OJXxOnYAFxeiMzRIg",
81
+ "duration": "1:40",
82
+ "source": "YouTube",
83
+ "channel": "Alice Goss Travel",
84
+ "date": "Apr 22, 2025",
85
+ "position": 5
86
+ },
87
+ {
88
+ "title": "happy 20th birthday YouTube! on this day, 2005, the first ever ...",
89
+ "link": "https://www.facebook.com/lestwinsforsmartpeople/videos/happy-20th-birthday-youtube-on-this-day-2005-the-first-ever-video-was-uploaded-t/1174885864134048/",
90
+ "snippet": "\u2764 on this day, 2005, the first ever video was uploaded to YouTube: \"Me at the Zoo\" by Jawed Karim, one of the founders of YouTube. I opened my ...",
91
+ "imageUrl": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQXK7QFFc7Ve5rxWu28XVD7PwN4wMGxFwBGODfb0inSiJkJXkLfspNBBQ&s",
92
+ "videoUrl": "https://encrypted-vtbn0.gstatic.com/video?q=tbn:ANd9GcQwaWPOAa18cvUeFQmJ83tHI75KwkZZXhcz1g",
93
+ "duration": "0:20",
94
+ "source": "Facebook",
95
+ "channel": "Les Twins for smart people",
96
+ "date": "Apr 23, 2025",
97
+ "position": 6
98
+ },
99
+ {
100
+ "title": "23rd April 2005: The first video uploaded to YouTube is \"Me at ...",
101
+ "link": "https://www.youtube.com/watch?v=nW0JMJUW394&vl=en",
102
+ "snippet": "... Me at the zoo\u201d shows Karim speaking in front of the elephant enclosure at the San Diego Zoo in San Diego, California. The video lasts ...",
103
+ "imageUrl": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQKL5tOeVLTkPnKgGJ-irZeBKXegrS3jv3aOmqfPRvnDnFDH0wlm6KTsQ&s",
104
+ "videoUrl": "https://encrypted-vtbn0.gstatic.com/video?q=tbn:ANd9GcT32pM4ScwLqW8pW44XEj6g02KCXVGZZU12oA",
105
+ "duration": "2:30",
106
+ "source": "YouTube",
107
+ "channel": "HistoryPod",
108
+ "date": "Apr 22, 2026",
109
+ "position": 7
110
+ },
111
+ {
112
+ "title": "Me at the zoo",
113
+ "link": "https://www.youtube.com/shorts/bXz16dux7j0",
114
+ "snippet": "Maybe it's time to go back to the zoo?",
115
+ "imageUrl": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTKNATyMcisc3lfWovvV89H6Pgk2EMqkA4wPBgN3hwB2D9r4c0vzj9qog&s",
116
+ "videoUrl": "https://encrypted-vtbn0.gstatic.com/video?q=tbn:ANd9GcRo2eKznhm-_ijvAmb_52BgREvjyQVWcJ5arQ",
117
+ "duration": "0:17",
118
+ "source": "YouTube",
119
+ "channel": "Timeworks",
120
+ "date": "Apr 23, 2025",
121
+ "position": 8
122
+ },
123
+ {
124
+ "title": "Me At The Zoo",
125
+ "link": "https://www.youtube.com/watch?v=SfSsDBEs1yc",
126
+ "snippet": "Me At The Zoo \u2022 20th Anniversary (24/04/2025) a huge shoutout to 'Me at the zoo' today as it becomes the first video on @YouTube to be 20 ...",
127
+ "imageUrl": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQ6BBRlx150FgR3w89enIZwuSIm7gumK0O-yC7GqO_KF0zr8ZIGuNANHA&s",
128
+ "videoUrl": "https://encrypted-vtbn0.gstatic.com/video?q=tbn:ANd9GcSG5JQlJ3MiAYkmoTPoE-KLNrrS6rkWyAkJWw",
129
+ "duration": "0:26",
130
+ "source": "YouTube",
131
+ "channel": "MrHaydnSir",
132
+ "date": "Apr 24, 2025",
133
+ "position": 9
134
+ },
135
+ {
136
+ "title": "The first ever YouTube video, \"Me at the zoo\", turns 21 years ...",
137
+ "link": "https://www.reddit.com/r/interesting/comments/1su0btj/the_first_ever_youtube_video_me_at_the_zoo_turns/",
138
+ "snippet": "The first ever YouTube video, \"Me at the zoo\", turns 21 years old today. ... This video cannot be played. 0:00 0: ...",
139
+ "imageUrl": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcR2us_fh54LqB7h_F3viDdnV4PCbByjapkYj5JO8I6SoErU3NPFrY5tYw&s",
140
+ "duration": "0:18",
141
+ "source": "Reddit",
142
+ "channel": "Deleted User",
143
+ "date": "Apr 24, 2026",
144
+ "position": 10
145
+ }
146
+ ]
147
+ }
148
+ ],
149
+ "usage": {
150
+ "credits": 0.02
151
+ },
152
+ "created_at": "2026-09-16T07:41:45.419Z"
153
+ }
154
+ }
index.html CHANGED
@@ -1,19 +1,22 @@
1
  <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
 
 
 
19
  </html>
 
1
  <!doctype html>
2
+ <html lang="en">
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">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">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">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">Review tool.py</a><a id="readme">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>
21
+ </body>
22
  </html>
input-schema.json ADDED
@@ -0,0 +1,119 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "additionalProperties": false,
3
+ "description": "Google source parameters; omitted settings use provider behavior.",
4
+ "properties": {
5
+ "query": {
6
+ "description": "Search query, between 1 and 2,000 characters.",
7
+ "maxLength": 2000,
8
+ "minLength": 1,
9
+ "title": "Query",
10
+ "type": "string"
11
+ },
12
+ "num": {
13
+ "anyOf": [
14
+ {
15
+ "maximum": 100,
16
+ "minimum": 1,
17
+ "type": "integer"
18
+ },
19
+ {
20
+ "type": "null"
21
+ }
22
+ ],
23
+ "default": null,
24
+ "description": "Requested result count.",
25
+ "title": "Num"
26
+ },
27
+ "page": {
28
+ "anyOf": [
29
+ {
30
+ "maximum": 100,
31
+ "minimum": 1,
32
+ "type": "integer"
33
+ },
34
+ {
35
+ "type": "null"
36
+ }
37
+ ],
38
+ "default": null,
39
+ "description": "Search result page.",
40
+ "title": "Page"
41
+ },
42
+ "autocorrect": {
43
+ "anyOf": [
44
+ {
45
+ "type": "boolean"
46
+ },
47
+ {
48
+ "type": "null"
49
+ }
50
+ ],
51
+ "default": null,
52
+ "description": "Enable spelling autocorrection.",
53
+ "title": "Autocorrect"
54
+ },
55
+ "gl": {
56
+ "anyOf": [
57
+ {
58
+ "pattern": "^[A-Za-z]{2}$",
59
+ "type": "string"
60
+ },
61
+ {
62
+ "type": "null"
63
+ }
64
+ ],
65
+ "default": null,
66
+ "description": "Two-letter country code, for example us.",
67
+ "title": "Gl"
68
+ },
69
+ "hl": {
70
+ "anyOf": [
71
+ {
72
+ "pattern": "^[A-Za-z0-9-]{1,35}$",
73
+ "type": "string"
74
+ },
75
+ {
76
+ "type": "null"
77
+ }
78
+ ],
79
+ "default": null,
80
+ "description": "Interface language code, for example en.",
81
+ "title": "Hl"
82
+ },
83
+ "location": {
84
+ "anyOf": [
85
+ {
86
+ "maxLength": 200,
87
+ "minLength": 1,
88
+ "type": "string"
89
+ },
90
+ {
91
+ "type": "null"
92
+ }
93
+ ],
94
+ "default": null,
95
+ "description": "Optional geographic search location.",
96
+ "title": "Location"
97
+ },
98
+ "tbs": {
99
+ "anyOf": [
100
+ {
101
+ "maxLength": 200,
102
+ "minLength": 1,
103
+ "type": "string"
104
+ },
105
+ {
106
+ "type": "null"
107
+ }
108
+ ],
109
+ "default": null,
110
+ "description": "Optional Google time filter, for example qdr:w.",
111
+ "title": "Tbs"
112
+ }
113
+ },
114
+ "required": [
115
+ "query"
116
+ ],
117
+ "title": "GoogleInput",
118
+ "type": "object"
119
+ }
requirements.txt ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ smolagents==1.26.0
2
+ langchain-flashdata==0.2.1
style.css CHANGED
@@ -1,28 +1 @@
1
- body {
2
- padding: 2rem;
3
- font-family: -apple-system, BlinkMacSystemFont, "Arial", sans-serif;
4
- }
5
-
6
- h1 {
7
- font-size: 16px;
8
- margin-top: 0;
9
- }
10
-
11
- p {
12
- color: rgb(107, 114, 128);
13
- font-size: 15px;
14
- margin-bottom: 10px;
15
- margin-top: 5px;
16
- }
17
-
18
- .card {
19
- max-width: 620px;
20
- margin: 0 auto;
21
- padding: 16px;
22
- border: 1px solid lightgray;
23
- border-radius: 16px;
24
- }
25
-
26
- .card p:last-child {
27
- margin-bottom: 0;
28
- }
 
1
+ :root{color-scheme:light;font-family:Inter,ui-sans-serif,system-ui,-apple-system,sans-serif;color:#14243b;background:#f4f7fb;font-synthesis:none}*{box-sizing:border-box}body{margin:0}main{max-width:1240px;margin:auto;padding:32px}a{color:#175bc1;text-underline-offset:3px}header{display:flex;align-items:center;gap:24px;border-bottom:1px solid #dce3ed;padding-bottom:24px;color:#64748b;font-size:14px}.brand{font-size:21px;letter-spacing:.1em;font-weight:850;text-decoration:none;color:#123364}.intro{max-width:900px;padding:52px 0 38px}.eyebrow{font-size:12px;letter-spacing:.13em;font-weight:750;color:#4977aa}h1{font-size:clamp(28px,4vw,46px);line-height:1.12;letter-spacing:-.035em;margin:18px 0}h2{font-size:22px;margin:0 0 14px}h3{font-size:17px;margin:28px 0 8px}p{line-height:1.65}.intro>p:not(.eyebrow){font-size:18px;color:#4d6077}.cta{display:inline-block;background:#164f9b;color:white;padding:12px 18px;border-radius:7px;text-decoration:none;font-weight:600;margin-top:12px}.grid{display:grid;grid-template-columns:1fr 1fr;gap:22px}.panel{background:#fff;border:1px solid #dce3ed;border-radius:12px;padding:26px;min-width:0;box-shadow:0 5px 20px #12336405}.hint{color:#61738b;font-size:13px}label{display:block;font-size:13px;font-weight:650;margin:20px 0 8px}textarea{display:block;width:100%;height:190px;resize:vertical;border:1px solid #cbd6e6;border-radius:7px;padding:13px;font:13px/1.55 ui-monospace,SFMono-Regular,monospace;color:#253c58;background:#fbfcff}button{margin-top:12px;border:1px solid #b5c9e4;border-radius:7px;background:#edf4ff;color:#164f9b;padding:10px 15px;cursor:pointer;font:600 14px inherit}button:hover{background:#dfecff}pre{white-space:pre-wrap;overflow-wrap:anywhere;background:#f4f7fb;padding:15px;border-radius:7px;font:12px/1.6 ui-monospace,SFMono-Regular,monospace}details{font-size:13px}summary{cursor:pointer;color:#175bc1}.result{padding:14px 0;border-bottom:1px solid #e5ebf3}.result:first-child{padding-top:0}.field{font-size:13px;line-height:1.6;overflow-wrap:anywhere;margin:4px 0}.field b{color:#62758b;font-weight:500}.next{margin-top:22px}footer{display:flex;flex-wrap:wrap;gap:20px;padding:25px 0;color:#718096;font-size:12px}[role=status]{font-size:13px;color:#536b88}:focus-visible{outline:3px solid #7ea9ee;outline-offset:3px}@media(max-width:800px){main{padding:20px}.grid{grid-template-columns:1fr}.intro{padding-top:30px}header{flex-wrap:wrap;gap:8px}.panel{padding:20px}h1{font-size:32px}}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
task.json ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "slug": "google-video-research-flashdata",
3
+ "title": "Google Videos cross-site research \u2014 FlashData",
4
+ "scenario": "Find useful video explainers across websites for a research assistant. Collect video page links and available durations and publishers before selecting sources for a learning plan.",
5
+ "task": "Find video explainers about retrieval augmented generation across websites.",
6
+ "input": {
7
+ "query": "retrieval augmented generation explained",
8
+ "num": 10
9
+ },
10
+ "path": "results.0.videos",
11
+ "fields": [
12
+ "title",
13
+ "link",
14
+ "duration",
15
+ "source",
16
+ "snippet"
17
+ ],
18
+ "next": "Review the linked video pages and keep their publishers in the learning plan. Retrieve transcripts through a separate supported capability when needed.",
19
+ "limit": "This is Google Videos search across websites. It does not retrieve transcripts or download videos.",
20
+ "source": "google_videos",
21
+ "repo_id": "flashdata-dev/google-video-research-flashdata"
22
+ }
tool.py ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from smolagents import Tool
2
+
3
+
4
+ class FlashDataTool(Tool):
5
+ name = 'google_videos'
6
+ description = 'Find useful video explainers across websites for a research assistant. Collect video page links and available durations and publishers before selecting sources for a learning plan. This is Google Videos search across websites. It does not retrieve transcripts or download videos. Uses paid FlashData API credits. Never automatically retry an uncertain submission; check Jobs first.'
7
+ inputs = {'autocorrect': {'description': 'Enable spelling autocorrection. Default: None.',
8
+ 'nullable': True,
9
+ 'type': 'boolean'},
10
+ 'gl': {'description': 'Two-letter country code, for example us. pattern: ^[A-Za-z]{2}$. Default: '
11
+ 'None.',
12
+ 'nullable': True,
13
+ 'type': 'string'},
14
+ 'hl': {'description': 'Interface language code, for example en. pattern: ^[A-Za-z0-9-]{1,35}$. '
15
+ 'Default: None.',
16
+ 'nullable': True,
17
+ 'type': 'string'},
18
+ 'location': {'description': 'Optional geographic search location. Default: None.',
19
+ 'nullable': True,
20
+ 'type': 'string'},
21
+ 'num': {'description': 'Requested result count. minimum: 1. maximum: 100. Default: None.',
22
+ 'nullable': True,
23
+ 'type': 'integer'},
24
+ 'page': {'description': 'Search result page. minimum: 1. maximum: 100. Default: None.',
25
+ 'nullable': True,
26
+ 'type': 'integer'},
27
+ 'query': {'description': 'Search query, between 1 and 2,000 characters.', 'type': 'string'},
28
+ 'tbs': {'description': 'Optional Google time filter, for example qdr:w. Default: None.',
29
+ 'nullable': True,
30
+ 'type': 'string'}}
31
+ output_type = 'object'
32
+
33
+ def forward(self, query: str, num: int | None = None, page: int | None = None, autocorrect: bool | None = None, gl: str | None = None, hl: str | None = None, location: str | None = None, tbs: str | None = None) -> dict:
34
+ from langchain_flashdata import FlashDataGoogleVideos
35
+ values = {'query': query, 'num': num, 'page': page, 'autocorrect': autocorrect, 'gl': gl, 'hl': hl, 'location': location, 'tbs': tbs}
36
+ return FlashDataGoogleVideos().invoke({key: value for key, value in values.items() if value is not None})