Generate text from video
The resources.Generate
class provides methods to generate various types of text content from videos.
Titles, topics, and hashtags
Description: This method generates titles, topics, and hashtags for a specific video. It uses predefined formats and doesn’t require a custom prompt, and it’s best for generating immediate and straightforward text representations without specific customization.
Function signature and example:
Parameters:
Return value: Returns a models.GenerateGistResult
object containing the generated gist elements.
API Reference: For a description of each field in the request and response, see the Generate topics, titles, and hashtags page.
Related guide: Titles, topics, and hashtags.
Summaries, chapters, and highlights
Description: This method generates summaries, chapters, or highlights for your videos. Optionally, you can provide a prompt to customize the output.
Function signature and example:
Parameters:
Return value: Returns a models.GenerateSummarizeResult
object containing the generated content.
API Reference: For a description of each field in the request and response, see the Generate summaries, chapters, and highlights page.
Related guide: Summaries, chapters, and highlights.
Open-ended text
Description: This method generates open-ended texts based on your videos.
Function signature and example:
Parameters:
Return value: Returns a models.GenerateOpenEndedTextResult
object containing the generated text.
API Reference: For a description of each field in the request and response, see the Open-ended text page.
Related guide: Open-ended text .
Open-ended text with streaming responses
Description: This method generates open-ended texts and supports streaming responses.
Function signature and example:
Parameters:
Return value: Returns a models.GenerateOpenEndedTextStreamResult
object.
API Reference: For a description of each field in the request and response, see the Open-ended text page.
Related guide: Streaming responses .