Extract shared HTTP client for search tools
The userAgentTransport and 15s timeout were inconsistently applied: government_db.go lost its timeout, wayback.go used a bare http.Client without the pooled transport or user-agent header. A new httpclient.go centralizes the setup so all search tools share the same configuration. Signed-off-by: Émile Ré <emile@probo.com>
This commit is contained in:
@@ -18,7 +18,6 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"go.gearno.de/kit/httpclient"
|
||||
"go.probo.inc/probo/pkg/agent"
|
||||
)
|
||||
|
||||
@@ -45,8 +44,7 @@ type (
|
||||
)
|
||||
|
||||
func CheckGovernmentDBTool(endpoint, apiKey string) agent.Tool {
|
||||
client := httpclient.DefaultPooledClient()
|
||||
client.Transport = &userAgentTransport{next: client.Transport}
|
||||
client := newHTTPClient()
|
||||
|
||||
return agent.FunctionTool(
|
||||
"check_government_databases",
|
||||
|
||||
Reference in New Issue
Block a user