mock数据,AI对话,全部应用
This commit is contained in:
56
urbanLifelineWeb/packages/platform/src/api/ai/agent.ts
Normal file
56
urbanLifelineWeb/packages/platform/src/api/ai/agent.ts
Normal file
@@ -0,0 +1,56 @@
|
||||
import { api } from 'shared/api'
|
||||
import type { ResultDomain } from 'shared/types'
|
||||
|
||||
|
||||
/**
|
||||
* 认证 API
|
||||
* 通过 Gateway (8180) 访问 Auth Service (8181)
|
||||
* 路由规则:/urban-lifeline/auth/** → auth-service/urban-lifeline/auth/**
|
||||
*/
|
||||
export const agentAPI = {
|
||||
baseUrl: "/urban-lifeline/xxx",//随后端更新
|
||||
|
||||
/**
|
||||
* 获取智能体列表
|
||||
* @returns 智能体列表
|
||||
*/
|
||||
async agentList(): Promise<ResultDomain<any>> {
|
||||
// const response = await api.post<null>(`${this.baseUrl}/send-sms-code`, { phone })
|
||||
// return response.data
|
||||
return [];
|
||||
},
|
||||
|
||||
/**
|
||||
* 新增智能体
|
||||
* @param agent 智能体信息
|
||||
* @returns 智能体信息
|
||||
*/
|
||||
async addAgent(agent: any): Promise<ResultDomain<any>> {
|
||||
// const response = await api.post<null>(`${this.baseUrl}/send-sms-code`, { phone })
|
||||
// return response.data
|
||||
return [];
|
||||
},
|
||||
|
||||
/**
|
||||
* 更新智能体
|
||||
* @param agent 智能体信息
|
||||
* @returns 智能体信息
|
||||
*/
|
||||
async updateAgent(agent: any): Promise<ResultDomain<any>> {
|
||||
// const response = await api.post<null>(`${this.baseUrl}/send-sms-code`, { phone })
|
||||
// return response.data
|
||||
return [];
|
||||
},
|
||||
|
||||
/**
|
||||
* 删除智能体
|
||||
* @param agentId 智能体ID
|
||||
* @returns 智能体信息
|
||||
*/
|
||||
async deleteAgent(agentId: string): Promise<ResultDomain<any>> {
|
||||
// const response = await api.post<null>(`${this.baseUrl}/send-sms-code`, { phone })
|
||||
// return response.data
|
||||
return [];
|
||||
},
|
||||
|
||||
}
|
||||
35
urbanLifelineWeb/packages/platform/src/api/ai/chat.ts
Normal file
35
urbanLifelineWeb/packages/platform/src/api/ai/chat.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
import { api } from 'shared/api'
|
||||
import type { ResultDomain } from 'shared/types'
|
||||
|
||||
|
||||
/**
|
||||
* 认证 API
|
||||
* 通过 Gateway (8180) 访问 Auth Service (8181)
|
||||
* 路由规则:/urban-lifeline/auth/** → auth-service/urban-lifeline/auth/**
|
||||
*/
|
||||
export const chatAPI = {
|
||||
baseUrl: "/urban-lifeline/xxx",//随后端更新
|
||||
|
||||
/**
|
||||
* 根据agentId获取聊天会话id
|
||||
* @param agentId agentId
|
||||
* @returns 发送结果
|
||||
*/
|
||||
async chatHistory(agentId: string): Promise<ResultDomain<string>> {
|
||||
// const response = await api.post<null>(`${this.baseUrl}/send-sms-code`, { phone })
|
||||
// return response.data
|
||||
return [];
|
||||
},
|
||||
|
||||
/**
|
||||
* 根据agentId和conversationId获取聊天记录
|
||||
* @param agentId agentId
|
||||
* @param conversationId conversationId
|
||||
* @returns 发送结果
|
||||
*/
|
||||
async chatConversation(agentId: string, conversationId: string): Promise<ResultDomain<any>> {
|
||||
// const response = await api.post<null>(`${this.baseUrl}/send-sms-code`, { phone })
|
||||
// return response.data
|
||||
return [];
|
||||
},
|
||||
}
|
||||
2
urbanLifelineWeb/packages/platform/src/api/ai/index.ts
Normal file
2
urbanLifelineWeb/packages/platform/src/api/ai/index.ts
Normal file
@@ -0,0 +1,2 @@
|
||||
export * from './agent'
|
||||
export * from './chat'
|
||||
1
urbanLifelineWeb/packages/platform/src/api/index.ts
Normal file
1
urbanLifelineWeb/packages/platform/src/api/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export * from './ai'
|
||||
Reference in New Issue
Block a user