🐛 fix: custom channel error

This commit is contained in:
MartialBE 2024-01-06 16:22:49 +08:00 committed by Buer
parent 47c9630169
commit b3f1b5953c
3 changed files with 5 additions and 3 deletions

View File

@ -27,6 +27,7 @@ func (f AzureProviderFactory) Create(c *gin.Context) base.ProviderInterface {
// AudioSpeech: "/audio/speech",
},
IsAzure: true,
BalanceAction: false,
},
}
}

View File

@ -54,7 +54,7 @@ func CreateOpenAIProvider(c *gin.Context, baseURL string) *OpenAIProvider {
Context: c,
},
IsAzure: false,
BalanceAction: false,
BalanceAction: true,
}
}

View File

@ -72,8 +72,9 @@ func GetProvider(channel *model.Channel, c *gin.Context) base.ProviderInterface
}
provider = openai.CreateOpenAIProvider(c, baseURL)
}
} else {
provider = factory.Create(c)
}
provider.SetChannel(channel)
return provider