1
0
mirror of https://github.com/coalaura/whiskr.git synced 2025-09-08 17:06:42 +00:00

dynamic iterations

This commit is contained in:
Laura
2025-08-23 15:19:43 +02:00
parent bbe5a54ce1
commit d026c57ad2
8 changed files with 50 additions and 24 deletions

12
env.go
View File

@@ -18,8 +18,7 @@ type EnvTokens struct {
}
type EnvSettings struct {
CleanContent bool `json:"cleanup"`
MaxIterations uint `json:"iterations"`
CleanContent bool `json:"cleanup"`
}
type EnvUser struct {
@@ -44,8 +43,7 @@ type Environment struct {
var env = Environment{
// defaults
Settings: EnvSettings{
CleanContent: true,
MaxIterations: 3,
CleanContent: true,
},
}
@@ -67,9 +65,6 @@ func (e *Environment) Init() error {
log.Warning("Debug mode enabled")
}
// check max iterations
e.Settings.MaxIterations = max(e.Settings.MaxIterations, 1)
// check if server secret is set
if e.Tokens.Secret == "" {
log.Warning("Missing tokens.secret, generating new...")
@@ -125,8 +120,7 @@ func (e *Environment) Store() error {
"$.tokens.openrouter": {yaml.HeadComment(" openrouter.ai api token (required)")},
"$.tokens.exa": {yaml.HeadComment(" exa search api token (optional; used by search tools)")},
"$.settings.cleanup": {yaml.HeadComment(" normalize unicode in assistant output (optional; default: true)")},
"$.settings.iterations": {yaml.HeadComment(" max model turns per request (optional; default: 3)")},
"$.settings.cleanup": {yaml.HeadComment(" normalize unicode in assistant output (optional; default: true)")},
"$.authentication.enabled": {yaml.HeadComment(" require login with username and password")},
"$.authentication.users": {yaml.HeadComment(" list of users with bcrypt password hashes")},