diff options
author | terminaldweller <devi@terminaldweller.com> | 2024-05-10 17:05:53 +0000 |
---|---|---|
committer | terminaldweller <devi@terminaldweller.com> | 2024-05-10 17:05:53 +0000 |
commit | 895d3cc0fa4607b8d9b0a790b811b8e639c65246 (patch) | |
tree | 6de3fca67a95c6e0929af2b22c7fa7f63b99642a | |
parent | WIP (diff) | |
download | milla-895d3cc0fa4607b8d9b0a790b811b8e639c65246.tar.gz milla-895d3cc0fa4607b8d9b0a790b811b8e639c65246.zip |
WIP
-rw-r--r-- | main.go | 34 |
1 files changed, 17 insertions, 17 deletions
@@ -241,24 +241,24 @@ func runIRC(appConfig TomlConfig, ircChan chan *girc.Client) { ctx, cancel := context.WithTimeout(context.Background(), time.Duration(appConfig.RequestTimeout)*time.Second) defer cancel() - httpClient := http.Client{} - allProxy := os.Getenv("ALL_PROXY") - if allProxy != "" { - proxyUrl, err := url.Parse(allProxy) - if err != nil { - client.Cmd.ReplyTo(event, fmt.Sprintf("error: %s", err.Error())) - - return - } - transport := &http.Transport{ - Proxy: http.ProxyURL(proxyUrl), - } - - httpClient.Transport = transport - } + // httpClient := http.Client{} + // allProxy := os.Getenv("ALL_PROXY") + // if allProxy != "" { + // proxyUrl, err := url.Parse(allProxy) + // if err != nil { + // client.Cmd.ReplyTo(event, fmt.Sprintf("error: %s", err.Error())) + + // return + // } + // transport := &http.Transport{ + // Proxy: http.ProxyURL(proxyUrl), + // } + + // httpClient.Transport = transport + // } - clientGemini, err := genai.NewClient(ctx, option.WithAPIKey(appConfig.Apikey), option.WithHTTPClient(&httpClient)) - // clientGemini, err := genai.NewClient(ctx, option.WithAPIKey(appConfig.Apikey)) + // clientGemini, err := genai.NewClient(ctx, option.WithAPIKey(appConfig.Apikey), option.WithHTTPClient(&httpClient)) + clientGemini, err := genai.NewClient(ctx, option.WithAPIKey(appConfig.Apikey)) if err != nil { client.Cmd.ReplyTo(event, fmt.Sprintf("error: %s", err.Error())) |