Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions framework/elsa/fit-elsa-react/src/common/Consts.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,4 +214,21 @@ export const DEFAULT_KNOWLEDGE_RETRIEVAL_NODE_KNOWLEDGE_CONFIG_ID = {
type: DATA_TYPES.STRING,
from: FROM_TYPE.INPUT,
value: null,
};

export const DEFAULT_KNOWLEDGE_RETRIEVAL_NODE_EXTENSIONS = {
id: `knowledgeExtensions_${uuidv4()}`,
name: 'extensions',
type: DATA_TYPES.OBJECT,
from: FROM_TYPE.EXPAND,
value: [{
id: uuidv4(),
name: VIRTUAL_CONTEXT_NODE_VARIABLES.USER_ID,
type: DATA_TYPES.STRING,
from: FROM_TYPE.REFERENCE,
referenceId: VIRTUAL_CONTEXT_NODE_VARIABLES.USER_ID,
referenceKey: VIRTUAL_CONTEXT_NODE_VARIABLES.USER_ID,
referenceNode: VIRTUAL_CONTEXT_NODE.id,
value: [VIRTUAL_CONTEXT_NODE_VARIABLES.USER_ID],
}],
};
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
import {v4 as uuidv4} from 'uuid';
import {KnowledgeRetrievalWrapper} from '@/components/knowledgeRetrieval/KnowledgeRetrievalWrapper.jsx';
import {retrievalComponent} from '@/components/retrieval/retrievalComponent.jsx';
import {DATA_TYPES, DEFAULT_KNOWLEDGE_REPO_GROUP, DEFAULT_KNOWLEDGE_RETRIEVAL_NODE_KNOWLEDGE_CONFIG_ID, FROM_TYPE} from '@/common/Consts.js';
import {DATA_TYPES, DEFAULT_KNOWLEDGE_REPO_GROUP, DEFAULT_KNOWLEDGE_RETRIEVAL_NODE_KNOWLEDGE_CONFIG_ID, FROM_TYPE,
DEFAULT_KNOWLEDGE_RETRIEVAL_NODE_EXTENSIONS} from '@/common/Consts.js';
import {
UpdateGroupIdAndConfigIdReducer,
UpdateInputParamReducer,
Expand Down Expand Up @@ -138,7 +139,8 @@ export const knowledgeRetrievalComponent = (jadeConfig, shape) => {
from: FROM_TYPE.INPUT,
value: DEFAULT_KNOWLEDGE_REPO_GROUP,
},
DEFAULT_KNOWLEDGE_RETRIEVAL_NODE_KNOWLEDGE_CONFIG_ID
DEFAULT_KNOWLEDGE_RETRIEVAL_NODE_KNOWLEDGE_CONFIG_ID,
DEFAULT_KNOWLEDGE_RETRIEVAL_NODE_EXTENSIONS
],
}],
outputParams: [{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
DATA_TYPES,
DEFAULT_KNOWLEDGE_REPO_GROUP_STRUCT,
DEFAULT_KNOWLEDGE_RETRIEVAL_NODE_KNOWLEDGE_CONFIG_ID,
DEFAULT_KNOWLEDGE_RETRIEVAL_NODE_EXTENSIONS,
DEFAULT_LLM_KNOWLEDGE_BASES,
DEFAULT_LLM_REFERENCE_OUTPUT,
DEFAULT_ADD_TOOL_NODE_CONTEXT,
Expand Down Expand Up @@ -404,6 +405,10 @@ export const knowledgeRetrievalCompatibilityProcessor = (shapeData, graph, pageH
if (Array.isArray(optionValue) && !optionValue.some(v => v.name === 'knowledgeConfigId')) {
optionValue.push(DEFAULT_KNOWLEDGE_RETRIEVAL_NODE_KNOWLEDGE_CONFIG_ID);
}

if (Array.isArray(optionValue) && !optionValue.some(v => v.name === 'extensions')) {
optionValue.push(DEFAULT_KNOWLEDGE_RETRIEVAL_NODE_EXTENSIONS);
}
};

const userIdParamProcess = () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@

package modelengine.fel.core.chat;

import modelengine.fel.core.tool.ToolInfo;
import modelengine.fel.core.model.http.SecureConfig;
import modelengine.fel.core.tool.ToolInfo;
import modelengine.fitframework.pattern.builder.BuilderFactory;

import java.util.List;
import java.util.Map;

/**
* 表示聊天大模型参数的实体。
Expand Down Expand Up @@ -132,6 +133,13 @@ public interface ChatOption {
*/
SecureConfig secureConfig();

/**
* 获取扩展信息。
*
* @return 表示扩展信息的 {@link Map}{@code <}{@link String}{@code , }{@link Object}{@code >}。
*/
Map<String, Object> extensions();

/**
* {@link ChatOption} 的构建器。
*/
Expand Down Expand Up @@ -232,6 +240,14 @@ interface Builder {
*/
Builder secureConfig(SecureConfig secureConfig);

/**
* 设置扩展信息。
*
* @param extensions 表示扩展信息的 {@link Map}{@code <}{@link String}{@code , }{@link Object}{@code >}。
* @return 表示当前构建器的 {@link Builder}。
*/
Builder extensions(Map<String, Object> extensions);

/**
* 构建对象。
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

import modelengine.fitframework.pattern.builder.BuilderFactory;

import java.util.Map;

/**
* 表示嵌入模型参数的实体。
*
Expand All @@ -28,6 +30,13 @@ public interface EmbedOption {
*/
String apiKey();

/**
* 获取扩展信息。
*
* @return 表示扩展信息的 {@link Map}{@code <}{@link String}{@code , }{@link Object}{@code >}。
*/
Map<String, Object> extensions();

/**
* 表示 {@link EmbedOption} 的构建器。
*/
Expand All @@ -48,6 +57,14 @@ interface Builder {
*/
Builder apiKey(String apiKey);

/**
* 设置扩展信息。
*
* @param extensions 表示扩展信息的 {@link Map}{@code <}{@link String}{@code , }{@link Object}{@code >}。
* @return 表示当前构建器的 {@link Builder}。
*/
Builder extensions(Map<String, Object> extensions);

/**
* 构建 {@link EmbedOption} 实例。
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

import modelengine.fitframework.pattern.builder.BuilderFactory;

import java.util.Map;

/**
* 表示图像生成模型参数的实体。
*
Expand Down Expand Up @@ -42,6 +44,13 @@ public interface ImageOption {
*/
String apiKey();

/**
* 获取扩展信息。
*
* @return 表示扩展信息的 {@link Map}{@code <}{@link String}{@code , }{@link Object}{@code >}。
*/
Map<String, Object> extensions();

/**
* 表示 {@link ImageOption} 的构建器。
*/
Expand Down Expand Up @@ -78,6 +87,14 @@ interface Builder {
*/
Builder baseUrl(String baseUrl);

/**
* 设置扩展信息。
*
* @param extensions 表示扩展信息的 {@link Map}{@code <}{@link String}{@code , }{@link Object}{@code >}。
* @return 表示当前构建器的 {@link Builder}。
*/
Builder extensions(Map<String, Object> extensions);

/**
* 构建 {@link ImageOption} 实例。
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
import modelengine.fel.core.model.http.SecureConfig;
import modelengine.fitframework.pattern.builder.BuilderFactory;

import java.util.Map;

/**
* 表示重排模型参数的实体。
*
Expand Down Expand Up @@ -57,6 +59,13 @@ public interface RerankOption {
*/
SecureConfig secureConfig();

/**
* 获取扩展信息。
*
* @return 表示扩展信息的 {@link Map}{@code <}{@link String}{@code , }{@link Object}{@code >}。
*/
Map<String, Object> extensions();

/**
* {@link RerankOption} 的构建器。
*/
Expand Down Expand Up @@ -109,6 +118,14 @@ interface Builder {
*/
Builder secureConfig(SecureConfig secureConfig);

/**
* 设置扩展信息。
*
* @param extensions 表示扩展信息的 {@link Map}{@code <}{@link String}{@code , }{@link Object}{@code >}。
* @return 表示当前构建器的 {@link Builder}。
*/
Builder extensions(Map<String, Object> extensions);

/**
* 构建对象。
*
Expand Down