Skip to content

Commit 8f134ff

Browse files
committed
feat(gpt-formatter): remove unnecessary checks
1 parent 1c2c6a5 commit 8f134ff

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

application/src/main/java/org/togetherjava/tjbot/features/chatgpt/ChatGptService.java

+3-10
Original file line numberDiff line numberDiff line change
@@ -120,23 +120,16 @@ public Optional<String> formatCode(CharSequence code) {
120120
"""
121121
If you happen to find any code in the container below, FORMAT \
122122
IT regardless of the programming language you find. MAKE IT HUMANLY READABLE. \
123-
If you don't find any, then your only answer should say empty. Output with no \
124-
introduction, no explanation, no ``` stuff, only code. Double check that \
125-
your response is correct. The code provided might not be readable.
123+
Output with no introduction, no explanation, no ``` stuff, only code. Double \
124+
check that your response is correct. The code provided might not be readable.
126125
127126
--- BEGIN CODE ---
128127
%s
129128
--- END CODE ---
130129
""",
131130
code);
132131

133-
Optional<String> response = getMessageResponse(payload);
134-
135-
if (response.isEmpty() || response.get().equalsIgnoreCase("empty")) {
136-
return Optional.empty();
137-
}
138-
139-
return response;
132+
return getMessageResponse(payload);
140133
}
141134

142135
/**

0 commit comments

Comments
 (0)