fix: auth error.perf: prompt,process img
This commit is contained in:
@@ -26,7 +26,7 @@ import { formatPrice } from '@/utils/user';
|
||||
import { useConfirm } from '@/hooks/useConfirm';
|
||||
import { useSelectFile } from '@/hooks/useSelectFile';
|
||||
import { useToast } from '@/hooks/useToast';
|
||||
import { fileToBase64, compressImg } from '@/utils/file';
|
||||
import { compressImg } from '@/utils/file';
|
||||
|
||||
const ModelEditForm = ({
|
||||
formHooks,
|
||||
@@ -112,7 +112,14 @@ const ModelEditForm = ({
|
||||
<Box flex={'0 0 80px'} w={0}>
|
||||
对话模型:
|
||||
</Box>
|
||||
<Select isDisabled={!isOwner} {...register('chat.chatModel')}>
|
||||
<Select
|
||||
isDisabled={!isOwner}
|
||||
{...register('chat.chatModel', {
|
||||
onChange() {
|
||||
setRefresh((state) => !state);
|
||||
}
|
||||
})}
|
||||
>
|
||||
{chatModelList.map((item) => (
|
||||
<option key={item.chatModel} value={item.chatModel}>
|
||||
{item.name}
|
||||
|
||||
@@ -73,7 +73,7 @@ export const getApiKey = async ({
|
||||
|
||||
// 平台账号余额校验
|
||||
if (formatPrice(user.balance) <= 0) {
|
||||
return Promise.reject(ERROR_ENUM.unAuthorization);
|
||||
return Promise.reject(ERROR_ENUM.insufficientQuota);
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
@@ -25,9 +25,9 @@ export const lafClaudChat = async ({
|
||||
.filter((item) => item.obj === 'System')
|
||||
.map((item) => item.value)
|
||||
.join('\n');
|
||||
const systemPromptText = systemPrompt ? `\n知识库内容:'${systemPrompt}'\n我的问题:` : '';
|
||||
const systemPromptText = systemPrompt ? `\n知识库内容:'${systemPrompt}'\n` : '';
|
||||
|
||||
const prompt = systemPromptText + messages[messages.length - 1].value;
|
||||
const prompt = `${systemPromptText}我的问题:'${messages[messages.length - 1].value}'`;
|
||||
|
||||
const lafResponse = await axios.post(
|
||||
'https://hnvacz.laf.run/claude-gpt',
|
||||
|
||||
Reference in New Issue
Block a user