fix(llm.gblib): MultiURL player type fixed.
This commit is contained in:
parent
cde7ecc66a
commit
ba320489f6
1 changed files with 7 additions and 3 deletions
|
@ -654,11 +654,15 @@ export class KBService implements IGBKBService {
|
||||||
await this.playAudio(min, answer, channel, step, min.conversationalService);
|
await this.playAudio(min, answer, channel, step, min.conversationalService);
|
||||||
} else if (answer.startsWith('![')) {
|
} else if (answer.startsWith('![')) {
|
||||||
|
|
||||||
// Checks for text after the image markdown.
|
// Checks for text after the image markdown, after the element 4, there are text blocks.
|
||||||
|
|
||||||
const hasText = answer.split(/!\[.*?\]\(.*?\)(.*)/)[3];
|
|
||||||
|
|
||||||
if (hasText) {
|
const removeMarkdownImages = (text: string) => {
|
||||||
|
// Remove both inline images  and reference images ![alt][ref]
|
||||||
|
return text.replace(/!\[[^\]]*\](?:\([^)]*\)|\[[^\]]*\])/g, '').trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (removeMarkdownImages(answer)) {
|
||||||
await min.conversationalService.sendText(min, step, answer);
|
await min.conversationalService.sendText(min, step, answer);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
|
|
Loading…
Add table
Reference in a new issue