Clarify capability names and simplify documentation
Browse files
README.md
CHANGED
|
@@ -1,12 +1,13 @@
|
|
| 1 |
---
|
| 2 |
-
title: "YouTube
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
|
|
|
| 8 |
pinned: false
|
| 9 |
-
license: mit
|
| 10 |
tags:
|
| 11 |
- smolagents
|
| 12 |
- tool
|
|
@@ -14,25 +15,27 @@ tags:
|
|
| 14 |
- youtube-transcript
|
| 15 |
---
|
| 16 |
|
| 17 |
-
# YouTube
|
| 18 |
|
| 19 |
-
|
| 20 |
|
| 21 |
-
|
| 22 |
|
| 23 |
-
|
| 24 |
|
| 25 |
-
##
|
| 26 |
|
| 27 |
-
|
| 28 |
|
| 29 |
-
|
|
|
|
|
|
|
| 30 |
|
| 31 |
```sh
|
| 32 |
python -m pip install "smolagents==1.26.0" "langchain-flashdata==0.2.1"
|
| 33 |
```
|
| 34 |
|
| 35 |
-
|
| 36 |
|
| 37 |
```python
|
| 38 |
import getpass
|
|
@@ -45,34 +48,28 @@ result = tool(**{'auto': True, 'language': 'en', 'video_id': 'FUfGcZ092b0'})
|
|
| 45 |
print(result)
|
| 46 |
```
|
| 47 |
|
| 48 |
-
|
| 49 |
|
| 50 |
## Inputs
|
| 51 |
|
| 52 |
-
| Parameter |
|
| 53 |
-
| --- | --- | --- |
|
| 54 |
-
| `video_id` |
|
| 55 |
-
| `language` |
|
| 56 |
-
| `auto` |
|
| 57 |
-
|
| 58 |
-
Optional `None` values are omitted; the documented adapter defaults apply.
|
| 59 |
-
|
| 60 |
-
Full validation rules are in `input-schema.json`.
|
| 61 |
-
|
| 62 |
-
## Output and next step
|
| 63 |
|
| 64 |
-
|
| 65 |
|
| 66 |
-
|
| 67 |
|
| 68 |
-
|
| 69 |
|
| 70 |
-
|
| 71 |
|
| 72 |
-
|
| 73 |
|
| 74 |
-
|
| 75 |
|
| 76 |
-
|
| 77 |
|
| 78 |
-
|
|
|
|
| 1 |
---
|
| 2 |
+
title: "YouTube Transcript"
|
| 3 |
+
short_description: "Existing YouTube transcript text with timestamps."
|
| 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 |
- youtube-transcript
|
| 16 |
---
|
| 17 |
|
| 18 |
+
# YouTube Transcript
|
| 19 |
|
| 20 |
+
Retrieve existing YouTube transcript text and timestamped segments by video ID and language. Automatic captions are selected by default.
|
| 21 |
|
| 22 |
+
[API documentation](https://flashdata.dev/docs/sources/youtube_transcript?utm_source=hugging-face&utm_medium=integration&utm_campaign=intent_gtm_2026q4&utm_content=youtube-transcript-research-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 |
+
| `video_id` | Required | 11-character YouTube video ID or a YouTube video URL. |
|
| 58 |
+
| `language` | 'en' | Requested caption language code. |
|
| 59 |
+
| `auto` | True | True requests automatic captions; false requests manually authored captions. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 60 |
|
| 61 |
+
See [input-schema.json](input-schema.json) for full validation rules. Optional `None` values are omitted; adapter defaults apply.
|
| 62 |
|
| 63 |
+
## Output
|
| 64 |
|
| 65 |
+
Read `results.0.segments`. Fields: `start`, `end`, `text`. Optional fields may be absent.
|
| 66 |
|
| 67 |
+
[example.json](example.json) contains a recorded response and its original request, not a new result for the input shown in the Space.
|
| 68 |
|
| 69 |
+
## Limits and cost
|
| 70 |
|
| 71 |
+
Defaults to existing English automatic captions. No speech recognition, translation or fallback to another track; unavailable tracks fail.
|
| 72 |
|
| 73 |
+
Each data request uses FlashData Credits. Check [current pricing](https://flashdata.dev/pricing) before running. Any model or hosting charges are separate.
|
| 74 |
|
| 75 |
+
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>
|
| 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>
|
| 12 |
-
<section class="intro"><p class="eyebrow">
|
| 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">
|
| 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>
|
| 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 & 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 & 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": "youtube-transcript-research-flashdata",
|
| 3 |
-
"title": "YouTube
|
| 4 |
-
"scenario": "
|
| 5 |
-
"task": "
|
| 6 |
"input": {
|
| 7 |
"video_id": "FUfGcZ092b0",
|
| 8 |
"language": "en",
|
|
@@ -14,8 +14,9 @@
|
|
| 14 |
"end",
|
| 15 |
"text"
|
| 16 |
],
|
| 17 |
-
"next": "
|
| 18 |
-
"limit": "Defaults to existing
|
|
|
|
| 19 |
"source": "youtube_transcript",
|
| 20 |
"repo_id": "flashdata-dev/youtube-transcript-research-flashdata"
|
| 21 |
}
|
|
|
|
| 1 |
{
|
| 2 |
"slug": "youtube-transcript-research-flashdata",
|
| 3 |
+
"title": "YouTube Transcript",
|
| 4 |
+
"scenario": "Retrieve existing YouTube transcript text and timestamped segments by video ID and language. Automatic captions are selected by default.",
|
| 5 |
+
"task": "Fetch an existing transcript for a video.",
|
| 6 |
"input": {
|
| 7 |
"video_id": "FUfGcZ092b0",
|
| 8 |
"language": "en",
|
|
|
|
| 14 |
"end",
|
| 15 |
"text"
|
| 16 |
],
|
| 17 |
+
"next": "Read results.0.segments for text with start and end timestamps.",
|
| 18 |
+
"limit": "Defaults to existing English automatic captions. No speech recognition, translation or fallback to another track; unavailable tracks fail.",
|
| 19 |
+
"short_description": "Existing YouTube transcript text with timestamps.",
|
| 20 |
"source": "youtube_transcript",
|
| 21 |
"repo_id": "flashdata-dev/youtube-transcript-research-flashdata"
|
| 22 |
}
|
tool.py
CHANGED
|
@@ -3,7 +3,7 @@ from smolagents import Tool
|
|
| 3 |
|
| 4 |
class FlashDataTool(Tool):
|
| 5 |
name = 'youtube_transcript'
|
| 6 |
-
description = '
|
| 7 |
inputs = {'auto': {'description': 'True requests automatic captions; false requests manually authored '
|
| 8 |
'captions. Default: True.',
|
| 9 |
'nullable': True,
|
|
|
|
| 3 |
|
| 4 |
class FlashDataTool(Tool):
|
| 5 |
name = 'youtube_transcript'
|
| 6 |
+
description = 'Retrieve existing YouTube transcript text and timestamped segments by video ID and language. Automatic captions are selected by default. Defaults to existing English automatic captions. No speech recognition, translation or fallback to another track; unavailable tracks fail. Uses paid FlashData API credits. Never automatically retry an uncertain submission; check Jobs first.'
|
| 7 |
inputs = {'auto': {'description': 'True requests automatic captions; false requests manually authored '
|
| 8 |
'captions. Default: True.',
|
| 9 |
'nullable': True,
|