Files
FiDA_Front/src/api/agent.ts

58 lines
1.3 KiB
TypeScript
Raw Normal View History

2026-02-11 16:32:38 +08:00
import request from '@/utils/request'
// 对话
export interface AgentParamsType {
message: string // 消息
2026-02-25 11:00:31 +08:00
projectID: string //
versionID?: string //
2026-02-11 16:32:38 +08:00
imageUrlList?: string[] // 图片URL列表
configParams: Record<string, any> // 其他配置参数
token: string
}
export const fetchAgentReply = (data: AgentParamsType): Promise<AgentResponse> => {
return request({
url: '/api/ai-design/chat',
2026-02-24 11:17:01 +08:00
method: 'get',
2026-02-27 16:47:02 +08:00
data,
2026-02-11 16:32:38 +08:00
meta: { responseAll: true }
})
}
2026-02-25 11:00:31 +08:00
export interface CreateProjectParamsType {
type: string
region: string
style: string
temperature: number | string
}
export const createProject = (data: CreateProjectParamsType): Promise<any> => {
return request({ url: '/api/project/init', method: 'post', data })
}
2026-02-26 10:19:51 +08:00
/**
*
* @param data
* @param data.id id
* @returns
*/
export const getProjectInfo = (data) => {
return request({
url: `/api/project/${data.id}`,
method: 'get',
})
2026-02-27 16:47:02 +08:00
}
/**
*
* @param params
* @param params.page
* @param params.size
* @returns
*/
export const getProjectList = (params) => {
return request({
url: `/api/project/list`,
method: 'get',
params
})
}