From 8f3f154b4495dd63ddd1590fe01eb5e0fbbdc205 Mon Sep 17 00:00:00 2001 From: terminaldweller Date: Fri, 10 May 2024 12:34:47 -0400 Subject: WIP --- main.go | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'main.go') 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, -- cgit v1.2.3