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

Function chatLastErrorMessage

coderd/x/chatd/chatd_test.go:175–185  ·  view source on GitHub ↗
(raw pqtype.NullRawMessage)

Source from the content-addressed store, hash-verified

173}
174
175func chatLastErrorMessage(raw pqtype.NullRawMessage) string {
176 if !raw.Valid {
177 return ""
178 }
179
180 var payload codersdk.ChatError
181 if err := json.Unmarshal(raw.RawMessage, &payload); err == nil && payload.Message != "" {
182 return payload.Message
183 }
184 return string(raw.RawMessage)
185}
186
187func recordOpenAIRequest(req *chattest.OpenAIRequest) recordedOpenAIRequest {
188 messages := append([]chattest.OpenAIMessage(nil), req.Messages...)

Calls 1

UnmarshalMethod · 0.45

Tested by

no test coverage detected