mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-09-04 10:34:30 +00:00
Native data AI application framework based on AWEL+AGENT (#1152)
Co-authored-by: Fangyin Cheng <staneyffer@gmail.com> Co-authored-by: lcx01800250 <lcx01800250@alibaba-inc.com> Co-authored-by: licunxing <864255598@qq.com> Co-authored-by: Aralhi <xiaoping0501@gmail.com> Co-authored-by: xuyuan23 <643854343@qq.com> Co-authored-by: aries_ckt <916701291@qq.com> Co-authored-by: hzh97 <2976151305@qq.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { AxiosRequestConfig } from 'axios';
|
||||
import { GET, POST } from '.';
|
||||
import { DELETE, GET, POST, PUT } from '.';
|
||||
import { DbListResponse, DbSupportTypeResponse, PostDbParams, ChatFeedBackSchema } from '@/types/db';
|
||||
import { DialogueListResponse, IChatDialogueSchema, NewDialogueParam, SceneResponse, ChatHistoryResponse, FeedBack, IDB } from '@/types/chat';
|
||||
import { IModelData, StartModelParams, BaseModelParams, SupportModel } from '@/types/model';
|
||||
@@ -32,6 +32,8 @@ import {
|
||||
ISyncBatchResponse,
|
||||
} from '@/types/knowledge';
|
||||
import { UpdatePromptParams, IPrompt, PromptParams } from '@/types/prompt';
|
||||
import { IFlow, IFlowNode, IFlowResponse, IFlowUpdateParam } from '@/types/flow';
|
||||
import { IAgent, IApp, ITeamModal } from '@/types/app';
|
||||
|
||||
/** App */
|
||||
export const postScenes = () => {
|
||||
@@ -249,3 +251,77 @@ export const updatePrompt = (data: UpdatePromptParams) => {
|
||||
export const addPrompt = (data: UpdatePromptParams) => {
|
||||
return POST<UpdatePromptParams, []>('/prompt/add', data);
|
||||
};
|
||||
|
||||
/** AWEL Flow */
|
||||
export const addFlow = (data: IFlowUpdateParam) => {
|
||||
return POST<IFlowUpdateParam, IFlow>('/api/v1/serve/awel/flows', data);
|
||||
};
|
||||
|
||||
export const getFlows = () => {
|
||||
return GET<null, IFlowResponse>('/api/v1/serve/awel/flows');
|
||||
};
|
||||
|
||||
export const getFlowById = (id: string) => {
|
||||
return GET<null, IFlow>(`/api/v1/serve/awel/flows/${id}`);
|
||||
};
|
||||
|
||||
export const updateFlowById = (id: string, data: IFlowUpdateParam) => {
|
||||
return PUT<IFlowUpdateParam, IFlow>(`/api/v1/serve/awel/flows/${id}`, data);
|
||||
};
|
||||
|
||||
export const deleteFlowById = (id: string) => {
|
||||
return DELETE<null, null>(`/api/v1/serve/awel/flows/${id}`);
|
||||
};
|
||||
|
||||
export const getFlowNodes = () => {
|
||||
return GET<null, Array<IFlowNode>>(`/api/v1/serve/awel/nodes`);
|
||||
};
|
||||
|
||||
/** app */
|
||||
export const addApp = (data: IApp) => {
|
||||
return POST<IApp, []>('/api/v1/app/create', data);
|
||||
};
|
||||
|
||||
export const getAppList = (data: Record<string, string>) => {
|
||||
return POST<Record<string, string>, IApp[]>('/api/v1/app/list', data);
|
||||
};
|
||||
|
||||
export const collectApp = (data: Record<string, string>) => {
|
||||
return POST<Record<string, string>, []>('/api/v1/app/collect', data);
|
||||
};
|
||||
|
||||
export const unCollectApp = (data: Record<string, string>) => {
|
||||
return POST<Record<string, string>, []>('api/v1/app/uncollect', data);
|
||||
};
|
||||
|
||||
export const delApp = (data: Record<string, string>) => {
|
||||
return POST<Record<string, string>, []>('/api/v1/app/remove', data);
|
||||
};
|
||||
|
||||
export const getAgents = () => {
|
||||
return GET<object, IAgent[]>('/api/v1/agents/list', {});
|
||||
};
|
||||
|
||||
export const getTeamMode = () => {
|
||||
return GET<null, string[]>('/api/v1/team-mode/list');
|
||||
};
|
||||
|
||||
export const getResourceType = () => {
|
||||
return GET<null, string[]>('api/v1/resource-type/list');
|
||||
};
|
||||
|
||||
export const getResource = (data: Record<string, string>) => {
|
||||
return GET<Record<string, string>, []>(`api/v1/app/resources/list?type=${data.type}`);
|
||||
};
|
||||
|
||||
export const updateApp = (data: IApp) => {
|
||||
return POST<IApp, []>('/api/v1/app/edit', data);
|
||||
};
|
||||
|
||||
export const getAppStrategy = () => {
|
||||
return GET<null, []>(`api/v1/llm-strategy/list`);
|
||||
};
|
||||
|
||||
export const getAppStrategyValues = (type: string) => {
|
||||
return GET<string, []>(`api/v1/llm-strategy/value/list?type=${type}`);
|
||||
};
|
||||
|
Reference in New Issue
Block a user