accept all 2xx http code, increase timeout

This commit is contained in:
unintendedfraud
2025-12-29 11:17:39 +01:00
parent 5cebbb070b
commit a60d01b9f2
+2 -2
View File
@@ -20,7 +20,7 @@ type Client struct {
func NewClient(env *env.Env) *Client {
return &Client{
http: http.Client{Timeout: 10 * time.Second},
http: http.Client{Timeout: 30 * time.Second},
token: env.LlmToken,
model: env.LlmModel,
endpoint: env.LlmEndpoint,
@@ -52,7 +52,7 @@ func (client Client) GenerateContent(message string) (string, error) {
body, err := io.ReadAll(res.Body)
if res.StatusCode != 200 {
if res.StatusCode >= 400 {
return "", fmt.Errorf("LLM returned status code [%d]", res.StatusCode)
}