tts models support (#2033)
Co-authored-by: luowei <glpat-EjySCyNjWiLqAED-YmwM> Co-authored-by: crazywoola <427733928@qq.com> Co-authored-by: crazywoola <100913391+crazywoola@users.noreply.github.com> Co-authored-by: Yeuoly <45712896+Yeuoly@users.noreply.github.com>
This commit is contained in:
@@ -13,6 +13,7 @@ import MoreInfo from '../more-info'
|
||||
import CopyBtn from '../copy-btn'
|
||||
import Thought from '../thought'
|
||||
import Citation from '../citation'
|
||||
import AudioBtn from '@/app/components/base/audio-btn'
|
||||
import { randomString } from '@/utils'
|
||||
import type { MessageRating } from '@/models/log'
|
||||
import Tooltip from '@/app/components/base/tooltip'
|
||||
@@ -53,6 +54,7 @@ export type IAnswerProps = {
|
||||
dataSets?: DataSet[]
|
||||
isShowCitation?: boolean
|
||||
isShowCitationHitInfo?: boolean
|
||||
isShowTextToSpeech?: boolean
|
||||
// Annotation props
|
||||
supportAnnotation?: boolean
|
||||
appId?: string
|
||||
@@ -75,6 +77,7 @@ const Answer: FC<IAnswerProps> = ({
|
||||
citation,
|
||||
isShowCitation,
|
||||
isShowCitationHitInfo = false,
|
||||
isShowTextToSpeech,
|
||||
supportAnnotation,
|
||||
appId,
|
||||
question,
|
||||
@@ -322,7 +325,13 @@ const Answer: FC<IAnswerProps> = ({
|
||||
className={cn(s.copyBtn, 'mr-1')}
|
||||
/>
|
||||
)}
|
||||
{(supportAnnotation && !item.isOpeningStatement) && (
|
||||
{!item.isOpeningStatement && isShowTextToSpeech && (
|
||||
<AudioBtn
|
||||
value={content}
|
||||
className={cn(s.playBtn, 'mr-1')}
|
||||
/>
|
||||
)}
|
||||
{(!item.isOpeningStatement && supportAnnotation) && (
|
||||
<AnnotationCtrlBtn
|
||||
appId={appId!}
|
||||
messageId={id}
|
||||
|
||||
@@ -57,6 +57,7 @@ export type IChatProps = {
|
||||
isShowSuggestion?: boolean
|
||||
suggestionList?: string[]
|
||||
isShowSpeechToText?: boolean
|
||||
isShowTextToSpeech?: boolean
|
||||
isShowCitation?: boolean
|
||||
answerIcon?: ReactNode
|
||||
isShowConfigElem?: boolean
|
||||
@@ -89,6 +90,7 @@ const Chat: FC<IChatProps> = ({
|
||||
isShowSuggestion,
|
||||
suggestionList,
|
||||
isShowSpeechToText,
|
||||
isShowTextToSpeech,
|
||||
isShowCitation,
|
||||
answerIcon,
|
||||
isShowConfigElem,
|
||||
@@ -222,6 +224,7 @@ const Chat: FC<IChatProps> = ({
|
||||
dataSets={dataSets}
|
||||
isShowCitation={isShowCitation}
|
||||
isShowCitationHitInfo={isShowCitationHitInfo}
|
||||
isShowTextToSpeech={isShowTextToSpeech}
|
||||
supportAnnotation={supportAnnotation}
|
||||
appId={appId}
|
||||
question={chatList[index - 1]?.content}
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
}
|
||||
|
||||
.copyBtn,
|
||||
.playBtn,
|
||||
.annotationBtn {
|
||||
display: none;
|
||||
}
|
||||
@@ -65,6 +66,7 @@
|
||||
}
|
||||
|
||||
.answerWrap:hover .copyBtn,
|
||||
.answerWrap:hover .playBtn,
|
||||
.answerWrap:hover .annotationBtn {
|
||||
display: block;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user