Skip to content

Commit 8b9b35a

Browse files
committed
refactor: refactor OpenAI client for improved dialing context
- Replace `tr.Dial` with `tr.DialContext` in the `New` function of the OpenAI client. Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
1 parent b326415 commit 8b9b35a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

openai/openai.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ func New(opts ...Option) (*Client, error) {
187187
if err != nil {
188188
return nil, fmt.Errorf("can't connect to the proxy: %s", err)
189189
}
190-
tr.Dial = dialer.Dial
190+
tr.DialContext = dialer.(proxy.ContextDialer).DialContext
191191
}
192192

193193
// Set the HTTP client to use the default header transport with the specified headers.

0 commit comments

Comments
 (0)