mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat: widen ai_provider_type enum for chatd providers (#25394)
This commit is contained in:
@@ -19,8 +19,14 @@ import (
|
||||
type AIProviderType string
|
||||
|
||||
const (
|
||||
AiProviderTypeOpenai AIProviderType = "openai"
|
||||
AiProviderTypeAnthropic AIProviderType = "anthropic"
|
||||
AiProviderTypeOpenai AIProviderType = "openai"
|
||||
AiProviderTypeAnthropic AIProviderType = "anthropic"
|
||||
AiProviderTypeAzure AIProviderType = "azure"
|
||||
AiProviderTypeBedrock AIProviderType = "bedrock"
|
||||
AiProviderTypeGoogle AIProviderType = "google"
|
||||
AiProviderTypeOpenaiCompat AIProviderType = "openai-compat"
|
||||
AiProviderTypeOpenrouter AIProviderType = "openrouter"
|
||||
AiProviderTypeVercel AIProviderType = "vercel"
|
||||
)
|
||||
|
||||
func (e *AIProviderType) Scan(src interface{}) error {
|
||||
@@ -61,7 +67,13 @@ func (ns NullAIProviderType) Value() (driver.Value, error) {
|
||||
func (e AIProviderType) Valid() bool {
|
||||
switch e {
|
||||
case AiProviderTypeOpenai,
|
||||
AiProviderTypeAnthropic:
|
||||
AiProviderTypeAnthropic,
|
||||
AiProviderTypeAzure,
|
||||
AiProviderTypeBedrock,
|
||||
AiProviderTypeGoogle,
|
||||
AiProviderTypeOpenaiCompat,
|
||||
AiProviderTypeOpenrouter,
|
||||
AiProviderTypeVercel:
|
||||
return true
|
||||
}
|
||||
return false
|
||||
@@ -71,6 +83,12 @@ func AllAIProviderTypeValues() []AIProviderType {
|
||||
return []AIProviderType{
|
||||
AiProviderTypeOpenai,
|
||||
AiProviderTypeAnthropic,
|
||||
AiProviderTypeAzure,
|
||||
AiProviderTypeBedrock,
|
||||
AiProviderTypeGoogle,
|
||||
AiProviderTypeOpenaiCompat,
|
||||
AiProviderTypeOpenrouter,
|
||||
AiProviderTypeVercel,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user