Skip to content

Commit ac09d2f

Browse files
committed
#5303 Fix build issues
1 parent 5bd0264 commit ac09d2f

6 files changed

Lines changed: 196 additions & 55 deletions

File tree

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
/*
2+
* Copyright 2016-2026 Crown Copyright
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package stroom.ai.impl;
18+
19+
import stroom.ai.shared.AiAttachmentStatus;
20+
import stroom.ai.shared.AiAttachmentType;
21+
import stroom.ai.shared.AiChat;
22+
import stroom.ai.shared.AiChatAttachment;
23+
import stroom.ai.shared.AiChatMessage;
24+
import stroom.ai.shared.AiMessageType;
25+
import stroom.ai.shared.FindAiChatHistoryCriteria;
26+
import stroom.util.shared.ResultPage;
27+
import stroom.util.shared.UserRef;
28+
29+
import java.util.List;
30+
import java.util.Optional;
31+
32+
public class MockAiDao implements AiDao {
33+
34+
@Override
35+
public AiChat createChat(final UserRef userRef) {
36+
return null;
37+
}
38+
39+
@Override
40+
public ResultPage<AiChat> listChats(final UserRef userRef, final FindAiChatHistoryCriteria criteria) {
41+
return null;
42+
}
43+
44+
@Override
45+
public Optional<AiChat> getChat(final int chatId) {
46+
return Optional.empty();
47+
}
48+
49+
@Override
50+
public void updateChatTitle(final int chatId, final String title) {
51+
52+
}
53+
54+
@Override
55+
public void deleteChat(final int chatId) {
56+
57+
}
58+
59+
@Override
60+
public AiChatMessage storeMessage(final int chatId, final AiMessageType messageType, final String message) {
61+
return null;
62+
}
63+
64+
@Override
65+
public AiChatMessage storeMessage(final int chatId,
66+
final AiMessageType messageType,
67+
final Integer attachmentId,
68+
final String message) {
69+
return null;
70+
}
71+
72+
@Override
73+
public List<AiChatMessage> getMessages(final int chatId) {
74+
return List.of();
75+
}
76+
77+
@Override
78+
public List<AiChatMessage> getMessagesSince(final int chatId, final int lastSeenMessageId) {
79+
return List.of();
80+
}
81+
82+
@Override
83+
public void updateMessageText(final int messageId, final String message) {
84+
85+
}
86+
87+
@Override
88+
public void deleteMessage(final int messageId) {
89+
90+
}
91+
92+
@Override
93+
public AiChatAttachment createAttachment(final int chatId, final AiAttachmentType type, final String contextJson) {
94+
return null;
95+
}
96+
97+
@Override
98+
public void updateAttachmentStatus(final int attachmentId,
99+
final AiAttachmentStatus status,
100+
final Integer rowCount,
101+
final String description,
102+
final String errorMessage,
103+
final boolean truncated) {
104+
105+
}
106+
107+
@Override
108+
public Optional<AiChatAttachment> getAttachment(final int attachmentId) {
109+
return Optional.empty();
110+
}
111+
112+
@Override
113+
public List<AiChatAttachment> getAttachmentsByChatId(final int chatId) {
114+
return List.of();
115+
}
116+
}

stroom-app/src/main/resources/ui/noauth/swagger/stroom.json

Lines changed: 36 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,7 @@
668668
"content" : {
669669
"application/json" : {
670670
"schema" : {
671-
"$ref" : "#/components/schemas/FindNamedEntityCriteria"
671+
"$ref" : "#/components/schemas/FindAiChatHistoryCriteria"
672672
}
673673
}
674674
},
@@ -14051,7 +14051,7 @@
1405114051
},
1405214052
"messageType" : {
1405314053
"type" : "string",
14054-
"enum" : [ "USER_MESSAGE", "AI_RESPONSE", "THINKING", "ERROR", "DASHBOARD_DATA", "QUERY_DATA", "TABLE_DATA", "ATTACHMENT" ]
14054+
"enum" : [ "USER_MESSAGE", "AI_RESPONSE", "WORKING", "ERROR", "DASHBOARD_DATA", "QUERY_DATA", "TABLE_DATA", "ATTACHMENT", "DEBUG_DETAIL", "THINKING" ]
1405514055
}
1405614056
}
1405714057
},
@@ -14594,7 +14594,13 @@
1459414594
"chatSystemPrompt" : {
1459514595
"type" : "string"
1459614596
},
14597-
"maxConversationHistoryMessages" : {
14597+
"enableDebugDetail" : {
14598+
"type" : "boolean"
14599+
},
14600+
"historySummaryPrompt" : {
14601+
"type" : "string"
14602+
},
14603+
"maxHistorySafetyCapMessages" : {
1459814604
"type" : "integer",
1459914605
"format" : "int32"
1460014606
},
@@ -17196,7 +17202,7 @@
1719617202
"properties" : {
1719717203
"fileType" : {
1719817204
"type" : "string",
17199-
"enum" : [ "EXCEL", "CSV", "TSV" ]
17205+
"enum" : [ "EXCEL", "CSV", "TSV", "MARKDOWN" ]
1720017206
},
1720117207
"percent" : {
1720217208
"type" : "integer",
@@ -17221,7 +17227,7 @@
1722117227
},
1722217228
"fileType" : {
1722317229
"type" : "string",
17224-
"enum" : [ "EXCEL", "CSV", "TSV" ]
17230+
"enum" : [ "EXCEL", "CSV", "TSV", "MARKDOWN" ]
1722517231
},
1722617232
"percent" : {
1722717233
"type" : "integer",
@@ -18643,6 +18649,27 @@
1864318649
}
1864418650
}
1864518651
},
18652+
"FindAiChatHistoryCriteria" : {
18653+
"type" : "object",
18654+
"properties" : {
18655+
"filter" : {
18656+
"type" : "string"
18657+
},
18658+
"pageRequest" : {
18659+
"$ref" : "#/components/schemas/PageRequest"
18660+
},
18661+
"sort" : {
18662+
"type" : "string",
18663+
"writeOnly" : true
18664+
},
18665+
"sortList" : {
18666+
"type" : "array",
18667+
"items" : {
18668+
"$ref" : "#/components/schemas/CriteriaFieldSort"
18669+
}
18670+
}
18671+
}
18672+
},
1864618673
"FindAnalyticDataShardCriteria" : {
1864718674
"type" : "object",
1864818675
"properties" : {
@@ -19019,27 +19046,6 @@
1901919046
}
1902019047
}
1902119048
},
19022-
"FindNamedEntityCriteria" : {
19023-
"type" : "object",
19024-
"properties" : {
19025-
"name" : {
19026-
"$ref" : "#/components/schemas/StringCriteria"
19027-
},
19028-
"pageRequest" : {
19029-
"$ref" : "#/components/schemas/PageRequest"
19030-
},
19031-
"sort" : {
19032-
"type" : "string",
19033-
"writeOnly" : true
19034-
},
19035-
"sortList" : {
19036-
"type" : "array",
19037-
"items" : {
19038-
"$ref" : "#/components/schemas/CriteriaFieldSort"
19039-
}
19040-
}
19041-
}
19042-
},
1904319049
"FindNodeGroupRequest" : {
1904419050
"type" : "object",
1904519051
"properties" : {
@@ -21740,6 +21746,9 @@
2174021746
"name" : {
2174121747
"type" : "string"
2174221748
},
21749+
"reasoningEffort" : {
21750+
"type" : "string"
21751+
},
2174321752
"type" : {
2174421753
"type" : "string"
2174521754
},
@@ -23868,7 +23877,7 @@
2386823877
"properties" : {
2386923878
"fileType" : {
2387023879
"type" : "string",
23871-
"enum" : [ "EXCEL", "CSV", "TSV" ]
23880+
"enum" : [ "EXCEL", "CSV", "TSV", "MARKDOWN" ]
2387223881
},
2387323882
"sendEmptyReports" : {
2387423883
"type" : "boolean"
@@ -26744,9 +26753,6 @@
2674426753
"multiSummaryMergePrompt" : {
2674526754
"type" : "string"
2674626755
},
26747-
"summaryMergePrompt" : {
26748-
"type" : "string"
26749-
},
2675026756
"tableQuerySystemPrompt" : {
2675126757
"type" : "string"
2675226758
},

stroom-app/src/main/resources/ui/noauth/swagger/stroom.yaml

Lines changed: 28 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ paths:
465465
content:
466466
application/json:
467467
schema:
468-
$ref: "#/components/schemas/FindNamedEntityCriteria"
468+
$ref: "#/components/schemas/FindAiChatHistoryCriteria"
469469
description: request
470470
required: true
471471
responses:
@@ -9671,12 +9671,14 @@ components:
96719671
enum:
96729672
- USER_MESSAGE
96739673
- AI_RESPONSE
9674-
- THINKING
9674+
- WORKING
96759675
- ERROR
96769676
- DASHBOARD_DATA
96779677
- QUERY_DATA
96789678
- TABLE_DATA
96799679
- ATTACHMENT
9680+
- DEBUG_DETAIL
9681+
- THINKING
96809682
AiChatPollRequest:
96819683
type: object
96829684
properties:
@@ -10232,7 +10234,11 @@ components:
1023210234
format: int64
1023310235
chatSystemPrompt:
1023410236
type: string
10235-
maxConversationHistoryMessages:
10237+
enableDebugDetail:
10238+
type: boolean
10239+
historySummaryPrompt:
10240+
type: string
10241+
maxHistorySafetyCapMessages:
1023610242
type: integer
1023710243
format: int32
1023810244
modelRef:
@@ -12384,6 +12390,7 @@ components:
1238412390
- EXCEL
1238512391
- CSV
1238612392
- TSV
12393+
- MARKDOWN
1238712394
percent:
1238812395
type: integer
1238912396
format: int32
@@ -12404,6 +12411,7 @@ components:
1240412411
- EXCEL
1240512412
- CSV
1240612413
- TSV
12414+
- MARKDOWN
1240712415
percent:
1240812416
type: integer
1240912417
format: int32
@@ -13510,6 +13518,20 @@ components:
1351013518
type: array
1351113519
items:
1351213520
$ref: "#/components/schemas/CriteriaFieldSort"
13521+
FindAiChatHistoryCriteria:
13522+
type: object
13523+
properties:
13524+
filter:
13525+
type: string
13526+
pageRequest:
13527+
$ref: "#/components/schemas/PageRequest"
13528+
sort:
13529+
type: string
13530+
writeOnly: true
13531+
sortList:
13532+
type: array
13533+
items:
13534+
$ref: "#/components/schemas/CriteriaFieldSort"
1351313535
FindAnalyticDataShardCriteria:
1351413536
type: object
1351513537
properties:
@@ -13776,20 +13798,6 @@ components:
1377613798
type: array
1377713799
items:
1377813800
$ref: "#/components/schemas/CriteriaFieldSort"
13779-
FindNamedEntityCriteria:
13780-
type: object
13781-
properties:
13782-
name:
13783-
$ref: "#/components/schemas/StringCriteria"
13784-
pageRequest:
13785-
$ref: "#/components/schemas/PageRequest"
13786-
sort:
13787-
type: string
13788-
writeOnly: true
13789-
sortList:
13790-
type: array
13791-
items:
13792-
$ref: "#/components/schemas/CriteriaFieldSort"
1379313801
FindNodeGroupRequest:
1379413802
type: object
1379513803
properties:
@@ -15847,6 +15855,8 @@ components:
1584715855
type: string
1584815856
name:
1584915857
type: string
15858+
reasoningEffort:
15859+
type: string
1585015860
type:
1585115861
type: string
1585215862
updateTimeMs:
@@ -17665,6 +17675,7 @@ components:
1766517675
- EXCEL
1766617676
- CSV
1766717677
- TSV
17678+
- MARKDOWN
1766817679
sendEmptyReports:
1766917680
type: boolean
1767017681
ReportUiDefaultConfig:
@@ -19844,8 +19855,6 @@ components:
1984419855
format: int32
1984519856
multiSummaryMergePrompt:
1984619857
type: string
19847-
summaryMergePrompt:
19848-
type: string
1984919858
tableQuerySystemPrompt:
1985019859
type: string
1985119860
tableQueryUserPrompt:

stroom-app/src/test/java/stroom/test/MockServiceModule.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
package stroom.test;
1818

1919
import stroom.activity.mock.MockActivityModule;
20+
import stroom.ai.impl.AiDao;
21+
import stroom.ai.impl.MockAiDao;
2022
import stroom.ai.impl.MockAiModule;
2123
import stroom.cache.impl.CacheModule;
2224
import stroom.cache.service.impl.CacheServiceModule;
@@ -123,6 +125,7 @@ protected void configure() {
123125
install(new MockClusterLockModule());
124126
install(new MockAiModule());
125127

128+
bind(AiDao.class).to(MockAiDao.class);
126129
bind(DictionaryStore.class).to(DictionaryStoreImpl.class);
127130
bind(ContentPackUserService.class).to(MockSecurityContext.class);
128131
bind(HttpClientFactory.class).to(BasicHttpClientFactory.class);

0 commit comments

Comments
 (0)