Skip to content
This repository was archived by the owner on Jan 10, 2026. It is now read-only.

Commit e73fab4

Browse files
committed
Small Tweaks
1 parent 45d9b7c commit e73fab4

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

ChatGPT/src/main/java/cloud/cleo/squareup/ChatGPTLambda.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
import java.time.LocalTime;
3333
import java.time.ZoneId;
3434
import java.time.ZonedDateTime;
35-
import java.util.LinkedList;
35+
import java.util.ArrayList;
3636
import java.util.List;
3737
import java.util.Map;
3838
import java.util.Optional;
@@ -53,7 +53,7 @@
5353
public abstract class ChatGPTLambda {
5454

5555
// Initialize the Log4j logger.
56-
Logger log = LogManager.getLogger(ChatGPTLambda.class);
56+
final static Logger log = LogManager.getLogger(ChatGPTLambda.class);
5757

5858
public final static ObjectMapper mapper;
5959

@@ -175,7 +175,7 @@ protected LexV2Response processGPT(LexV2EventWrapper lexRequest) {
175175

176176
String botResponse;
177177
// Store all the calls made
178-
List<ChatFunctionCall> functionCallsMade = new LinkedList<>();
178+
List<ChatFunctionCall> functionCallsMade = new ArrayList<>();
179179
try {
180180
FunctionExecutor functionExecutor = AbstractFunction.getFunctionExecuter(lexRequest);
181181
functionExecutor.setObjectMapper(mapper);
@@ -331,7 +331,7 @@ private LexV2Response buildTerminatingResponse(LexV2EventWrapper lexRequest, Str
331331
*/
332332
private LexV2Response buildResponse(LexV2EventWrapper lexRequest, String response, ImageResponseCard card) {
333333

334-
final var messages = new LinkedList<LexV2Response.Message>();
334+
final var messages = new ArrayList<LexV2Response.Message>(card != null ? 2 : 1);
335335

336336
// Always send a plain text response
337337
// If this is not first in the list, Lex will error

ChimeSMA/src/main/java/cloud/cleo/chimesma/squareup/ChimeSMA.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import cloud.cleo.chimesma.actions.*;
44
import cloud.cleo.chimesma.model.ParticipantTag;
5-
import java.util.HashMap;
5+
import java.util.EnumMap;
66
import java.util.Locale;
77
import java.util.Map;
88
import java.util.function.Function;
@@ -73,7 +73,7 @@ public static Action getMainMenu() {
7373
};
7474

7575
// Map to Hold all all our Bots by Language
76-
Map<Language, StartBotConversationAction> botLangMap = new HashMap<>();
76+
Map<Language, StartBotConversationAction> botLangMap = new EnumMap<>(Language.class);
7777

7878
final var lexBotEN = StartBotConversationAction.builder()
7979
.withDescription("ChatGPT English")

0 commit comments

Comments
 (0)