| | |
| | | }; |
| | | |
| | | const checkIsText = (item) => { |
| | | const isText = item?.content?.values?.some((item) => item?.content?.type === AnswerType.Knowledge); |
| | | const isText = item?.content?.values?.some((item) => item?.content?.type === AnswerType.Knowledge) || item?.conclusion?.length > 0; |
| | | return isText; |
| | | }; |
| | | |
| | | const getPlainText = (item) => { |
| | | let result = ''; |
| | | const knowledgeText = item.content.values |
| | | .filter((item) => { |
| | | const type = item?.content?.type; |
| | |
| | | .join('\n\n'); |
| | | return acc + answer; |
| | | }, ''); |
| | | return markdownToTxt(knowledgeText); |
| | | |
| | | const conclusionText = |
| | | item.conclusion |
| | | ?.filter((item) => !!item.report) |
| | | .map((item) => item.report) |
| | | .join('\n\n') ?? ''; |
| | | result += knowledgeText + conclusionText; |
| | | return markdownToTxt(result); |
| | | }; |
| | | |
| | | const likeClick = async (item) => { |