mirror of
https://gitee.com/ccnetcore/Yi
synced 2026-03-20 00:16:37 +08:00
26 lines
559 B
TypeScript
26 lines
559 B
TypeScript
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';
|