-
Notifications
You must be signed in to change notification settings - Fork 0
swap viper with adder #12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,15 +9,15 @@ import ( | |
| "github.com/EternisAI/silo-proxy/internal/auth" | ||
| "github.com/EternisAI/silo-proxy/internal/db" | ||
| "github.com/joho/godotenv" | ||
| "github.com/spf13/viper" | ||
| "github.com/lwlee2608/adder" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Check the adder library GitHub repo
curl -s "https://api.github.com/repos/lwlee2608/adder" | jq '{name, description, stargazers_count, open_issues_count, created_at, updated_at, license, is_fork}'Repository: EternisAI/silo-proxy Length of output: 429 🌐 Web query:
💡 Result: The
Practical stability guidance: treat it as “pre-1.0 API may change”; if you use it, pin to Sources: Citations:
The The Recommendations:
🤖 Prompt for AI Agents |
||
| ) | ||
|
|
||
| type Config struct { | ||
| Log LogConfig | ||
| Http http.Config | ||
| Grpc GrpcConfig | ||
| DB db.Config `mapstructure:"db"` | ||
| JWT auth.Config `mapstructure:"jwt"` | ||
| DB db.Config `mapstructure:"db"` | ||
| JWT auth.Config `mapstructure:"jwt"` | ||
| } | ||
|
|
||
| type GrpcConfig struct { | ||
|
|
@@ -44,21 +44,21 @@ func InitConfig() { | |
|
|
||
| _ = godotenv.Load() | ||
|
|
||
| viper.SetConfigName("application") | ||
| viper.AddConfigPath(".") | ||
| viper.AddConfigPath("./cmd/silo-proxy-server") | ||
| viper.SetConfigType("yaml") | ||
| viper.SetEnvKeyReplacer(strings.NewReplacer(".", "_")) | ||
| viper.AutomaticEnv() | ||
| adder.SetConfigName("application") | ||
| adder.AddConfigPath(".") | ||
| adder.AddConfigPath("./cmd/silo-proxy-server") | ||
| adder.SetConfigType("yaml") | ||
| adder.SetEnvKeyReplacer(strings.NewReplacer(".", "_")) | ||
| adder.AutomaticEnv() | ||
|
|
||
| _ = viper.BindEnv("telegram.token", "TELEGRAM_TOKEN") | ||
| _ = viper.BindEnv("openrouter.apiKey", "OPENROUTER_API_KEY") | ||
| _ = adder.BindEnv("telegram.token", "TELEGRAM_TOKEN") | ||
| _ = adder.BindEnv("openrouter.apiKey", "OPENROUTER_API_KEY") | ||
|
|
||
| if err := viper.ReadInConfig(); err != nil { | ||
| if err := adder.ReadInConfig(); err != nil { | ||
| panic(err) | ||
| } | ||
|
|
||
| err = viper.Unmarshal(&config) | ||
| err = adder.Unmarshal(&config) | ||
| if err != nil { | ||
| panic(err) | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: EternisAI/silo-proxy
Length of output: 96
🏁 Script executed:
Repository: EternisAI/silo-proxy
Length of output: 436
🏁 Script executed:
Repository: EternisAI/silo-proxy
Length of output: 1804
🏁 Script executed:
Repository: EternisAI/silo-proxy
Length of output: 233
Remove unnecessary environment bindings for telegram and openrouter.
The
telegram.tokenandopenrouter.apiKeybindings on lines 52-53 are never used by the agent. The agent only requiresconfig.Grpc,config.Local, andconfig.Logconfiguration sections. These bindings are copy-paste remnants from the server config and should be removed.🤖 Prompt for AI Agents