fix: address all review findings on PR #14
- gitea.Client: add concurrency safety doc comment - gitea.Client: set 30s HTTP client timeout as safety net - llm.Client: add concurrency safety doc comment - llm.Client: set 2min HTTP client timeout (LLM calls are slow) - gitea/client.go: gofmt to fix indentation - integration_test: update to current BuildSystemPrompt/BuildUserPrompt signatures - integration_test: use strings.SplitN for owner/repo parsing
This commit is contained in:
+3
-1
@@ -8,9 +8,11 @@ import (
|
||||
"io"
|
||||
"net/http"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
// Client calls an OpenAI-compatible chat completion API.
|
||||
// A Client is safe for concurrent use by multiple goroutines after construction.
|
||||
type Client struct {
|
||||
baseURL string
|
||||
apiKey string
|
||||
@@ -25,7 +27,7 @@ func NewClient(baseURL, apiKey, model string) *Client {
|
||||
baseURL: strings.TrimRight(baseURL, "/"),
|
||||
apiKey: apiKey,
|
||||
model: model,
|
||||
http: &http.Client{},
|
||||
http: &http.Client{Timeout: 2 * time.Minute},
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user