提交 0fe0e170 authored 作者: 王鹏飞's avatar 王鹏飞

chore: update

上级 86f4f9e4
...@@ -68,5 +68,10 @@ body, ...@@ -68,5 +68,10 @@ body,
.ai-thinking { .ai-thinking {
margin-bottom: 20px; margin-bottom: 20px;
padding-left: 16px; padding-left: 16px;
border-left: 1px solid rgba(0, 0, 0, 0.45); border-left: 2px solid #e5e5e5;
color: #8b8b8b;
line-height: 26px;
&:empty {
display: none;
}
} }
...@@ -58,7 +58,7 @@ export default function AIChat() { ...@@ -58,7 +58,7 @@ export default function AIChat() {
onChange={setAI} onChange={setAI}
variant="filled" variant="filled"
suffixIcon={null} suffixIcon={null}
popupMatchSelectWidth={210}></Select> popupMatchSelectWidth={140}></Select>
<Button type="primary" shape="circle" icon={<ArrowUpOutlined />} onClick={handleAI} loading={isLoading} /> <Button type="primary" shape="circle" icon={<ArrowUpOutlined />} onClick={handleAI} loading={isLoading} />
</div> </div>
<div className="upload-list"></div> <div className="upload-list"></div>
......
...@@ -3,11 +3,11 @@ import { AIOption } from './types' ...@@ -3,11 +3,11 @@ import { AIOption } from './types'
export const AI_OPTIONS: AIOption[] = [ export const AI_OPTIONS: AIOption[] = [
{ label: 'DeepSeek-R1', value: 'Pro/deepseek-ai/DeepSeek-R1' }, { label: 'DeepSeek-R1', value: 'Pro/deepseek-ai/DeepSeek-R1' },
{ label: 'DeepSeek-V3', value: 'Pro/deepseek-ai/DeepSeek-V3' }, { label: 'DeepSeek-V3', value: 'Pro/deepseek-ai/DeepSeek-V3' },
{ label: 'QwQ-32B', value: 'Qwen/QwQ-32B' }, { label: '通义千问-QwQ', value: 'Qwen/QwQ-32B' },
{ label: 'deepseek-r1-250120', value: 'deepseek-r1-250120' }, { label: '通义千问-Max', value: 'qwen-max-latest' },
{ label: 'doubao-pro-32k-241215', value: 'doubao-pro-32k-241215' }, { label: '通义千问-Long', value: 'qwen-long' },
{ label: 'qwen-max-latest', value: 'qwen-max-latest' }, { label: '豆包-Pro', value: 'doubao-pro-32k-241215' },
{ label: 'qwen-long', value: 'qwen-long' }, // { label: 'deepseek-r1-250120', value: 'deepseek-r1-250120' },
// { label: 'hunyuan-t1-latest', value: 'hunyuan-t1-latest' }, // { label: 'hunyuan-t1-latest', value: 'hunyuan-t1-latest' },
// { label: 'hunyuan-standard-256K', value: 'hunyuan-standard-256K' }, // { label: 'hunyuan-standard-256K', value: 'hunyuan-standard-256K' },
] ]
...@@ -3,17 +3,16 @@ import { AI_OPTIONS } from './config' ...@@ -3,17 +3,16 @@ import { AI_OPTIONS } from './config'
import aiService from './api' import aiService from './api'
import type { AIMessage, AIRequestData, GenerateImageRequestData, GenerateVideoRequestData } from './types' import type { AIMessage, AIRequestData, GenerateImageRequestData, GenerateVideoRequestData } from './types'
import { RequestOptions } from './request' import { RequestOptions } from './request'
import { useAIStore } from './useAIStore'
export function useAI(globalOptions?: RequestOptions) { export function useAI(globalOptions?: RequestOptions) {
const [ai, setAI] = useState<string>(localStorage.getItem('ai') || 'Pro/deepseek-ai/DeepSeek-R1') const ai = useAIStore((state) => state.ai)
const setAI = useAIStore((state) => state.setAI)
const [messages, setMessages] = useState<AIMessage[]>([]) const [messages, setMessages] = useState<AIMessage[]>([])
const [message, setMessage] = useState<AIMessage | null>(null) const [message, setMessage] = useState<AIMessage | null>(null)
const [isLoading, setIsLoading] = useState<boolean>(false) const [isLoading, setIsLoading] = useState<boolean>(false)
const [error, setError] = useState<string | null>(null) const [error, setError] = useState<string | null>(null)
const controllerRef = useRef<AbortController | null>(null) const controllerRef = useRef<AbortController | null>(null)
useEffect(() => {
localStorage.setItem('ai', ai)
}, [ai])
const clearError = useCallback(() => { const clearError = useCallback(() => {
setError(null) setError(null)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论