feat: Add web search results handling and enhance knowledge retrieval features
- Introduced a new endpoint to fetch chunks by ID, improving access to specific knowledge base entries. - Updated tool result types to include web search results, enhancing the display capabilities in the chat component. - Enhanced the AgentStreamDisplay component to support rendering web search results with improved HTML formatting. - Implemented logic for managing web search result summaries and citations, ensuring a cohesive user experience. - Refactored session management to accommodate new web search functionalities, improving overall system integration.
This commit is contained in:
@@ -232,19 +232,14 @@ func (t *WebSearchTool) Execute(ctx context.Context, args map[string]interface{}
|
||||
formattedResults = append(formattedResults, resultData)
|
||||
}
|
||||
|
||||
output += "=== Usage Guidelines ===\n"
|
||||
output += "- Use these results to answer questions about current information\n"
|
||||
output += "- Verify information from multiple sources when possible\n"
|
||||
output += "- Check the publication date to ensure information is current\n"
|
||||
output += "- Results are automatically compressed to extract relevant content\n"
|
||||
|
||||
return &types.ToolResult{
|
||||
Success: true,
|
||||
Output: output,
|
||||
Data: map[string]interface{}{
|
||||
"query": query,
|
||||
"results": formattedResults,
|
||||
"count": len(webResults),
|
||||
"query": query,
|
||||
"results": formattedResults,
|
||||
"count": len(webResults),
|
||||
"display_type": "web_search_results",
|
||||
},
|
||||
}, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user