(feature)(webapp) change agent tool enum value (#454)

This commit is contained in:
williamhliu
2023-11-30 21:14:07 +08:00
committed by GitHub
parent 507c02a8fd
commit 39a85dc4ed
7 changed files with 48 additions and 68 deletions

View File

@@ -216,7 +216,7 @@ const DetailModal: React.FC<Props> = ({ detail, onSubmit, onCancel }) => {
}))}
onChange={(value) => {
setPluginType(value);
if (value === PluginTypeEnum.LLM_S2SQL) {
if (value === PluginTypeEnum.NL2SQL_LLM) {
form.setFieldsValue({ parseMode: ParseModeEnum.FUNCTION_CALL });
setFunctionParams([
{
@@ -243,7 +243,7 @@ const DetailModal: React.FC<Props> = ({ detail, onSubmit, onCancel }) => {
<FormItem name="pattern" label="函数描述">
<TextArea placeholder="请输入函数描述,多个描述换行分隔" allowClear />
</FormItem>
{/* <FormItem name="params" label="函数参数" hidden={pluginType === PluginTypeEnum.LLM_S2SQL}>
{/* <FormItem name="params" label="函数参数" hidden={pluginType === PluginTypeEnum.NL2SQL_LLM}>
<div className={styles.paramsSection}>
{functionParams.map((functionParam: FunctionParamFormItemType) => {
const { id, name, type, description } = functionParam;

View File

@@ -1,8 +1,6 @@
export const PLUGIN_TYPE_MAP = {
WEB_PAGE: 'Web页面',
WEB_SERVICE: 'Web服务',
// LLM_S2SQL: 'LLM语义解析',
// CONTENT_INTERPRET: '内容解读',
}
export const PARSE_MODE_MAP = {

View File

@@ -4,23 +4,23 @@ export type PluginConfigType = {
paramOptions: any;
valueParams: any;
forwardParam: any;
}
};
export enum PluginTypeEnum {
WEB_PAGE = 'WEB_PAGE',
WEB_SERVICE = 'WEB_SERVICE',
LLM_S2SQL = 'LLM_S2SQL'
NL2SQL_LLM = 'NL2SQL_LLM',
}
export enum ParseModeEnum {
EMBEDDING_RECALL = 'EMBEDDING_RECALL',
FUNCTION_CALL = 'FUNCTION_CALL'
FUNCTION_CALL = 'FUNCTION_CALL',
}
export enum ParamTypeEnum {
CUSTOM = 'CUSTOM',
SEMANTIC = 'SEMANTIC',
FORWARD = 'FORWARD'
FORWARD = 'FORWARD',
}
export type PluginType = {
@@ -32,7 +32,7 @@ export type PluginType = {
parseModeConfig: string;
name: string;
config: PluginConfigType;
}
};
export type ModelType = {
id: number | string;
@@ -49,20 +49,20 @@ export type DimensionType = {
export type FunctionParamType = {
type: string;
properties: Record<string, { type: string, description: string }>;
properties: Record<string, { type: string; description: string }>;
required: string[];
}
};
export type FunctionType = {
name: string;
description: string;
parameters: FunctionParamType;
examples: string[];
}
};
export type FunctionParamFormItemType = {
id: string;
name?: string;
type?: string;
description?: string;
}
};