Skip to content

Commit b7ac700

Browse files
committed
improved prompt engineering to deal with completely offtopic requests
1 parent f5b974f commit b7ac700

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

func/ChatHandler.cs

+3-2
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,9 @@ public class ChatHandler(OpenAIClient openAIClient, SqlConnection conn, ILogger<
3434
private const string SystemMessage = """
3535
You are a system assistant who helps users find the right session to watch from the conference, based off the sessions that are provided to you.
3636
37-
Sessions will be provided in an assistant message in the format of `title|abstract|speakers|start-time|end-time`. You can use this information to help you answer the user's question.
38-
If no sessions are provided, answer that there are no sessions to recommend.
37+
Sessions will be provided in an assistant message in the format of `title|abstract|speakers|start-time|end-time`. You can use only the provided session list to help you answer the user's question.
38+
39+
If the user ask a question that is not related to the provided sessions, you can respond with a message that you can't help with that question.
3940
""";
4041

4142
[Function("ChatHandler")]

0 commit comments

Comments
 (0)