File tree Expand file tree Collapse file tree 1 file changed +15
-5
lines changed
spring-ai-alibaba-integration-example/frontend/src Expand file tree Collapse file tree 1 file changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -168,11 +168,21 @@ const aiConfig = {
168
168
borderRadius : 16
169
169
}
170
170
} ,
171
- messageRender : ( content ) => (
172
- < Typography >
173
- < ReactMarkdown > { content } </ ReactMarkdown >
174
- </ Typography >
175
- )
171
+ messageRender : ( content ) => {
172
+ const regex = / < t h i n k > ( [ \s \S ] * ?) < \/ t h i n k > / ;
173
+ const match = content . match ( regex ) ;
174
+
175
+ if ( match ) {
176
+ const extractedContent = match [ 1 ] . replace ( "\n" , ">" ) ;
177
+ const newString = content . replace ( regex , "" ) ;
178
+ content = extractedContent + newString ;
179
+ }
180
+ return (
181
+ < Typography >
182
+ < ReactMarkdown > { content } </ ReactMarkdown >
183
+ </ Typography >
184
+ ) ;
185
+ }
176
186
} ;
177
187
const roles : GetProp < typeof Bubble . List , "roles" > = {
178
188
ai : {
You can’t perform that action at this time.
0 commit comments