feat(agent): 增强 Agent 配置,新增结构化字段与聊天功能支持
This commit is contained in:
1 parent
ac4262cd75
commit
c8ce77199e
183 files changed
+11690
-2300
No files matched your search
@@ -94,6 +94,71 @@ export const deleteAdminDepartment = (id: number) =>
|
||||
requestJson(`/api/admin/departments/${id}`, { method: 'DELETE', ...auth() });
|
||||
|
||||
// Agents
|
||||
export interface AdminAgentRegistrySchema {
|
||||
platform: {
|
||||
runtime_providers: string[];
|
||||
conversation_modes: string[];
|
||||
dify_app_types: string[];
|
||||
suggested_questions_styles: string[];
|
||||
default_capabilities: Record<string, boolean>;
|
||||
tool_run_progress_defaults: {
|
||||
progress_type?: string;
|
||||
poll_interval_seconds?: number;
|
||||
lock_input_when_running?: boolean;
|
||||
};
|
||||
};
|
||||
agent_types: Array<{
|
||||
agent_code: string;
|
||||
label: string;
|
||||
conversation_mode_default: string;
|
||||
runtime_provider_default: string;
|
||||
runtime_handler?: string | null;
|
||||
models?: string[];
|
||||
required_fields?: string[];
|
||||
forced_capabilities?: Record<string, boolean>;
|
||||
handler_config_schema?: Record<string, unknown>;
|
||||
}>;
|
||||
handler_config_schemas: Record<string, unknown>;
|
||||
content_profile_keys: string[];
|
||||
}
|
||||
|
||||
export const getAdminAgentRegistrySchema = () =>
|
||||
requestJson<AdminAgentRegistrySchema>('/api/admin/agents/schema', auth());
|
||||
|
||||
export const inferAdminContentProfile = (intentRoutes: string[]) =>
|
||||
requestJson<{ content_profile: string | null }>('/api/admin/agents/infer-content-profile', {
|
||||
method: 'POST',
|
||||
...jsonAuth(),
|
||||
body: JSON.stringify({ intent_routes: intentRoutes }),
|
||||
});
|
||||
|
||||
export const listAdminAgentTypeCatalog = () =>
|
||||
getAdminAgentRegistrySchema().then((schema) => schema.agent_types);
|
||||
|
||||
export interface AdminIntentRouteOption {
|
||||
key: string;
|
||||
label: string;
|
||||
description?: string;
|
||||
category?: string;
|
||||
enabled?: boolean;
|
||||
sort_order?: number;
|
||||
}
|
||||
|
||||
export const listAdminIntentRoutes = () =>
|
||||
requestJson<AdminIntentRouteOption[]>('/api/admin/agents/intent-routes', auth());
|
||||
|
||||
export interface AdminContentProfileOption {
|
||||
key: string;
|
||||
label: string;
|
||||
description?: string;
|
||||
welcome_message?: string;
|
||||
suggested_questions_style?: 'plain' | 'styled';
|
||||
suggested_questions?: Array<{ question: string; group?: string }>;
|
||||
}
|
||||
|
||||
export const listAdminContentProfiles = () =>
|
||||
requestJson<AdminContentProfileOption[]>('/api/admin/agents/content-profiles', auth());
|
||||
|
||||
export const listAdminAgents = () => requestJson<any[]>('/api/admin/agents', auth());
|
||||
export const createAdminAgent = (payload: Record<string, unknown>) =>
|
||||
requestJson('/api/admin/agents', { method: 'POST', ...jsonAuth(), body: JSON.stringify(payload) });
|
||||
|
||||
Reference in new issue
Block a user