Skip to content

Commit

Permalink
- improve: youtube transcript description (#37)
Browse files Browse the repository at this point in the history
* - improve: descriptions for youtube transcript

* - improve: description, reduced verbosity

* - cicd: bump version
  • Loading branch information
agallardol authored Sep 5, 2024
1 parent 5f46dfd commit 7c545f2
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 16 deletions.
64 changes: 51 additions & 13 deletions apps/shinkai-tool-youtube-transcript/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,27 +16,42 @@ type Result = { transcript: TranscriptResponse[]; message: string };
export class Tool extends BaseTool<Config, Params, Result> {
definition: ToolDefinition<Config, Params, Result> = {
id: 'shinkai-tool-youtube-transcript',
name: 'Shinkai: YouTube Transcript',
description: 'Retrieve the transcript of a YouTube video',
name: 'Shinkai: YouTube Transcript and Summary',
description:
'Extracts and summarizes YouTube video content without watching. Provides a transcript and summary with organized sections and clickable timestamp links. Useful for quickly grasping main points, preparing for discussions, or efficient research. Example uses: summarizing tech talks, product reviews, or educational lectures. Parameters: url (string) - The full YouTube video URL to process.',
author: 'Shinkai',
keywords: ['youtube', 'transcript', 'video', 'captions', 'subtitles'],
keywords: [
'youtube',
'transcript',
'video',
'summary',
'sections',
'timestamp',
'links',
],
configurations: {
type: 'object',
properties: {
apiUrl: {
type: 'string',
description: 'The OpenAI api compatible URL',
description:
'The URL of the OpenAI compatible API endpoint for summary generation. Optional. Default: "http://127.0.0.1:11435".',
nullable: true,
example: 'https://api.openai.com/v1',
},
apiKey: {
type: 'string',
description: 'Api Key to call OpenAI compatible endpoint',
description:
'The API key for the OpenAI compatible endpoint. Required if using a service that needs authentication.',
nullable: true,
example: 'sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
},
model: {
type: 'string',
description: 'The model to use for generating the summary',
description:
'The name of the language model for summary generation. Optional. Default: "llama3.1:8b-instruct-q4_1".',
nullable: true,
example: 'gpt-3.5-turbo',
},
},
required: [],
Expand All @@ -46,7 +61,9 @@ export class Tool extends BaseTool<Config, Params, Result> {
properties: {
url: {
type: 'string',
description: 'The URL of the YouTube video to transcribe',
description:
'The full URL of the YouTube video to transcribe and summarize. Must be a valid and accessible YouTube video link.',
example: 'https://www.youtube.com/watch?v=dQw4w9WgXcQ',
},
},
required: ['url'],
Expand All @@ -56,20 +73,41 @@ export class Tool extends BaseTool<Config, Params, Result> {
properties: {
transcript: {
type: 'array',
description:
'An array of transcript segments from the video, providing a detailed text representation of the audio content.',
items: {
type: 'object',
properties: {
text: { type: 'string' },
duration: { type: 'number' },
offset: { type: 'number' },
lang: { type: 'string', nullable: true },
text: {
type: 'string',
description:
'The text content of a specific transcript segment.',
},
duration: {
type: 'number',
description: 'The duration of the segment in seconds.',
},
offset: {
type: 'number',
description:
'The start time of the segment in seconds from the beginning of the video.',
},
lang: {
type: 'string',
nullable: true,
description: 'The language code of the segment, if available.',
},
},
required: ['text', 'duration', 'offset'],
},
},
message: { type: 'string' },
message: {
type: 'string',
description:
'A markdown-formatted summary of the video content, divided into sections with timestamp links to relevant parts of the video.',
},
},
required: ['transcript'],
required: ['transcript', 'message'],
},
};

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@shinkai_protocol/source",
"version": "0.7.8",
"version": "0.7.9",
"description": "This repository serves as the ecosystem to execute Shinkai tools, provided by the Shinkai team or third-party developers, in a secure environment. It provides a sandboxed space for executing these tools, ensuring that they run safely and efficiently, while also allowing for seamless integration with Rust code.",
"main": "index.js",
"author": "",
Expand Down

0 comments on commit 7c545f2

Please sign in to comment.