Remove hardcoded assistants version (#719)
This commit is contained in:
14
config.go
14
config.go
@@ -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{},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user