Merge 07c45d6197cb00cb1ce855f5b3557bba9fc08a70 into d7eb05b9361febead29a74e71ddffc2ebeff5302

This commit is contained in:
ZhangYunHao 2024-11-14 13:55:41 +08:00 committed by GitHub
commit 213beacfdd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -106,6 +106,15 @@ func (c *Client) do(ctx context.Context, method, path string, reqData, respData
request.Header.Set("Accept", "application/json")
request.Header.Set("User-Agent", fmt.Sprintf("ollama/%s (%s %s) Go/%s", version.Version, runtime.GOARCH, runtime.GOOS, runtime.Version()))
if envconfig.Debug() {
proxy, err := http.ProxyFromEnvironment(request)
if err != nil {
fmt.Println("proxy parse error: " + err.Error())
} else {
fmt.Println("proxy found: " + proxy.String())
}
}
respObj, err := c.http.Do(request)
if err != nil {
return err