Remove hardcoded assistants version (#719)

This commit is contained in:
Danai Antoniou
2024-04-24 12:59:50 +01:00
committed by GitHub
parent c6a63ed19a
commit 8d15a377ec
6 changed files with 44 additions and 45 deletions

View File

@@ -23,6 +23,8 @@ const (
const AzureAPIKeyHeader = "api-key"
const defaultAssistantVersion = "v1" // This will be deprecated by the end of 2024.
// ClientConfig is a configuration of a client.
type ClientConfig struct {
authToken string
@@ -30,7 +32,8 @@ type ClientConfig struct {
BaseURL string
OrgID string
APIType APIType
APIVersion string // required when APIType is APITypeAzure or APITypeAzureAD
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
@@ -39,10 +42,11 @@ type ClientConfig struct {
func DefaultConfig(authToken string) ClientConfig {
return ClientConfig{
authToken: authToken,
BaseURL: openaiAPIURLv1,
APIType: APITypeOpenAI,
OrgID: "",
authToken: authToken,
BaseURL: openaiAPIURLv1,
APIType: APITypeOpenAI,
AssistantVersion: defaultAssistantVersion,
OrgID: "",
HTTPClient: &http.Client{},