Commit 7d130509 authored by StyleZhang's avatar StyleZhang

Merge branch 'feat/chat-support-voice-input' into deploy/dev

parents 247b8454 fa55e1c1
...@@ -55,6 +55,9 @@ const VoiceInput = ({ ...@@ -55,6 +55,9 @@ const VoiceInput = ({
recorder.current.stop() recorder.current.stop()
drawRecordId.current && cancelAnimationFrame(drawRecordId.current) drawRecordId.current && cancelAnimationFrame(drawRecordId.current)
drawRecordId.current = null drawRecordId.current = null
const canvas = canvasRef.current!
const ctx = ctxRef.current!
ctx.clearRect(0, 0, canvas.width, canvas.height)
// const wavBlob = recorder.current.getWAVBlob() // const wavBlob = recorder.current.getWAVBlob()
// const wavFile = new File([wavBlob], 'audio.wav', { type: 'audio/wav' }) // const wavFile = new File([wavBlob], 'audio.wav', { type: 'audio/wav' })
// onConverted('') // onConverted('')
...@@ -104,9 +107,7 @@ const VoiceInput = ({ ...@@ -104,9 +107,7 @@ const VoiceInput = ({
return ( return (
<div className={cn(s.wrapper, 'absolute inset-0 rounded-xl')}> <div className={cn(s.wrapper, 'absolute inset-0 rounded-xl')}>
<div className='absolute inset-[1.5px] flex items-center pl-[14.5px] pr-[6.5px] py-[14px] bg-primary-25 rounded-[10.5px] overflow-hidden'> <div className='absolute inset-[1.5px] flex items-center pl-[14.5px] pr-[6.5px] py-[14px] bg-primary-25 rounded-[10.5px] overflow-hidden'>
{ <canvas id='voice-input-record' className='absolute left-0 bottom-0 w-full h-4' />
startRecord && <canvas id='voice-input-record' className='absolute left-0 bottom-0 w-full h-4' />
}
{ {
startConvert && <Loading02 className='animate-spin mr-2 w-4 h-4 text-primary-700' /> startConvert && <Loading02 className='animate-spin mr-2 w-4 h-4 text-primary-700' />
} }
......
...@@ -3,7 +3,7 @@ import { Row, Col, Properties, Property, Heading, SubProperty, Paragraph } from ...@@ -3,7 +3,7 @@ import { Row, Col, Properties, Property, Heading, SubProperty, Paragraph } from
# Completion App API # Completion App API
For high-quality text generation, such as articles, summaries, and translations, use the completion-messages API with user input. Text generation relies on the model parameters and prompt templates set in LangGenius Prompt Engineering. For high-quality text generation, such as articles, summaries, and translations, use the completion-messages API with user input. Text generation relies on the model parameters and prompt templates set in Dify Prompt Engineering.
<Heading <Heading
url='/completion-messages' url='/completion-messages'
......
...@@ -3,7 +3,7 @@ import { Row, Col, Properties, Property, Heading, SubProperty } from '../md.tsx' ...@@ -3,7 +3,7 @@ import { Row, Col, Properties, Property, Heading, SubProperty } from '../md.tsx'
# 文本生成型应用 API # 文本生成型应用 API
可用于生成高质量文本的应用,例如生成文章、摘要、翻译等,通过调用 completion-messages 接口,发送用户输入得到生成文本结果。用于生成文本的模型参数和提示词模版取决于开发者在 LangGenius 提示词编排页的设置。 可用于生成高质量文本的应用,例如生成文章、摘要、翻译等,通过调用 completion-messages 接口,发送用户输入得到生成文本结果。用于生成文本的模型参数和提示词模版取决于开发者在 Dify 提示词编排页的设置。
<Heading <Heading
url='/completion-messages' url='/completion-messages'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment