Skip to content

Commit 5162adb

Browse files
authored
Support http client middlewareing (#830)
1 parent 6d02119 commit 5162adb

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

config.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ const AzureAPIKeyHeader = "api-key"
2626

2727
const defaultAssistantVersion = "v2" // upgrade to v2 to support vector store
2828

29+
type HTTPDoer interface {
30+
Do(req *http.Request) (*http.Response, error)
31+
}
32+
2933
// ClientConfig is a configuration of a client.
3034
type ClientConfig struct {
3135
authToken string
@@ -36,7 +40,7 @@ type ClientConfig struct {
3640
APIVersion string // required when APIType is APITypeAzure or APITypeAzureAD
3741
AssistantVersion string
3842
AzureModelMapperFunc func(model string) string // replace model to azure deployment name func
39-
HTTPClient *http.Client
43+
HTTPClient HTTPDoer
4044

4145
EmptyMessagesLimit uint
4246
}

0 commit comments

Comments
 (0)