aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorterminaldweller <devi@terminaldweller.com>2024-05-10 16:34:47 +0000
committerterminaldweller <devi@terminaldweller.com>2024-05-10 16:34:47 +0000
commit8f3f154b4495dd63ddd1590fe01eb5e0fbbdc205 (patch)
tree2933bcd4b3d85348816cb235e5aa476f1f1cf0c9
parentfixes #3 (diff)
downloadmilla-8f3f154b4495dd63ddd1590fe01eb5e0fbbdc205.tar.gz
milla-8f3f154b4495dd63ddd1590fe01eb5e0fbbdc205.zip
WIP
-rw-r--r--main.go13
1 files changed, 12 insertions, 1 deletions
diff --git a/main.go b/main.go
index 7649aa0..6f5333b 100644
--- a/main.go
+++ b/main.go
@@ -98,6 +98,7 @@ func printResponse(resp *genai.GenerateContentResponse) string {
func runIRC(appConfig TomlConfig, ircChan chan *girc.Client) {
var Memory []MemoryElement
+
irc := girc.New(girc.Config{
Server: appConfig.IrcServer,
Port: appConfig.IrcPort,
@@ -264,13 +265,23 @@ func runIRC(appConfig TomlConfig, ircChan chan *girc.Client) {
model.SetTemperature(float32(appConfig.Temp))
model.SetTopK(appConfig.TopK)
model.SetTopP(appConfig.TopP)
- resp, err := model.GenerateContent(ctx, genai.Text(prompt))
+
+ cs := model.StartChat()
+
+ resp, err := cs.SendMessage(ctx, genai.Text(prompt))
if err != nil {
client.Cmd.ReplyTo(event, fmt.Sprintf("error: %s", err.Error()))
return
}
+ // resp, err := model.GenerateContent(ctx, genai.Text(prompt))
+ // if err != nil {
+ // client.Cmd.ReplyTo(event, fmt.Sprintf("error: %s", err.Error()))
+
+ // return
+ // }
+
var writer bytes.Buffer
err = quick.Highlight(
&writer,