chore(tests): extend timeout for client

Signed-off-by: mudler <mudler@localai.io>
This commit is contained in:
mudler
2025-03-30 18:42:19 +02:00
parent c940141e61
commit e0703cdb7c
3 changed files with 19 additions and 15 deletions

View File

@@ -17,12 +17,15 @@ type Client struct {
}
// NewClient creates a new LocalAgent client
func NewClient(baseURL string, apiKey string) *Client {
func NewClient(baseURL string, apiKey string, timeout time.Duration) *Client {
if timeout == 0 {
timeout = time.Second * 30
}
return &Client{
BaseURL: baseURL,
APIKey: apiKey,
HTTPClient: &http.Client{
Timeout: time.Second * 30,
Timeout: timeout,
},
}
}