isolate this function
This commit is contained in:
parent
c110250dc2
commit
c63a746d0b
17
doConnect.go
17
doConnect.go
|
@ -52,20 +52,3 @@ func simpleHello() error {
|
|||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue