diff --git a/env.example b/env.example index 2e5ffb4..22dedda 100644 --- a/env.example +++ b/env.example @@ -6,3 +6,6 @@ TWITCH_OAUTH=oauth:cooloauthtokenhere # Comma seperated list of twitch channels the bot should join (no spaces) TWITCH_CHANNELS=channelone,channeltwo,channelthree + +# Ollama model that should be used. https://ollama.com/models +OLLAMA_MODEL=wizard-vicuna-uncensored diff --git a/generate.go b/generate.go index 288815a..1f2bc91 100644 --- a/generate.go +++ b/generate.go @@ -41,7 +41,7 @@ func (app *application) chatUserContext(target, username, input string) { olm.Content = input app.UserMsgStore[username] = append(app.UserMsgStore[username], olm) - requestBody.Model = "wizard-vicuna-uncensored" + requestBody.Model = app.OllamaModel requestBody.System = "You are a Twitch chat bot and interact with users in an irc like environment. Do not use any formatting. Be human-like. Never fail to answer the user. Always answer immediately. Keep your response shorter than 450 characters." requestBody.Messages = app.UserMsgStore[username] requestBody.Prompt = input @@ -89,7 +89,7 @@ func (app *application) chatGeneralContext(target, input string) { olm.Content = input app.MsgStore = append(app.MsgStore, olm) - requestBody.Model = "wizard-vicuna-uncensored" + requestBody.Model = app.OllamaModel requestBody.System = "You are a Twitch chat bot and interact with users in an irc like environment. Do not use any formatting. Be human-like. Never fail to answer the user. Always answer immediately. Keep your response shorter than 450 characters." requestBody.Messages = app.MsgStore requestBody.Prompt = input @@ -131,7 +131,7 @@ func (app *application) chatGeneralContext(target, input string) { func (app *application) generateNoContext(target, input string) { var requestBody ollamaRequest - requestBody.Model = "wizard-vicuna-uncensored" + requestBody.Model = app.OllamaModel requestBody.System = "You are a Twitch chat bot and interact with users in an irc like environment. Do not use any formatting. Be human-like. Never fail to answer the user. Always answer immediately. Keep your response shorter than 450 characters." requestBody.Prompt = input requestBody.Stream = false diff --git a/main.go b/main.go index 46be256..0174001 100644 --- a/main.go +++ b/main.go @@ -18,7 +18,7 @@ type config struct { type application struct { TwitchClient *twitch.Client Log *zap.SugaredLogger - Environment string + OllamaModel string Config config UserMsgStore map[string][]ollamaMessage MsgStore []ollamaMessage @@ -52,6 +52,7 @@ func main() { app := &application{ TwitchClient: tc, Log: sugar, + OllamaModel: os.Getenv("OLLAMA_MODEL"), Config: cfg, UserMsgStore: userMsgStore, }