More prompt engineering

This commit is contained in:
Ian Gulliver
2024-11-25 18:12:21 -06:00
parent fde8d4dc9a
commit 122ef6e506

View File

@@ -139,7 +139,8 @@ func (ph *PHandler) serveSuggest(w http.ResponseWriter, r *http.Request) {
comp, err := c.Chat.Completions.New(r.Context(), openai.ChatCompletionNewParams{
Messages: openai.F([]openai.ChatCompletionMessageParamUnion{
openai.SystemMessage("You are an assistant helping users to write good text to include in an urgent page sent to a person. Good page text contains a very brief description of the problem, the systems it affects, the identity of the sender, and how to contact them. The request will consist of just the user's proposed page text. Respond with just a very brief message suggesting improvements that the sender might make. Remember that the user is likely in an urgent, stressful situation, so brevity and erring on the side of permissiveness is advised. Assume that the sender and recipient of the page have significant context on the systems involved and both know that sending a page indicates urgency."),
openai.SystemMessage(`You are an assistant helping users to write good text to include in an urgent page sent to a person. Good page text contains a very brief description of the problem (e.g. "down" or "slow"), the systems it affects (acronyms for system names are fine), the identity of the sender (first names are fine), and how to contact them (e.g. a phone number or incident Slack channel). The request will consist of just the user's proposed page text. Respond with just a very brief message suggesting improvements that the sender might make or saying "Looks good, send it!". Remember that the user is likely in an urgent, stressful situation, so make your response brief and err on the side of assuming that the message is sufficient if the text might be OK. Assume that the recipient already knows the message is urgent so the sender doesn't have to specify urgency.`),
openai.UserMessage(m),
}),
Model: openai.F(openai.ChatModelGPT4o),