tooluniverse.compose_scripts.output_summarizer module¶
Output Summarization Composer Script
This script handles the intelligent summarization of tool outputs by: 1. Chunking large outputs into manageable pieces 2. Processing each chunk with AI-powered summarization 3. Merging the summarized chunks into a coherent final summary
The script leverages ToolUniverse’s AgenticTool infrastructure to provide intelligent, context-aware summarization that focuses on information relevant to the original query.
- tooluniverse.compose_scripts.output_summarizer.compose(arguments, tooluniverse, call_tool)[source]¶
Main composition function for output summarization.
This function orchestrates the complete summarization workflow: - Chunks the input text into manageable pieces - Summarizes each chunk using AI - Merges the summaries into a final coherent result
- Parameters:
arguments (
Dict[str, Any]
) –Dictionary containing: - tool_output (str): The original tool output to be summarized - query_context (str): Context about the original query - tool_name (str): Name of the tool that generated the output - chunk_size (int, optional): Size of each chunk for processing - focus_areas (str, optional): Areas to focus on in summarization - max_summary_length (int, optional): Maximum length of final
summary
tooluniverse – ToolUniverse instance for tool execution
call_tool – Function to call other tools within the composition
- Returns:
- Dictionary containing:
success (bool): Whether summarization was successful
original_length (int): Length of original output
summary_length (int): Length of final summary
chunks_processed (int): Number of chunks processed
summary (str): The summarized output
tool_name (str): Name of the original tool
error (str, optional): Error message if summarization failed
- Return type:
Dict[str, Any]