MCPcopy Index your code
hub / github.com/coder/coder / cloneMessage

Function cloneMessage

coderd/x/chatd/chatadvisor/handoff.go:182–187  ·  view source on GitHub ↗
(msg fantasy.Message)

Source from the content-addressed store, hash-verified

180}
181
182func cloneMessage(msg fantasy.Message) fantasy.Message {
183 cloned := msg
184 cloned.Content = append([]fantasy.MessagePart(nil), msg.Content...)
185 cloned.ProviderOptions = maps.Clone(msg.ProviderOptions)
186 return cloned
187}
188
189// messageJSONByteCount approximates the message's contribution to the
190// advisor prompt using the length of its JSON serialization. The JSON

Callers 1

BuildAdvisorMessagesFunction · 0.85

Calls 1

CloneMethod · 0.45

Tested by

no test coverage detected