Switched to DDG

This commit is contained in:
Pavel Pivovarov
2026-01-09 11:26:18 +11:00
parent 35733aa3e2
commit 0f9d9fb9c6
6 changed files with 173 additions and 65 deletions

View File

@@ -19,12 +19,11 @@ type Client struct {
client *openai.Client
model string
contextSize int
searxngURL string
mcpManager *mcp.Manager
}
// NewClient creates a new LLM client
func NewClient(apiURL, apiKey, model string, contextSize int, searxngURL string, mcpManager *mcp.Manager) *Client {
func NewClient(apiURL, apiKey, model string, contextSize int, mcpManager *mcp.Manager) *Client {
config := openai.DefaultConfig(apiKey)
config.BaseURL = apiURL
@@ -34,7 +33,6 @@ func NewClient(apiURL, apiKey, model string, contextSize int, searxngURL string,
client: client,
model: model,
contextSize: contextSize,
searxngURL: searxngURL,
mcpManager: mcpManager,
}
}
@@ -230,7 +228,7 @@ func (c *Client) handleToolCall(ctx context.Context, toolCall openai.ToolCall) s
return fmt.Sprintf("Error parsing arguments: %v", err)
}
fmt.Printf("Searching: %s\n", args.Query)
result, err := tools.WebSearch(c.searxngURL, args.Query)
result, err := tools.WebSearch(args.Query)
if err != nil {
return fmt.Sprintf("Search error: %v", err)
}