appendPartToLastUserMessage appends a text part to the last user message in the contents slice
(contents []GeminiContent, text string)
| 44 | |
| 45 | // appendPartToLastUserMessage appends a text part to the last user message in the contents slice |
| 46 | func appendPartToLastUserMessage(contents []GeminiContent, text string) { |
| 47 | for i := len(contents) - 1; i >= 0; i-- { |
| 48 | if contents[i].Role == "user" { |
| 49 | contents[i].Parts = append(contents[i].Parts, GeminiMessagePart{ |
| 50 | Text: text, |
| 51 | }) |
| 52 | break |
| 53 | } |
| 54 | } |
| 55 | } |
| 56 | |
| 57 | // buildGeminiHTTPRequest creates an HTTP request for the Gemini API |
| 58 | func buildGeminiHTTPRequest(ctx context.Context, contents []GeminiContent, chatOpts uctypes.WaveChatOpts) (*http.Request, error) { |
no outgoing calls
no test coverage detected