(proxyURL string)
| 188 | } |
| 189 | |
| 190 | func MakeHTTPClient(proxyURL string) (*http.Client, error) { |
| 191 | client := &http.Client{ |
| 192 | Timeout: 0, // rely on ctx; streaming can be long |
| 193 | } |
| 194 | if proxyURL == "" { |
| 195 | return client, nil |
| 196 | } |
| 197 | |
| 198 | pURL, err := url.Parse(proxyURL) |
| 199 | if err != nil { |
| 200 | return nil, fmt.Errorf("invalid proxy URL: %w", err) |
| 201 | } |
| 202 | client.Transport = &http.Transport{ |
| 203 | Proxy: http.ProxyURL(pURL), |
| 204 | } |
| 205 | return client, nil |
| 206 | } |
| 207 | |
| 208 | func IsOpenAIReasoningModel(model string) bool { |
| 209 | m := strings.ToLower(model) |
no test coverage detected