You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * <p> * http://www.apache.org/licenses/LICENSE-2.0 * <p> * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */packagecom.qlangtech.tis.plugin.ontology;importcom.alibaba.citrus.turbine.Context;importcom.qlangtech.tis.aiagent.llm.LLMProvider;importcom.qlangtech.tis.extension.DescriptorUseableShortComment;importcom.qlangtech.tis.extension.TISExtension;importcom.qlangtech.tis.plugin.annotation.FormField;importcom.qlangtech.tis.plugin.annotation.FormFieldType;importcom.qlangtech.tis.plugin.annotation.Validator;importcom.qlangtech.tis.runtime.module.misc.IControlMsgHandler;importcom.qlangtech.tis.util.IPluginContext;importcom.qlangtech.tis.util.UploadPluginMeta;importjava.util.Optional;importstaticcom.qlangtech.tis.manage.common.UserProfile.KEY_FIELD_LLM_NAME;/** * 开启智能问数,design/chat-bi/06-neo4j-ontology-sync.md * * @author 百岁 (baisui@qlangtech.com) * @date 2026/5/28 */publicclassEnableChatBIextendsOntologyDomainManipulate { /** * 大模型接口 */@FormField(type = FormFieldType.SELECTABLE, ordinal = 1, validate = {Validator.identity}) publicStringllm; @OverridepublicvoidmanipuldateProcess(IPluginContextpluginContext, UploadPluginMetapluginMeta, Optional<Context> context) { } @TISExtensionpublicstaticfinalclassDftDescextendsOntologyDomainManipulate.BasicDescimplementsDescriptorUseableShortComment { publicDftDesc() { super(); // List<Pair<OntologyDomain, IPluginStore<OntologyDomain>>> domainList = OntologyDomain // .getDoaminList(); // List<OntologyDomain> domains = domainList.stream().map(Pair::getKey).toList(); // this.registerSelectOptions("ontologyDomain", () -> domains); this.registerSelectOptions(KEY_FIELD_LLM_NAME, LLMProvider::getExistProviders); } @Override protected boolean validateAll(IControlMsgHandler msgHandler, Context context, PostFormVals postFormVals) { // // return super.validateAll(msgHandler, context, postFormVals); // OntologyPluginMeta ometa = getOntologyPluginMeta((IPluginContext) msgHandler, Optional.of // (context)); // // List<OntologyObjectType> objectTypes = OntologyObjectType.loadAll(ometa.getDomain()); // if (objectTypes.isEmpty()) { // throw new IllegalStateException("domain '" + ometa.getDomain() // + "' has no ObjectType, please export tables first"); // } // Optional<OntologyProperty> pk = null; // List<OntologyObjectType> lackPkObjTypes = Lists.newArrayList(); // for (OntologyObjectType objType : objectTypes) { // pk = objType.getPk(); // if (!pk.isPresent()) { // lackPkObjTypes.add(objType); // } // } // // if (CollectionUtils.isNotEmpty(lackPkObjTypes)) { // msgHandler.addErrorMessage(context, // "对象还未设置主键,完成后继续此操作:" // // + lackPkObjTypes.stream() // // .map((obj) -> "'" + obj.getName() + "'").collect(Collectors.joining(", // "))); // return false; // } return true; } @Override public String getDisplayName() { return "Enable ChatBI"; } @Override public String shortComment() { return "开启自然语言统计问数功能"; } }}
1
+
/**
2
+
* Licensed to the Apache Software Foundation (ASF) under one
3
+
* or more contributor license agreements. See the NOTICE file
4
+
* distributed with this work for additional information
5
+
* regarding copyright ownership. The ASF licenses this file
6
+
* to you under the Apache License, Version 2.0 (the
7
+
* "License"); you may not use this file except in compliance
8
+
* with the License. You may obtain a copy of the License at
9
+
* <p>
10
+
* http://www.apache.org/licenses/LICENSE-2.0
11
+
* <p>
12
+
* Unless required by applicable law or agreed to in writing, software
13
+
* distributed under the License is distributed on an "AS IS" BASIS,
14
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+
* See the License for the specific language governing permissions and
Copy file name to clipboardExpand all lines: tis-ontology-plugin/src/main/java/com/qlangtech/tis/plugin/ontology/impl/domain/DefaultOntologyDomain.java
0 commit comments