mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat: add 'copilot' to ai_provider_type (#25616)
This commit is contained in:
Generated
+2
-1
@@ -18,7 +18,8 @@ CREATE TYPE ai_provider_type AS ENUM (
|
||||
'google',
|
||||
'openai-compat',
|
||||
'openrouter',
|
||||
'vercel'
|
||||
'vercel',
|
||||
'copilot'
|
||||
);
|
||||
|
||||
CREATE TYPE ai_seat_usage_reason AS ENUM (
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
-- No-op: Postgres does not allow removing enum values safely.
|
||||
-- Matches the precedent in 000499_ai_provider_type_chatd_values.down.sql.
|
||||
@@ -0,0 +1,5 @@
|
||||
-- Add 'copilot' to ai_provider_type. The aibridge runtime already supports
|
||||
-- Copilot via aibridge.NewCopilotProvider; the enum just needs the
|
||||
-- discriminator so DB-driven providers can carry it. Mirrors the precedent
|
||||
-- in 000499_ai_provider_type_chatd_values.up.sql.
|
||||
ALTER TYPE ai_provider_type ADD VALUE IF NOT EXISTS 'copilot';
|
||||
@@ -27,6 +27,7 @@ const (
|
||||
AiProviderTypeOpenaiCompat AIProviderType = "openai-compat"
|
||||
AiProviderTypeOpenrouter AIProviderType = "openrouter"
|
||||
AiProviderTypeVercel AIProviderType = "vercel"
|
||||
AiProviderTypeCopilot AIProviderType = "copilot"
|
||||
)
|
||||
|
||||
func (e *AIProviderType) Scan(src interface{}) error {
|
||||
@@ -73,7 +74,8 @@ func (e AIProviderType) Valid() bool {
|
||||
AiProviderTypeGoogle,
|
||||
AiProviderTypeOpenaiCompat,
|
||||
AiProviderTypeOpenrouter,
|
||||
AiProviderTypeVercel:
|
||||
AiProviderTypeVercel,
|
||||
AiProviderTypeCopilot:
|
||||
return true
|
||||
}
|
||||
return false
|
||||
@@ -89,6 +91,7 @@ func AllAIProviderTypeValues() []AIProviderType {
|
||||
AiProviderTypeOpenaiCompat,
|
||||
AiProviderTypeOpenrouter,
|
||||
AiProviderTypeVercel,
|
||||
AiProviderTypeCopilot,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user