Make openaiModelMapper optional in the init process (#97)

Modify the initialization condition in `azure/init.go` to allow the
`openaiModelMapper` environment variable to be optional. This change
facilitates configurations where the model mapper is not needed, and
improving flexibility.

Resolves: #95
This commit is contained in:
Peter Dave Hello
2024-05-23 18:50:06 +08:00
committed by GitHub
parent e85eed3c79
commit 7a8ff2ceb0

View File

@@ -31,7 +31,7 @@ func Init() error {
apiVersion = viper.GetString(constant.ENV_AZURE_OPENAI_API_VER)
endpoint = viper.GetString(constant.ENV_AZURE_OPENAI_ENDPOINT)
openaiModelMapper = viper.GetString(constant.ENV_AZURE_OPENAI_MODEL_MAPPER)
if endpoint != "" && openaiModelMapper != "" {
if endpoint != "" {
if apiVersion == "" {
apiVersion = "2023-07-01-preview"
}