Skip to content

Commit de62aa7

Browse files
committed
Merge branch '1.3.x'
2 parents 0ce6f31 + 72eca5c commit de62aa7

File tree

15 files changed

+40
-32
lines changed

15 files changed

+40
-32
lines changed

agent-flow/src/components/common/prompt/Prompt.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ export const Prompt = (
105105
>
106106
<TextArea
107107
disabled={disabled}
108-
maxLength={2000}
108+
maxLength={5000}
109109
className='jade-textarea-input jade-font-size'
110110
onBlur={(e) => changeOnBlur(e)}
111111
placeholder={placeHolder}

agent-flow/src/components/common/prompt/PromptDrawer.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ const _PromptDrawer = (
4646
onConfirm,
4747
allowAIGenerate,
4848
onAIGenerate,
49-
maxLength = 2000,
49+
maxLength = 5000,
5050
labelName
5151
}) => {
5252
const {t} = useTranslation();

app-builder/plugins/aipp-plugin/src/main/java/modelengine/fit/jober/aipp/converters/impl/AppVersionToAppDtoConverter.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import modelengine.fit.jober.aipp.util.JsonUtils;
2424

2525
import modelengine.fitframework.annotation.Component;
26+
import modelengine.fitframework.annotation.Value;
2627
import modelengine.fitframework.inspection.Validation;
2728
import modelengine.fitframework.util.ObjectUtils;
2829

@@ -47,6 +48,9 @@ public class AppVersionToAppDtoConverter implements EntityConverter {
4748
private static final String FORM_PROPERTY_GROUP_NULL = "null";
4849
private final IconConverter iconConverter;
4950

51+
@Value("${app-engine.chat-path.format}")
52+
private String chatPathFormat;
53+
5054
@Override
5155
public Class<AppVersion> source() {
5256
return AppVersion.class;
@@ -83,7 +87,7 @@ public AppBuilderAppDto convert(Object appVersion) {
8387
.configFormProperties(this.buildConfigFormProperties(s.getFormProperties()));
8488
Optional.ofNullable(s.getData().getPath())
8589
.filter(path -> !path.isEmpty())
86-
.ifPresent(path -> appDtoBuilder.chatUrl(String.format("/chat/%s", path)));
90+
.ifPresent(path -> appDtoBuilder.chatUrl(String.format(this.chatPathFormat, path)));
8791
return appDtoBuilder.build();
8892
}).orElse(null);
8993
}

app-builder/plugins/aipp-plugin/src/main/java/modelengine/fit/jober/aipp/domains/appversion/AppVersion.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@ public class AppVersion {
199199
private final FlowDefinitionService flowDefinitionService;
200200
private final KnowledgeCenterService knowledgeCenterService;
201201
private final String resourcePath;
202+
private final String chatPathFormat;
202203

203204
AppVersion(AppBuilderAppPo data, Dependencies dependencies) {
204205
this.data = data;
@@ -233,6 +234,7 @@ public class AppVersion {
233234
this.maxUserContextLen = dependencies.getMaxUserContextLen();
234235
this.knowledgeCenterService = dependencies.getKnowledgeCenterService();
235236
this.resourcePath = dependencies.getResourcePath();
237+
this.chatPathFormat = dependencies.getChatPathFormat();
236238
}
237239

238240
/**
@@ -344,12 +346,17 @@ public void publish(PublishContext context) {
344346
// 判断版本是否已存在.
345347
this.validateVersion(context);
346348

349+
// 发布时候需要用到 path 字段,所以需要提前生成一个唯一的 path
350+
if (StringUtils.isBlank(this.data.getPath())) {
351+
this.data.setPath(this.generateUniquePath());
352+
}
353+
347354
// 发布.
348355
List<Publisher> publishers = new ArrayList<>();
349356
publishers.add(new GraphPublisher(this.flowGraphRepository));
350357
publishers.add(new FormProperyPublisher(this.formPropertyRepository));
351358
publishers.add(new FlowPublisher(this.flowsService));
352-
publishers.add(new StorePublisher(this.appService, this.pluginService, this.toolService));
359+
publishers.add(new StorePublisher(this.appService, this.pluginService, this.toolService, this.chatPathFormat));
353360
publishers.add(new TaskPublisher(this.appTaskService));
354361
publishers.forEach(p -> p.publish(context, this));
355362

@@ -364,9 +371,6 @@ public void publish(PublishContext context) {
364371
this.attributes.put(PUBLISH_UPDATE_DESCRIPTION_KEY, context.getPublishData().getPublishedDescription());
365372
this.attributes.put(PUBLISH_UPDATE_LOG_KEY, context.getPublishData().getPublishedUpdateLog());
366373
this.attributes.put(ATTR_APP_IS_UPDATE, true);
367-
if (StringUtils.isBlank(this.data.getPath())) {
368-
this.data.setPath(this.generateUniquePath());
369-
}
370374
this.appVersionRepository.update(this);
371375
}
372376

app-builder/plugins/aipp-plugin/src/main/java/modelengine/fit/jober/aipp/domains/appversion/AppVersionFactory.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ public class AppVersionFactory {
7171
private final KnowledgeCenterService knowledgeCenterService;
7272
private final String resourcePath;
7373
private final IconConverter iconConverter;
74+
private final String chatPathFormat;
7475

7576
public AppVersionFactory(AppBuilderFormPropertyRepository formPropertyRepository, AppTaskService appTaskService,
7677
AppBuilderConfigRepository configRepository, AppBuilderFormRepository formRepository,
@@ -85,7 +86,7 @@ public AppVersionFactory(AppBuilderFormPropertyRepository formPropertyRepository
8586
@Value("${app-engine.question.max-length}") Integer maxQuestionLen,
8687
@Value("${app-engine.user-context.max-length}") Integer maxUserContextLen,
8788
KnowledgeCenterService knowledgeCenterService, @Value("${app-engine.resource.path}") String resourcePath,
88-
IconConverter iconConverter) {
89+
IconConverter iconConverter, @Value("${app-engine.chat-path.format}") String chatPathFormat) {
8990
this.formPropertyRepository = formPropertyRepository;
9091
this.appTaskService = appTaskService;
9192
this.configRepository = configRepository;
@@ -112,6 +113,7 @@ public AppVersionFactory(AppBuilderFormPropertyRepository formPropertyRepository
112113
this.knowledgeCenterService = knowledgeCenterService;
113114
this.resourcePath = resourcePath;
114115
this.iconConverter = iconConverter;
116+
this.chatPathFormat = chatPathFormat;
115117
}
116118

117119
/**
@@ -150,6 +152,7 @@ public AppVersion create(AppBuilderAppPo data, AppVersionRepository appVersionRe
150152
.knowledgeCenterService(this.knowledgeCenterService)
151153
.resourcePath(this.resourcePath)
152154
.iconConverter(this.iconConverter)
155+
.chatPathFormat(this.chatPathFormat)
153156
.build());
154157
}
155158
}

app-builder/plugins/aipp-plugin/src/main/java/modelengine/fit/jober/aipp/domains/appversion/Dependencies.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,4 +70,5 @@ public class Dependencies {
7070
private KnowledgeCenterService knowledgeCenterService;
7171
private String resourcePath;
7272
private IconConverter iconConverter;
73+
private String chatPathFormat;
7374
}

app-builder/plugins/aipp-plugin/src/main/java/modelengine/fit/jober/aipp/domains/appversion/publish/StorePublisher.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
package modelengine.fit.jober.aipp.domains.appversion.publish;
88

9+
import modelengine.fitframework.util.StringUtils;
910
import modelengine.jade.store.service.ToolService;
1011
import modelengine.fit.jane.task.util.Entities;
1112
import modelengine.fit.jober.WaterFlowService;
@@ -29,6 +30,7 @@
2930

3031
import java.util.Collections;
3132
import java.util.HashMap;
33+
import java.util.HashSet;
3234
import java.util.List;
3335
import java.util.Map;
3436
import java.util.Set;
@@ -44,6 +46,7 @@ public class StorePublisher implements Publisher {
4446
private final AppService appService;
4547
private final PluginService pluginService;
4648
private final ToolService toolService;
49+
private final String chatPathFormat;
4750

4851
@Override
4952
public void publish(PublishContext context, AppVersion appVersion) {
@@ -84,7 +87,12 @@ private AppPublishData buildItemData(PublishContext context, AppVersion appVersi
8487
itemData.setUniqueName(appVersion.getData().getUniqueName());
8588
itemData.setSchema(ToolSchemaBuilder.create(context).build());
8689
itemData.setSource(appCategory.getSource());
87-
itemData.setTags(Set.of(appCategory.getTag()));
90+
Set<String> tag = new HashSet<>();
91+
tag.add(appCategory.getTag());
92+
if (StringUtils.isNotBlank(appVersion.getClassification())) {
93+
tag.add(appVersion.getClassification());
94+
}
95+
itemData.setTags(tag);
8896
itemData.setRunnables(this.buildRunnables(context, appVersion));
8997
itemData.setUserGroupId(context.getPublishData().getUserGroupId());
9098
return itemData;
@@ -101,6 +109,7 @@ private Map<String, Object> buildRunnables(PublishContext context, AppVersion ap
101109
.put("aippId", appVersion.getData().getAppSuiteId())
102110
.put("version", context.getPublishData().getVersion())
103111
.put("appCategory", context.getPublishData().getAppCategory())
112+
.put("chatPath", String.format(this.chatPathFormat, appVersion.getData().getPath()))
104113
.build();
105114
runnablesMap.put("APP", app);
106115
return runnablesMap;

app-builder/plugins/aipp-plugin/src/main/java/modelengine/fit/jober/aipp/service/impl/RetrievalNodeChecker.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,8 @@
66

77
package modelengine.fit.jober.aipp.service.impl;
88

9-
import modelengine.fit.jane.common.entity.OperationContext;
10-
import modelengine.fit.jober.aipp.dto.check.AppCheckDto;
11-
import modelengine.fit.jober.aipp.dto.check.CheckResult;
12-
139
import modelengine.fitframework.annotation.Component;
1410

15-
import java.util.List;
16-
1711
/**
1812
* 普通检索节点的checker
1913
*
@@ -22,8 +16,4 @@
2216
*/
2317
@Component
2418
public class RetrievalNodeChecker extends AbstractNodeChecker {
25-
@Override
26-
public List<CheckResult> validate(AppCheckDto appCheckDto, OperationContext context) {
27-
return this.invalidNodeConfig(appCheckDto, appCheckDto.getType());
28-
}
2919
}

app-builder/plugins/aipp-plugin/src/main/resources/application.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ app-engine:
6262
max-length: 500
6363
plugin:
6464
system-creator: 'system'
65+
chat-path:
66+
format: '/chat/%s'
6567
elsa:
6668
endpoint:
6769
elsaKey:

app-builder/plugins/aipp-plugin/src/test/java/modelengine/fit/jober/aipp/domains/appversion/AppVersionTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ public void setUp() {
205205
300,
206206
this.knowledgeCenterService,
207207
"/var/share",
208-
this.iconConverter);
208+
this.iconConverter, "/chat/%s");
209209
when(this.iconConverter.toFrontend(anyString())).thenReturn("/v1/api");
210210
when(this.iconConverter.toStorage(anyString())).thenReturn("/v1/api");
211211
}

0 commit comments

Comments
 (0)