summarize
marvin.fns.summarize
Constants
PROMPT
Functions
summarize
Creates a summary of the input data using a language model.
This function uses a language model to analyze the input data and create a concise summary that captures the key information and semantic meaning.
Args: data: The input data to summarize. Can be any type. instructions: Optional additional instructions to guide the summarization. Used to provide specific guidance about what aspects to focus on or how to structure the summary. agent: Optional custom agent to use for summarization. If not provided, the default agent will be used. thread: Optional thread for maintaining conversation context. Can be either a Thread object or a string thread ID. context: Optional dictionary of additional context to include in the task.
Returns: A string containing the generated summary.
Examples:
Basic summarization
summarize(“Long article about climate change…”) ‘Key findings on climate impacts…’
Summarize with specific instructions
summarize(“Technical documentation…”, instructions=“Focus on API changes”) ‘Major API updates include…’
summarize_async
Asynchronously creates a summary of the input data using a language model.
This function uses a language model to analyze the input data and create a concise summary that captures the key information and semantic meaning.
Args: data: The input data to summarize. Can be any type. instructions: Optional additional instructions to guide the summarization. Used to provide specific guidance about what aspects to focus on or how to structure the summary. agent: Optional custom agent to use for summarization. If not provided, the default agent will be used. thread: Optional thread for maintaining conversation context. Can be either a Thread object or a string thread ID. context: Optional dictionary of additional context to include in the task.
Returns: A string containing the generated summary.
Examples:
Basic summarization
await summarize_async(“Long article about climate change…”) ‘Key findings on climate impacts…’
Summarize with specific instructions
await summarize_async(“Technical documentation…”, instructions=“Focus on API changes”) ‘Major API updates include…’
Parent Module: fns