File tree Expand file tree Collapse file tree 3 files changed +7
-2
lines changed Expand file tree Collapse file tree 3 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -132,7 +132,7 @@ export const AssignmentSelection: Story = {
132
132
problemSetInitialMessages : [
133
133
{
134
134
role : "assistant" ,
135
- content : "Which question are you working on ?" ,
135
+ content : "Can I help you with any of the problems in <title> ?" ,
136
136
} ,
137
137
] ,
138
138
} ,
Original file line number Diff line number Diff line change @@ -306,7 +306,11 @@ const AiChatDisplay: FC<AiChatDisplayProps> = ({
306
306
if ( problemSetInitialMessages ) {
307
307
setMessages (
308
308
problemSetInitialMessages . map ( ( message , i ) => ( {
309
- ...message ,
309
+ content : message . content ?. replace (
310
+ "<title>" ,
311
+ event . target . value as string ,
312
+ ) ,
313
+ role : message . role ,
310
314
id : `initial-${ i } ` ,
311
315
} ) ) ,
312
316
)
Original file line number Diff line number Diff line change @@ -132,6 +132,7 @@ type AiChatDisplayProps = {
132
132
133
133
/**
134
134
* Initial messages to display on problem set selection.
135
+ * Occurrences of "<title>" in the content will be replaced with the problem set title.
135
136
*/
136
137
problemSetInitialMessages ?: Omit < AiChatMessage , "id" > [ ]
137
138
You can’t perform that action at this time.
0 commit comments