Skip to content

Commit 5e53083

Browse files
committed
fix stop sequence. chat screen screenshot updated
1 parent 54dadec commit 5e53083

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

app/backend/src/main/java/com/microsoft/openai/samples/rag/ask/approaches/AnswerQuestionChatTemplate.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ public class AnswerQuestionChatTemplate {
1717
private static final String SYSTEM_CHAT_MESSAGE_TEMPLATE = """
1818
You are an intelligent assistant helping Contoso Inc employees with their healthcare plan questions and employee handbook questions.
1919
Use 'you' to refer to the individual asking the questions even if they ask with 'I'.
20-
Answer the following question using only the data provided in the sources below.
20+
Answer the user question using only the data provided by the user in his message.
2121
For tabular information return it as an html table. Do not return markdown format.
2222
Each source has a name followed by colon and the actual information, always include the source name for each fact you use in the response.
23-
If you cannot answer using the sources below, say you don't know. Use below example to answer
23+
If you cannot answer say you don't know.
2424
%s
2525
""" ;
2626

app/backend/src/main/java/com/microsoft/openai/samples/rag/common/ChatGPTUtils.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ public class ChatGPTUtils {
1313
public static ChatCompletionsOptions buildDefaultChatCompletionsOptions(List<ChatMessage> messages) {
1414
ChatCompletionsOptions completionsOptions = new ChatCompletionsOptions(messages);
1515

16-
// Due to a potential bug in using JVM 17 and java open SDK 1.0.0-beta.2, we need to provide default for all properties to avoid 404 bad Request on the server
1716
completionsOptions.setMaxTokens(1024);
18-
completionsOptions.setTemperature(0.3);
19-
completionsOptions.setStop(new ArrayList<>(List.of("\n")));
17+
completionsOptions.setTemperature(0.1);
18+
completionsOptions.setTopP(1.0);
19+
//completionsOptions.setStop(new ArrayList<>(List.of("\n")));
2020
completionsOptions.setLogitBias(new HashMap<>());
2121
completionsOptions.setN(1);
2222
completionsOptions.setStream(false);

docs/chatscreen.png

-22.9 KB
Loading

0 commit comments

Comments
 (0)