Refactor llm client timeout
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
"log/slog"
|
||||
"os"
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
// testURL returns the LLM endpoint for integration tests.
|
||||
@@ -41,7 +42,7 @@ func TestIntegration_ListModels(t *testing.T) {
|
||||
cfg := Config{
|
||||
URL: testURL(t),
|
||||
Key: testKey(t),
|
||||
Timeout: "30s",
|
||||
Timeout: 30 * time.Second,
|
||||
}
|
||||
client, err := NewClient(cfg, slog.Default())
|
||||
if err != nil {
|
||||
@@ -67,7 +68,7 @@ func TestIntegration_Completions(t *testing.T) {
|
||||
cfg := Config{
|
||||
URL: testURL(t),
|
||||
Key: testKey(t),
|
||||
Timeout: "60s",
|
||||
Timeout: 60 * time.Second,
|
||||
}
|
||||
client, err := NewClient(cfg, slog.Default())
|
||||
if err != nil {
|
||||
@@ -100,7 +101,7 @@ func TestIntegration_CompletionsStream(t *testing.T) {
|
||||
cfg := Config{
|
||||
URL: testURL(t),
|
||||
Key: testKey(t),
|
||||
Timeout: "60s",
|
||||
Timeout: 60 * time.Second,
|
||||
}
|
||||
client, err := NewClient(cfg, slog.Default())
|
||||
if err != nil {
|
||||
@@ -140,7 +141,7 @@ func TestIntegration_ToolCalling(t *testing.T) {
|
||||
client, err := NewClient(Config{
|
||||
URL: testURL(t),
|
||||
Key: testKey(t),
|
||||
Timeout: "60s",
|
||||
Timeout: 60 * time.Second,
|
||||
}, slog.Default())
|
||||
if err != nil {
|
||||
t.Fatalf("NewClient: %v", err)
|
||||
|
||||
Reference in New Issue
Block a user