|
@@ -46,6 +46,17 @@
|
|
|
/>
|
|
/>
|
|
|
</template>
|
|
</template>
|
|
|
<template #header>
|
|
<template #header>
|
|
|
|
|
+ <FlexRow
|
|
|
|
|
+ v-if="isUseageLimited"
|
|
|
|
|
+ margin="margin.md" justify="space-between" align="center" padding="padding.md"
|
|
|
|
|
+ radius="radius.md" backgroundColor="background.primary"
|
|
|
|
|
+ >
|
|
|
|
|
+ <FlexRow gap="gap.md">
|
|
|
|
|
+ <Icon icon="prompt-filling" />
|
|
|
|
|
+ <Text text="您与AI的今日对话次数已经用完,请明天再来吧!也可以使用乡源果兑换AI对话次数。" fontConfig="secondText" />
|
|
|
|
|
+ </FlexRow>
|
|
|
|
|
+ <Button text="去兑换" type="primary" @click="emit('recharge')" />
|
|
|
|
|
+ </FlexRow>
|
|
|
<scroll-view scroll-x>
|
|
<scroll-view scroll-x>
|
|
|
<FlexRow align="center" padding="padding.md" gap="gap.md">
|
|
<FlexRow align="center" padding="padding.md" gap="gap.md">
|
|
|
<Button text="看图写作" @click="imageWriting" />
|
|
<Button text="看图写作" @click="imageWriting" />
|
|
@@ -145,13 +156,15 @@ import ChatMulitSelectBar from '../../../components/Footer/ChatMulitSelectBar.vu
|
|
|
import NavBar from '@/components/nav/NavBar.vue';
|
|
import NavBar from '@/components/nav/NavBar.vue';
|
|
|
import FlexCol from '@/components/layout/FlexCol.vue';
|
|
import FlexCol from '@/components/layout/FlexCol.vue';
|
|
|
import FlexRow from '@/components/layout/FlexRow.vue';
|
|
import FlexRow from '@/components/layout/FlexRow.vue';
|
|
|
-import type { VillageListItem } from '@/api/light/LightVillageApi';
|
|
|
|
|
import AgentApi from '@/api/agent/Agent';
|
|
import AgentApi from '@/api/agent/Agent';
|
|
|
import CommonContent from '@/api/CommonContent';
|
|
import CommonContent from '@/api/CommonContent';
|
|
|
import Button from '@/components/basic/Button.vue';
|
|
import Button from '@/components/basic/Button.vue';
|
|
|
import Field from '@/components/form/Field.vue';
|
|
import Field from '@/components/form/Field.vue';
|
|
|
import Popup from '@/components/dialog/Popup.vue';
|
|
import Popup from '@/components/dialog/Popup.vue';
|
|
|
import Tags from '@/components/form/Tags.vue';
|
|
import Tags from '@/components/form/Tags.vue';
|
|
|
|
|
+import AgentCostSettingsApi from '@/api/agent/AgentCostSettings';
|
|
|
|
|
+import Icon from '@/components/basic/Icon.vue';
|
|
|
|
|
+import Text from '@/components/basic/Text.vue';
|
|
|
|
|
|
|
|
const messages = ref<ChatMessageModel[]>([]) as Ref<ChatMessageModel[]>;
|
|
const messages = ref<ChatMessageModel[]>([]) as Ref<ChatMessageModel[]>;
|
|
|
const interfaceManager: ChatInterfaceManager = {
|
|
const interfaceManager: ChatInterfaceManager = {
|
|
@@ -180,10 +193,20 @@ const emit = defineEmits([
|
|
|
'update:images',
|
|
'update:images',
|
|
|
'update:showAgentPopup',
|
|
'update:showAgentPopup',
|
|
|
'close',
|
|
'close',
|
|
|
- 'upload'
|
|
|
|
|
|
|
+ 'upload',
|
|
|
|
|
+ 'recharge'
|
|
|
]);
|
|
]);
|
|
|
|
|
|
|
|
const showSessionSidebar = ref(false);
|
|
const showSessionSidebar = ref(false);
|
|
|
|
|
+const isUseageLimited = ref(false);
|
|
|
|
|
+
|
|
|
|
|
+function loadUseageLimitedStatus() {
|
|
|
|
|
+ return AgentCostSettingsApi.getMyCostSettings().then(res => {
|
|
|
|
|
+ isUseageLimited.value = res.requireData().balance <= 0;
|
|
|
|
|
+ }).catch(() => {
|
|
|
|
|
+ isUseageLimited.value = false;
|
|
|
|
|
+ });
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
//快速操作控制
|
|
//快速操作控制
|
|
|
//=============================================
|
|
//=============================================
|
|
@@ -418,7 +441,7 @@ const chatManager = useChat({
|
|
|
value: 'hunyuan-2.0-thinking-20251109',
|
|
value: 'hunyuan-2.0-thinking-20251109',
|
|
|
max_tokens: 10000,
|
|
max_tokens: 10000,
|
|
|
},
|
|
},
|
|
|
- model: 'hunyuan-2.0-thinking-20251109',
|
|
|
|
|
|
|
+ model: 'hy3',
|
|
|
chatOptions: {
|
|
chatOptions: {
|
|
|
temperature: 0.5,
|
|
temperature: 0.5,
|
|
|
top_p: 1,
|
|
top_p: 1,
|
|
@@ -427,6 +450,9 @@ const chatManager = useChat({
|
|
|
},
|
|
},
|
|
|
customSystemPrompt: '',
|
|
customSystemPrompt: '',
|
|
|
}),
|
|
}),
|
|
|
|
|
+ onUseageLimited: () => {
|
|
|
|
|
+ isUseageLimited.value = true;
|
|
|
|
|
+ },
|
|
|
defaultSystemPrompt: `你是一个亮乡源的“乡村文化挖掘笔记/文章写作与改稿助手”,工作在一个笔记编辑器里。你需要在与用户对话的同时,能直接读取并修改当前文章(标题与正文)。
|
|
defaultSystemPrompt: `你是一个亮乡源的“乡村文化挖掘笔记/文章写作与改稿助手”,工作在一个笔记编辑器里。你需要在与用户对话的同时,能直接读取并修改当前文章(标题与正文)。
|
|
|
|
|
|
|
|
## 工作目标
|
|
## 工作目标
|
|
@@ -477,11 +503,25 @@ const {
|
|
|
isSelectMode,
|
|
isSelectMode,
|
|
|
} = useChatSelection();
|
|
} = useChatSelection();
|
|
|
|
|
|
|
|
|
|
+export interface AgentRefreshStatInterface {
|
|
|
|
|
+ doRefreshLimitStats() : Promise<boolean>;
|
|
|
|
|
+ showAndContinue(): void;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
defineExpose({
|
|
defineExpose({
|
|
|
openImageWriting: () => imageWriting(),
|
|
openImageWriting: () => imageWriting(),
|
|
|
openImageWritingDialogIfLastClicked,
|
|
openImageWritingDialogIfLastClicked,
|
|
|
|
|
+ loadUseageLimitedStatus,
|
|
|
|
|
+ doRefreshLimitStats: async () => {
|
|
|
|
|
+ await loadUseageLimitedStatus();
|
|
|
|
|
+ return !isUseageLimited.value;
|
|
|
|
|
+ },
|
|
|
|
|
+ showAndContinue: () => {
|
|
|
|
|
+ emit('update:showAgentPopup', true);
|
|
|
|
|
+ },
|
|
|
})
|
|
})
|
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
|
|
|
+ loadUseageLimitedStatus();
|
|
|
interfaceManager.scrollToBottom?.();
|
|
interfaceManager.scrollToBottom?.();
|
|
|
});
|
|
});
|
|
|
</script>
|
|
</script>
|