MCPcopy Index your code
hub / github.com/wavetermdev/waveterm / appendPartToLastUserMessage

Function appendPartToLastUserMessage

pkg/aiusechat/gemini/gemini-backend.go:46–55  ·  view source on GitHub ↗

appendPartToLastUserMessage appends a text part to the last user message in the contents slice

(contents []GeminiContent, text string)

Source from the content-addressed store, hash-verified

44
45// appendPartToLastUserMessage appends a text part to the last user message in the contents slice
46func 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
58func buildGeminiHTTPRequest(ctx context.Context, contents []GeminiContent, chatOpts uctypes.WaveChatOpts) (*http.Request, error) {

Callers 1

buildGeminiHTTPRequestFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected