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

Commitefca9b4

Browse files
committed
chore: remove leftover pieces from#18535
Signed-off-by: Danny Kopping <dannykopping@gmail.com>
1 parent2b48c7e commitefca9b4

File tree

3 files changed

+0
-98
lines changed

3 files changed

+0
-98
lines changed

‎cli/server.go

Lines changed: 0 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -2624,77 +2624,6 @@ func redirectHTTPToHTTPSDeprecation(ctx context.Context, logger slog.Logger, inv
26242624
}
26252625
}
26262626

2627-
funcReadAIProvidersFromEnv(environ []string) ([]codersdk.AIProviderConfig,error) {
2628-
// The index numbers must be in-order.
2629-
sort.Strings(environ)
2630-
2631-
varproviders []codersdk.AIProviderConfig
2632-
for_,v:=rangeserpent.ParseEnviron(environ,"CODER_AI_PROVIDER_") {
2633-
tokens:=strings.SplitN(v.Name,"_",2)
2634-
iflen(tokens)!=2 {
2635-
returnnil,xerrors.Errorf("invalid env var: %s",v.Name)
2636-
}
2637-
2638-
providerNum,err:=strconv.Atoi(tokens[0])
2639-
iferr!=nil {
2640-
returnnil,xerrors.Errorf("parse number: %s",v.Name)
2641-
}
2642-
2643-
varprovider codersdk.AIProviderConfig
2644-
switch {
2645-
caselen(providers)<providerNum:
2646-
returnnil,xerrors.Errorf(
2647-
"provider num %v skipped: %s",
2648-
len(providers),
2649-
v.Name,
2650-
)
2651-
caselen(providers)==providerNum:
2652-
// At the next next provider.
2653-
providers=append(providers,provider)
2654-
caselen(providers)==providerNum+1:
2655-
// At the current provider.
2656-
provider=providers[providerNum]
2657-
}
2658-
2659-
key:=tokens[1]
2660-
switchkey {
2661-
case"TYPE":
2662-
provider.Type=v.Value
2663-
case"API_KEY":
2664-
provider.APIKey=v.Value
2665-
case"BASE_URL":
2666-
provider.BaseURL=v.Value
2667-
case"MODELS":
2668-
provider.Models=strings.Split(v.Value,",")
2669-
}
2670-
providers[providerNum]=provider
2671-
}
2672-
for_,envVar:=rangeenviron {
2673-
tokens:=strings.SplitN(envVar,"=",2)
2674-
iflen(tokens)!=2 {
2675-
continue
2676-
}
2677-
switchtokens[0] {
2678-
case"OPENAI_API_KEY":
2679-
providers=append(providers, codersdk.AIProviderConfig{
2680-
Type:"openai",
2681-
APIKey:tokens[1],
2682-
})
2683-
case"ANTHROPIC_API_KEY":
2684-
providers=append(providers, codersdk.AIProviderConfig{
2685-
Type:"anthropic",
2686-
APIKey:tokens[1],
2687-
})
2688-
case"GOOGLE_API_KEY":
2689-
providers=append(providers, codersdk.AIProviderConfig{
2690-
Type:"google",
2691-
APIKey:tokens[1],
2692-
})
2693-
}
2694-
}
2695-
returnproviders,nil
2696-
}
2697-
26982627
// ReadExternalAuthProvidersFromEnv is provided for compatibility purposes with
26992628
// the viper CLI.
27002629
funcReadExternalAuthProvidersFromEnv(environ []string) ([]codersdk.ExternalAuthConfig,error) {

‎codersdk/deployment.go

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3122,21 +3122,6 @@ Write out the current server config as YAML to stdout.`,
31223122
returnopts
31233123
}
31243124

3125-
typeAIProviderConfigstruct {
3126-
// Type is the type of the API provider.
3127-
Typestring`json:"type" yaml:"type"`
3128-
// APIKey is the API key to use for the API provider.
3129-
APIKeystring`json:"-" yaml:"api_key"`
3130-
// Models is the list of models to use for the API provider.
3131-
Models []string`json:"models" yaml:"models"`
3132-
// BaseURL is the base URL to use for the API provider.
3133-
BaseURLstring`json:"base_url" yaml:"base_url"`
3134-
}
3135-
3136-
typeAIConfigstruct {
3137-
Providers []AIProviderConfig`json:"providers,omitempty" yaml:"providers,omitempty"`
3138-
}
3139-
31403125
typeSupportConfigstruct {
31413126
Links serpent.Struct[[]LinkConfig]`json:"links" typescript:",notnull"`
31423127
}

‎site/src/api/typesGenerated.ts

Lines changed: 0 additions & 12 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