From 895d3cc0fa4607b8d9b0a790b811b8e639c65246 Mon Sep 17 00:00:00 2001 From: terminaldweller Date: Fri, 10 May 2024 13:05:53 -0400 Subject: WIP --- main.go | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/main.go b/main.go index 86c0919..a5ffbdd 100644 --- a/main.go +++ b/main.go @@ -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())) -- cgit v1.2.3