MCPcopy Create free account
hub / github.com/ModelEngine-Group/app-platform / SkillContent

Function SkillContent

agent-flow/src/components/llm/SkillForm.jsx:114–275  ·  view source on GitHub ↗
({toolOptions, disabled, dispatch, t})

Source from the content-addressed store, hash-verified

112 * @constructor
113 */
114export const SkillContent = ({toolOptions, disabled, dispatch, t}) => {
115 const shape = useShapeContext();
116
117 /**
118 * 根据标签类型返回不同的Icon
119 *
120 * @param tags 工具标签
121 */
122 const getIcon = (tags) => {
123 if (tags.includes(TOOL_TYPE.WATER_FLOW)) {
124 return WorkflowIcon;
125 } else {
126 return ToolIcon;
127 }
128 };
129
130 /**
131 * 获取工具类型
132 *
133 * @param tags 工具标签
134 * @returns {{}} 类型
135 */
136 const getType = (tags) => {
137 if (tags.includes(TOOL_TYPE.WATER_FLOW)) {
138 return 'workflow';
139 } else {
140 return 'tool';
141 }
142 };
143
144 /**
145 * 删除工具
146 *
147 * @param itemId 知识库id
148 */
149 const handleDelete = (itemId) => {
150 dispatch({type: 'deleteTool', value: itemId});
151 };
152
153 /**
154 * 查看工具详情
155 *
156 * @param item 条目,具体是一个工具的对象
157 */
158 const handleViewDetails = (e, item) => {
159 e.preventDefault();
160 e.stopPropagation(); // 阻止事件冒泡
161
162 // 获取 appId 和 tenantId
163 const appId = item.appId;
164 const tenantId = item.tenantId;
165
166 // 如果有 appId 和 tenantId,则跳转到工具流详情页
167 if (appId && tenantId) {
168 // 获取 endpoint 配置
169 const config = shape?.graph?.configs?.find(node => node.node === 'llmNodeState');
170 const endpoint = config?.urls?.endpoint || window.location.origin;
171

Callers

nothing calls this directly

Calls 7

useShapeContextFunction · 0.90
getIconFunction · 0.85
getValidatorOfSkillFunction · 0.85
getTypeFunction · 0.85
renderDeleteIconFunction · 0.70
mapMethod · 0.65
filterMethod · 0.45

Tested by

no test coverage detected