From 639eb16d0d40f48a7cec6e7194a91ca8a66e92d6 Mon Sep 17 00:00:00 2001 From: alex Date: Sat, 15 Apr 2023 12:05:40 -0700 Subject: [PATCH] config: change chunkdelay default, organize --- config.go | 40 ++++++++++++++++++++++++++-------------- 1 file changed, 26 insertions(+), 14 deletions(-) diff --git a/config.go b/config.go index 66de7a7..f4d750e 100644 --- a/config.go +++ b/config.go @@ -18,29 +18,41 @@ import ( func init() { cobra.OnInitialize(initConfig) + + // irc client configuration + root.PersistentFlags().StringP("nick", "n", "soulshack", "bot's nickname on the irc server") + root.PersistentFlags().StringP("server", "s", "localhost", "irc server address") root.PersistentFlags().BoolP("ssl", "e", false, "enable SSL for the IRC connection") - root.PersistentFlags().Int("maxtokens", 512, "maximum number of tokens to generate") root.PersistentFlags().IntP("port", "p", 6667, "irc server port") - root.PersistentFlags().String("goodbye", "goodbye.", "prompt to be used when the bot leaves the channel") - root.PersistentFlags().String("greeting", "hello.", "prompt to be used when the bot joins the channel") - root.PersistentFlags().String("model", ai.GPT4, "model to be used for responses (e.g., gpt-4") - root.PersistentFlags().String("openaikey", "", "openai api key") - root.PersistentFlags().String("prompt", "respond in a short text:", "initial system prompt for the ai") - root.PersistentFlags().StringP("become", "b", "chatbot", "become the named personality") root.PersistentFlags().StringP("channel", "c", "", "irc channel to join") - root.PersistentFlags().StringP("nick", "n", "soulshack", "bot's nickname on the irc server") - root.PersistentFlags().StringP("server", "s", "localhost", "irc server address") + + // bot configuration + root.PersistentFlags().StringP("become", "b", "chatbot", "become the named personality") + root.PersistentFlags().StringP("directory", "d", "./personalities", "personalities configuration directory") root.PersistentFlags().StringSliceP("admins", "A", []string{}, "comma-separated list of allowed users to administrate the bot (e.g., user1,user2,user3)") - root.PersistentFlags().DurationP("session", "S", time.Minute*3, "duration for the chat session; message context will be cleared after this time") - root.PersistentFlags().IntP("history", "H", 15, "maximum number of lines of context to keep per session") - root.PersistentFlags().DurationP("timeout", "t", time.Second*60, "timeout for each completion request to openai") + + // informational root.PersistentFlags().BoolP("list", "l", false, "list configured personalities") - root.PersistentFlags().StringP("directory", "d", "./personalities", "personalities configuration directory") root.PersistentFlags().BoolP("verbose", "v", false, "enable verbose logging of sessions and configuration") + + // openai configuration + root.PersistentFlags().String("openaikey", "", "openai api key") + root.PersistentFlags().Int("maxtokens", 512, "maximum number of tokens to generate") + root.PersistentFlags().String("model", ai.GPT4, "model to be used for responses (e.g., gpt-4)") + + // timeouts and behavior root.PersistentFlags().BoolP("addressed", "a", true, "require bot be addressed by nick for response") - root.PersistentFlags().DurationP("chunkdelay", "C", time.Second*5, "after this delay, bot will look to split the incoming buffer on sentence boundaries") + root.PersistentFlags().DurationP("session", "S", time.Minute*3, "duration for the chat session; message context will be cleared after this time") + root.PersistentFlags().DurationP("timeout", "t", time.Second*60, "timeout for each completion request to openai") + root.PersistentFlags().IntP("history", "H", 15, "maximum number of lines of context to keep per session") + root.PersistentFlags().DurationP("chunkdelay", "C", time.Second*15, "after this delay, bot will look to split the incoming buffer on sentence boundaries") root.PersistentFlags().IntP("chunkmax", "m", 350, "maximum number of characters to send as a single message") + // personality / prompting + root.PersistentFlags().String("goodbye", "goodbye.", "prompt to be used when the bot leaves the channel") + root.PersistentFlags().String("greeting", "hello.", "prompt to be used when the bot joins the channel") + root.PersistentFlags().String("prompt", "respond in a short text:", "initial system prompt for the ai") + vip.BindPFlags(root.PersistentFlags()) vip.SetEnvPrefix("SOULSHACK")