File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
src/main/java/oakbot/listener/chatgpt Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -161,8 +161,7 @@ public void run(IBot bot) throws Exception {
161161 continue ;
162162 }
163163
164- var prompt = buildPrompt (roomId , bot );
165- prompt += " Nobody is talking to you directly; you are just sharing your thoughts." ;
164+ var prompt = buildPromptForSpontaneousPost (roomId , bot );
166165
167166 var apiMessages = buildChatCompletionMessages (prompt , messages , bot );
168167
@@ -328,6 +327,18 @@ public String buildPrompt(int roomId, IBot bot) {
328327 prompt = prompt .replace ("$ROOMNAME" , roomName );
329328 }
330329
330+ /*
331+ * ChatGPT stopped doing this in gpt-5. The SO chat post is converted to
332+ * monospace if these are detected.
333+ */
334+ prompt += " Surround all code blocks with ``` markdown syntax." ;
335+
336+ return prompt ;
337+ }
338+
339+ public String buildPromptForSpontaneousPost (int roomId , IBot bot ) {
340+ var prompt = buildPrompt (roomId , bot );
341+ prompt += " Nobody is talking to you directly; you are just sharing your thoughts." ;
331342 return prompt ;
332343 }
333344
You can’t perform that action at this time.
0 commit comments