feat(agent): 增强 Agent 配置,新增结构化字段与聊天功能支持
This commit is contained in:
1 parent
ac4262cd75
commit
c8ce77199e
183 files changed
+11690
-2300
No files matched your search
@@ -9,7 +9,9 @@
|
||||
*/
|
||||
import { computed, type ComputedRef, type Ref } from 'vue';
|
||||
import { getUserProfile } from '@/features/auth/api/user.api';
|
||||
import { LEAVE_FEATURE_AGENT_NAMES, LEAVE_TYPES } from '../constants/leave';
|
||||
import { canUseLeaveFeature as resolveLeaveFeatureEnabled } from '@/shared/utils/agent-registry.utils';
|
||||
import type { AgentRegistryFields } from '@/shared/utils/agent-registry.utils';
|
||||
import { LEAVE_TYPES } from '../constants/leave';
|
||||
import {
|
||||
createLeaveAgentPickerApi,
|
||||
createLeaveFlowApi,
|
||||
@@ -30,7 +32,7 @@ import type { ChatDeps } from './chat.deps';
|
||||
|
||||
export interface UseChatLeaveOptions {
|
||||
deps: ChatDeps;
|
||||
currentAgent: Ref<{ name?: string } | null>;
|
||||
currentAgent: Ref<AgentRegistryFields | null>;
|
||||
currentAgentId: ComputedRef<number>;
|
||||
currentUser: Ref<Record<string, unknown> | null>;
|
||||
currentUserDisplayName: ComputedRef<string>;
|
||||
@@ -57,9 +59,7 @@ export function useChatLeave(options: UseChatLeaveOptions) {
|
||||
loadHistory,
|
||||
} = options;
|
||||
|
||||
const canUseLeaveFeature = computed(() =>
|
||||
LEAVE_FEATURE_AGENT_NAMES.has(String(currentAgent.value?.name || '').trim()),
|
||||
);
|
||||
const canUseLeaveFeature = computed(() => resolveLeaveFeatureEnabled(currentAgent.value));
|
||||
|
||||
const { newLocalMessageId, saveLocalMessageToBackend } = createLeaveLocalMessageApi({
|
||||
conversationId,
|
||||
|
||||
Reference in new issue
Block a user