Support http client middlewareing (#830)

This commit is contained in:
Alexey Michurin
2024-08-23 13:47:11 +03:00
committed by GitHub
parent 6d021190f0
commit 5162adbbf9

View File

@@ -26,6 +26,10 @@ const AzureAPIKeyHeader = "api-key"
const defaultAssistantVersion = "v2" // upgrade to v2 to support vector store
type HTTPDoer interface {
Do(req *http.Request) (*http.Response, error)
}
// ClientConfig is a configuration of a client.
type ClientConfig struct {
authToken string
@@ -36,7 +40,7 @@ type ClientConfig struct {
APIVersion string // required when APIType is APITypeAzure or APITypeAzureAD
AssistantVersion string
AzureModelMapperFunc func(model string) string // replace model to azure deployment name func
HTTPClient *http.Client
HTTPClient HTTPDoer
EmptyMessagesLimit uint
}