From 8dcb78fc3793f48ddf70b4a61d9d892cb712bc91 Mon Sep 17 00:00:00 2001 From: Max Date: Fri, 19 Dec 2025 15:26:18 +0800 Subject: [PATCH] Update serpAPIKnowledge struct to allow flexible type for 'Type' field - Modified the 'Type' field in the serpAPIKnowledge struct to use an interface{}, enabling it to accept either a string or an object based on the query context. - This change enhances the flexibility of the knowledge graph data representation in the search handler. --- agent/search/handlers/web/serpapi.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/agent/search/handlers/web/serpapi.go b/agent/search/handlers/web/serpapi.go index 623860a8..3e9cf5af 100644 --- a/agent/search/handlers/web/serpapi.go +++ b/agent/search/handlers/web/serpapi.go @@ -115,9 +115,9 @@ type serpAPIAnswerBox struct { // serpAPIKnowledge represents knowledge graph data type serpAPIKnowledge struct { - Title string `json:"title,omitempty"` - Type string `json:"type,omitempty"` - Description string `json:"description,omitempty"` + Title string `json:"title,omitempty"` + Type interface{} `json:"type,omitempty"` // Can be string or object depending on query + Description string `json:"description,omitempty"` } // serpAPIRelated represents related searches