Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8487216

Browse files
authored
chore: add aibridge configs & experiment (#19793)
1 parent2695bb4 commit8487216

File tree

7 files changed

+355
-4
lines changed

7 files changed

+355
-4
lines changed

‎cli/testdata/server-config.yaml.golden‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -713,3 +713,20 @@ workspace_prebuilds:
713713
# limit; disabled when set to zero.
714714
# (default: 3, type: int)
715715
failure_hard_limit: 3
716+
aibridge:
717+
# Whether to start an in-memory aibridged instance ("aibridge" experiment must be
718+
# enabled, too).
719+
# (default: false, type: bool)
720+
enabled: false
721+
# The base URL of the OpenAI API.
722+
# (default: https://api.openai.com/v1/, type: string)
723+
openai_base_url: https://api.openai.com/v1/
724+
# The key to authenticate against the OpenAI API.
725+
# (default: <unset>, type: string)
726+
openai_key: ""
727+
# The base URL of the Anthropic API.
728+
# (default: https://api.anthropic.com/, type: string)
729+
base_url: https://api.anthropic.com/
730+
# The key to authenticate against the Anthropic API.
731+
# (default: <unset>, type: string)
732+
key: ""

‎coderd/apidoc/docs.go‎

Lines changed: 52 additions & 2 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎coderd/apidoc/swagger.json‎

Lines changed: 52 additions & 2 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎codersdk/deployment.go‎

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -500,6 +500,7 @@ type DeploymentValues struct {
500500
WorkspaceHostnameSuffix serpent.String`json:"workspace_hostname_suffix,omitempty" typescript:",notnull"`
501501
PrebuildsPrebuildsConfig`json:"workspace_prebuilds,omitempty" typescript:",notnull"`
502502
HideAITasks serpent.Bool`json:"hide_ai_tasks,omitempty" typescript:",notnull"`
503+
AIAIConfig`json:"ai,omitempty"`
503504

504505
Config serpent.YAMLConfigPath`json:"config,omitempty" typescript:",notnull"`
505506
WriteConfig serpent.Bool`json:"write_config,omitempty" typescript:",notnull"`
@@ -1163,6 +1164,10 @@ func (c *DeploymentValues) Options() serpent.OptionSet {
11631164
Parent:&deploymentGroupNotifications,
11641165
YAML:"inbox",
11651166
}
1167+
deploymentGroupAIBridge= serpent.Group{
1168+
Name:"AIBridge",
1169+
YAML:"aibridge",
1170+
}
11661171
)
11671172

11681173
httpAddress:= serpent.Option{
@@ -3223,11 +3228,88 @@ Write out the current server config as YAML to stdout.`,
32233228
Group:&deploymentGroupClient,
32243229
YAML:"hideAITasks",
32253230
},
3231+
3232+
// AIBridge Options
3233+
{
3234+
Name:"AIBridge Enabled",
3235+
Description:fmt.Sprintf("Whether to start an in-memory aibridged instance (%q experiment must be enabled, too).",ExperimentAIBridge),
3236+
Flag:"aibridge-enabled",
3237+
Env:"CODER_AIBRIDGE_ENABLED",
3238+
Value:&c.AI.BridgeConfig.Enabled,
3239+
Default:"false",
3240+
Group:&deploymentGroupAIBridge,
3241+
YAML:"enabled",
3242+
Hidden:true,
3243+
},
3244+
{
3245+
Name:"AIBridge OpenAI Base URL",
3246+
Description:"The base URL of the OpenAI API.",
3247+
Flag:"aibridge-openai-base-url",
3248+
Env:"CODER_AIBRIDGE_OPENAI_BASE_URL",
3249+
Value:&c.AI.BridgeConfig.OpenAI.BaseURL,
3250+
Default:"https://api.openai.com/v1/",
3251+
Group:&deploymentGroupAIBridge,
3252+
YAML:"openai_base_url",
3253+
Hidden:true,
3254+
},
3255+
{
3256+
Name:"AIBridge OpenAI Key",
3257+
Description:"The key to authenticate against the OpenAI API.",
3258+
Flag:"aibridge-openai-key",
3259+
Env:"CODER_AIBRIDGE_OPENAI_KEY",
3260+
Value:&c.AI.BridgeConfig.OpenAI.Key,
3261+
Default:"",
3262+
Group:&deploymentGroupAIBridge,
3263+
YAML:"openai_key",
3264+
Hidden:true,
3265+
},
3266+
{
3267+
Name:"AIBridge Anthropic Base URL",
3268+
Description:"The base URL of the Anthropic API.",
3269+
Flag:"aibridge-anthropic-base-url",
3270+
Env:"CODER_AIBRIDGE_ANTHROPIC_BASE_URL",
3271+
Value:&c.AI.BridgeConfig.Anthropic.BaseURL,
3272+
Default:"https://api.anthropic.com/",
3273+
Group:&deploymentGroupAIBridge,
3274+
YAML:"base_url",
3275+
Hidden:true,
3276+
},
3277+
{
3278+
Name:"AIBridge Anthropic KEY",
3279+
Description:"The key to authenticate against the Anthropic API.",
3280+
Flag:"aibridge-anthropic-key",
3281+
Env:"CODER_AIBRIDGE_ANTHROPIC_KEY",
3282+
Value:&c.AI.BridgeConfig.Anthropic.Key,
3283+
Default:"",
3284+
Group:&deploymentGroupAIBridge,
3285+
YAML:"key",
3286+
Hidden:true,
3287+
},
32263288
}
32273289

32283290
returnopts
32293291
}
32303292

3293+
typeAIBridgeConfigstruct {
3294+
Enabled serpent.Bool`json:"enabled" typescript:",notnull"`
3295+
OpenAIAIBridgeOpenAIConfig`json:"openai" typescript:",notnull"`
3296+
AnthropicAIBridgeAnthropicConfig`json:"anthropic" typescript:",notnull"`
3297+
}
3298+
3299+
typeAIBridgeOpenAIConfigstruct {
3300+
BaseURL serpent.String`json:"base_url" typescript:",notnull"`
3301+
Key serpent.String`json:"key" typescript:",notnull"`
3302+
}
3303+
3304+
typeAIBridgeAnthropicConfigstruct {
3305+
BaseURL serpent.String`json:"base_url" typescript:",notnull"`
3306+
Key serpent.String`json:"key" typescript:",notnull"`
3307+
}
3308+
3309+
typeAIConfigstruct {
3310+
BridgeConfigAIBridgeConfig`json:"bridge,omitempty"`
3311+
}
3312+
32313313
typeSupportConfigstruct {
32323314
Links serpent.Struct[[]LinkConfig]`json:"links" typescript:",notnull"`
32333315
}
@@ -3475,6 +3557,7 @@ const (
34753557
ExperimentOAuth2Experiment="oauth2"// Enables OAuth2 provider functionality.
34763558
ExperimentMCPServerHTTPExperiment="mcp-server-http"// Enables the MCP HTTP server functionality.
34773559
ExperimentWorkspaceSharingExperiment="workspace-sharing"// Enables updating workspace ACLs for sharing with users and groups.
3560+
ExperimentAIBridgeExperiment="aibridge"// Enables AI Bridge functionality.
34783561
)
34793562

34803563
func (eExperiment)DisplayName()string {
@@ -3495,6 +3578,8 @@ func (e Experiment) DisplayName() string {
34953578
return"MCP HTTP Server Functionality"
34963579
caseExperimentWorkspaceSharing:
34973580
return"Workspace Sharing"
3581+
caseExperimentAIBridge:
3582+
return"AI Bridge"
34983583
default:
34993584
// Split on hyphen and convert to title case
35003585
// e.g. "web-push" -> "Web Push", "mcp-server-http" -> "Mcp Server Http"
@@ -3513,6 +3598,7 @@ var ExperimentsKnown = Experiments{
35133598
ExperimentOAuth2,
35143599
ExperimentMCPServerHTTP,
35153600
ExperimentWorkspaceSharing,
3601+
ExperimentAIBridge,
35163602
}
35173603

35183604
// ExperimentsSafe should include all experiments that are safe for

‎docs/reference/api/general.md‎

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp