mirror of
https://gitee.com/ccnetcore/Yi
synced 2026-04-14 05:06:37 +08:00
feat: 完成意心ai agent
This commit is contained in:
25
Yi.Ai.Vue3/src/api/agent/index.ts
Normal file
25
Yi.Ai.Vue3/src/api/agent/index.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import type { AgentSendInput, AgentToolOutput } from './types';
|
||||
import { get, post } from '@/utils/request';
|
||||
|
||||
/**
|
||||
* Agent 发送消息
|
||||
*/
|
||||
export function agentSend(data: AgentSendInput) {
|
||||
return post('/ai-chat/agent/send', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取 Agent 工具列表
|
||||
*/
|
||||
export function getAgentTools() {
|
||||
return post<AgentToolOutput[]>('/ai-chat/agent/tool').json();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取 Agent 上下文
|
||||
*/
|
||||
export function getAgentContext(sessionId: string) {
|
||||
return post<string>(`/ai-chat/agent/context/${sessionId}`).json();
|
||||
}
|
||||
|
||||
export * from './types';
|
||||
Reference in New Issue
Block a user