Feat: rp mode

This commit is contained in:
Grail Finder
2025-08-09 11:46:33 +03:00
parent 9e2165e056
commit e499a1ae37
4 changed files with 210 additions and 84 deletions

View File

@@ -7,10 +7,13 @@ import (
)
type Config struct {
CurrentAPI string `toml:"CurrentAPI"`
APIToken string `toml:"APIToken"`
QuestionsPath string `toml:"QuestionsPath"`
OutPath string `toml:"OutPath"`
RemoteAPI string `toml:"RemoteAPI"`
LocalAPI string `toml:"LocalAPI"`
APIToken string `toml:"APIToken"`
QuestionsPath string `toml:"QuestionsPath"`
RPScenariosDir string `toml:"RPScenariosDir"`
OutDir string `toml:"OutDir"`
MaxTurns int `toml:"MaxTurns"`
}
func LoadConfigOrDefault(fn string) *Config {
@@ -21,9 +24,12 @@ func LoadConfigOrDefault(fn string) *Config {
_, err := toml.DecodeFile(fn, &config)
if err != nil {
fmt.Println("failed to read config from file, loading default", "error", err)
config.CurrentAPI = "http://localhost:8080/completion"
config.RemoteAPI = "https://openrouter.ai/api/v1/completions"
config.LocalAPI = "http://localhost:8080/completion"
config.QuestionsPath = "data/questions.json"
config.OutPath = "data/out.json"
config.RPScenariosDir = "scenarios"
config.OutDir = "results"
config.MaxTurns = 10
}
return config
}