From c65619154eb37912be8af563de113e028665633c Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Mon, 1 Sep 2025 01:55:06 -0500 Subject: sub in the functions --- submitChat.go | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 submitChat.go (limited to 'submitChat.go') diff --git a/submitChat.go b/submitChat.go new file mode 100644 index 0000000..89e0160 --- /dev/null +++ b/submitChat.go @@ -0,0 +1,27 @@ +package main + +import ( + "fmt" + + "go.wit.com/log" + "google.golang.org/genai" +) + +func submitChat(content []*genai.Content) error { + resp, err := me.client.Models.GenerateContent(me.ctx, "gemini-2.5-flash", content, nil) + if err != nil { + return log.Errorf("error sending message: %v", err) + } + + log.Info("Response from API:") + for _, cand := range resp.Candidates { + if cand.Content != nil { + for _, part := range cand.Content.Parts { + fmt.Println(part) + } + } + } + // TODO: add the response to the protobuf + addResponse(resp) + return nil +} -- cgit v1.2.3