( t *testing.T, db database.Store, chatID uuid.UUID, createdBy uuid.UUID, modelID uuid.UUID, role database.ChatMessageRole, text string, )
| 1123 | } |
| 1124 | |
| 1125 | func insertMessage( |
| 1126 | t *testing.T, |
| 1127 | db database.Store, |
| 1128 | chatID uuid.UUID, |
| 1129 | createdBy uuid.UUID, |
| 1130 | modelID uuid.UUID, |
| 1131 | role database.ChatMessageRole, |
| 1132 | text string, |
| 1133 | ) database.ChatMessage { |
| 1134 | t.Helper() |
| 1135 | |
| 1136 | parts, err := chatprompt.MarshalParts([]codersdk.ChatMessagePart{ |
| 1137 | codersdk.ChatMessageText(text), |
| 1138 | }) |
| 1139 | require.NoError(t, err) |
| 1140 | |
| 1141 | msg := dbgen.ChatMessage(t, db, database.ChatMessage{ |
| 1142 | ChatID: chatID, |
| 1143 | CreatedBy: uuid.NullUUID{UUID: createdBy, Valid: true}, |
| 1144 | ModelConfigID: uuid.NullUUID{UUID: modelID, Valid: true}, |
| 1145 | Role: role, |
| 1146 | Content: parts, |
| 1147 | ContentVersion: chatprompt.CurrentContentVersion, |
| 1148 | ProviderResponseID: sql.NullString{}, |
| 1149 | }) |
| 1150 | return msg |
| 1151 | } |
| 1152 | |
| 1153 | func createRun(t *testing.T, fixture testFixture) database.ChatDebugRun { |
| 1154 | t.Helper() |
no test coverage detected