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.
This commit is contained in:
Max 2025-12-19 15:26:18 +08:00
parent 324ee7dc92
commit 8dcb78fc37

View file

@ -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