fix: strip tags from output (#978)
This commit is contained in:
parent
575c12503c
commit
e529d99974
3 changed files with 7 additions and 3 deletions
|
|
@ -12,7 +12,7 @@ import { MessageActions } from './message-actions';
|
||||||
import { PreviewAttachment } from './preview-attachment';
|
import { PreviewAttachment } from './preview-attachment';
|
||||||
import { Weather } from './weather';
|
import { Weather } from './weather';
|
||||||
import equal from 'fast-deep-equal';
|
import equal from 'fast-deep-equal';
|
||||||
import { cn } from '@/lib/utils';
|
import { cn, sanitizeText } from '@/lib/utils';
|
||||||
import { Button } from './ui/button';
|
import { Button } from './ui/button';
|
||||||
import { Tooltip, TooltipContent, TooltipTrigger } from './ui/tooltip';
|
import { Tooltip, TooltipContent, TooltipTrigger } from './ui/tooltip';
|
||||||
import { MessageEditor } from './message-editor';
|
import { MessageEditor } from './message-editor';
|
||||||
|
|
@ -130,7 +130,7 @@ const PurePreviewMessage = ({
|
||||||
message.role === 'user',
|
message.role === 'user',
|
||||||
})}
|
})}
|
||||||
>
|
>
|
||||||
<Markdown>{part.text}</Markdown>
|
<Markdown>{sanitizeText(part.text)}</Markdown>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -73,3 +73,7 @@ export function getTrailingMessageId({
|
||||||
|
|
||||||
return trailingMessage.id;
|
return trailingMessage.id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function sanitizeText(text: string) {
|
||||||
|
return text.replace('<has_function_call>', '');
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "ai-chatbot",
|
"name": "ai-chatbot",
|
||||||
"version": "3.0.17",
|
"version": "3.0.18",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "next dev --turbo",
|
"dev": "next dev --turbo",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue