diff options
Diffstat (limited to 'packages/tool-youtube-transcript')
4 files changed, 10 insertions, 18 deletions
diff --git a/packages/tool-youtube-transcript/src/format.test.ts b/packages/tool-youtube-transcript/src/format.test.ts index 00b5d05..7555318 100644 --- a/packages/tool-youtube-transcript/src/format.test.ts +++ b/packages/tool-youtube-transcript/src/format.test.ts @@ -57,7 +57,7 @@ describe("formatCompleted", () => { }); describe("formatQueued", () => { - it("returns status + position + estimated time + pending file instruction", () => { + it("returns status + position + estimated time", () => { const data: QueuedResponse = { status: "queued", video_id: "vid456", @@ -70,12 +70,11 @@ describe("formatQueued", () => { const expected = `Transcript not yet available (status: queued, queue position: 3).\n` + `Estimated available at: ${expectedTime} (in ~120s).\n` + - `You must append this video URL to .youtube_subtitles_pending in the current ` + - `working directory: https://youtu.be/vid456`; + `URL: https://youtu.be/vid456`; expect(out).toBe(expected); }); - it("includes the processing status + pending-file instruction", () => { + it("includes the processing status", () => { const data: QueuedResponse = { status: "processing", video_id: "vid457", @@ -86,7 +85,6 @@ describe("formatQueued", () => { expect(out).toContain("status: processing"); expect(out).toContain("queue position: 0"); expect(out).toContain("(in ~46s)"); - expect(out).toContain(".youtube_subtitles_pending"); expect(out).toContain("https://youtu.be/vid457"); }); }); diff --git a/packages/tool-youtube-transcript/src/format.ts b/packages/tool-youtube-transcript/src/format.ts index d445be0..8bb409b 100644 --- a/packages/tool-youtube-transcript/src/format.ts +++ b/packages/tool-youtube-transcript/src/format.ts @@ -78,9 +78,8 @@ export function formatCompleted(url: string, data: CompletedResponse): string { } /** - * Format a queued/processing response: status, queue position, the estimated - * available-at time (ISO, derived from the injected `now`), and the - * `.youtube_subtitles_pending` append instruction the model must follow. + * Format a queued/processing response: status, queue position, and the + * estimated available-at time (ISO, derived from the injected `now`). */ export function formatQueued(url: string, data: QueuedResponse, now: () => number): string { const availableAt = new Date(now() + data.estimated_seconds * 1000); @@ -88,8 +87,7 @@ export function formatQueued(url: string, data: QueuedResponse, now: () => numbe return ( `Transcript not yet available (status: ${data.status}, queue position: ${data.position}).\n` + `Estimated available at: ${timeStr} (in ~${Math.ceil(data.estimated_seconds)}s).\n` + - `You must append this video URL to .youtube_subtitles_pending in the current ` + - `working directory: ${url}` + `URL: ${url}` ); } diff --git a/packages/tool-youtube-transcript/src/tool.test.ts b/packages/tool-youtube-transcript/src/tool.test.ts index adf95ed..4fcb63e 100644 --- a/packages/tool-youtube-transcript/src/tool.test.ts +++ b/packages/tool-youtube-transcript/src/tool.test.ts @@ -41,7 +41,7 @@ describe("youtube_transcript", () => { expect(result.content).toContain("[0:00] Hello world."); }); - it("returns queued message with pending file instruction", async () => { + it("returns queued message with status and ETA", async () => { const client = makeStubClient(async () => ({ status: "queued", video_id: "vid2", @@ -54,7 +54,6 @@ describe("youtube_transcript", () => { expect(result.content).toContain("status: queued"); expect(result.content).toContain("queue position: 1"); expect(result.content).toContain("in ~30s"); - expect(result.content).toContain(".youtube_subtitles_pending"); expect(result.content).toContain("https://youtu.be/vid2"); }); diff --git a/packages/tool-youtube-transcript/src/tool.ts b/packages/tool-youtube-transcript/src/tool.ts index 03244d5..189e42c 100644 --- a/packages/tool-youtube-transcript/src/tool.ts +++ b/packages/tool-youtube-transcript/src/tool.ts @@ -29,12 +29,9 @@ const DESCRIPTION = "Fetch the transcript/subtitles for a YouTube video from the local transcriber " + "service. If the transcript has not been downloaded before, the video will be " + "queued for processing and the tool will return the estimated time when the " + - "transcript will be available. When the status is 'queued' or 'processing', " + - "you MUST append the video URL on a new line to the file .youtube_subtitles_pending " + - "in the current working directory (create it if it does not exist). Once " + - "available, the tool returns the full transcript text and timestamped " + - "segments. Accepted URL formats: youtube.com/watch?v=, youtu.be/, " + - "youtube.com/embed/, youtube.com/shorts/"; + "transcript will be available. Once available, the tool returns the full " + + "transcript text and timestamped segments. Accepted URL formats: " + + "youtube.com/watch?v=, youtu.be/, youtube.com/embed/, youtube.com/shorts/"; /** * Create the `youtube_transcript` tool. `concurrencySafe: true` — transcript |
