feat(playground): enhance SSE debugging and add image paste support with i18n

- Add SSEViewer component for interactive SSE message inspection
  * Display SSE data stream with collapsible panels
  * Show parsed JSON with syntax highlighting
  * Display key information badges (content, tokens, finish reason)
  * Support copy individual or all SSE messages
  * Show error messages with detailed information

- Support Ctrl+V to paste images in chat input
  * Enable image paste in CustomInputRender component
  * Auto-detect and add pasted images to image list
  * Show toast notifications for paste results

- Add complete i18n support for 6 languages
  * Chinese (zh): Complete translations
  * English (en): Complete translations
  * Japanese (ja): Add 28 new translations
  * French (fr): Add 28 new translations
  * Russian (ru): Add 28 new translations
  * Vietnamese (vi): Add 32 new translations

- Update .gitignore to exclude data directory
This commit is contained in:
ImogeneOctaviap794
2025-11-26 20:40:32 +08:00
parent d98e7b3dbf
commit c2053a7f43
20 changed files with 810 additions and 65 deletions
@@ -19,6 +19,7 @@ For commercial licensing, please contact support@quantumnous.com
import React from 'react';
import { Input, Slider, Typography, Button, Tag } from '@douyinfe/semi-ui';
import { useTranslation } from 'react-i18next';
import {
Hash,
Thermometer,
@@ -37,6 +38,8 @@ const ParameterControl = ({
onParameterToggle,
disabled = false,
}) => {
const { t } = useTranslation();
return (
<>
{/* Temperature */}
@@ -70,7 +73,7 @@ const ParameterControl = ({
/>
</div>
<Typography.Text className='text-xs text-gray-500 mb-2'>
控制输出的随机性和创造性
{t('控制输出的随机性和创造性')}
</Typography.Text>
<Slider
step={0.1}
@@ -110,7 +113,7 @@ const ParameterControl = ({
/>
</div>
<Typography.Text className='text-xs text-gray-500 mb-2'>
核采样控制词汇选择的多样性
{t('核采样,控制词汇选择的多样性')}
</Typography.Text>
<Slider
step={0.1}
@@ -154,7 +157,7 @@ const ParameterControl = ({
/>
</div>
<Typography.Text className='text-xs text-gray-500 mb-2'>
频率惩罚减少重复词汇的出现
{t('频率惩罚,减少重复词汇的出现')}
</Typography.Text>
<Slider
step={0.1}
@@ -198,7 +201,7 @@ const ParameterControl = ({
/>
</div>
<Typography.Text className='text-xs text-gray-500 mb-2'>
存在惩罚鼓励讨论新话题
{t('存在惩罚,鼓励讨论新话题')}
</Typography.Text>
<Slider
step={0.1}
@@ -262,7 +265,7 @@ const ParameterControl = ({
Seed
</Typography.Text>
<Typography.Text className='text-xs text-gray-400'>
(可选用于复现结果)
({t('可选,用于复现结果')})
</Typography.Text>
</div>
<Button
@@ -276,7 +279,7 @@ const ParameterControl = ({
/>
</div>
<Input
placeholder='随机种子 (留空为随机)'
placeholder={t('随机种子 (留空为随机)')}
name='seed'
autoComplete='new-password'
value={inputs.seed || ''}