I have a function that returns a formatted “values card” (something with a bolded title and a description).
I want to show this to the user in exactly the way that it was returned by the function, but when calling the API with the function response, to generate a text message for the user-facing conversation:
const res = await openai.createChatCompletion({
model: "gpt-3.5-turbo-0613",
messages: [
...messages,
{
role: "function",
name: func.name,
content: result, // the formatted values card
},
],
temperature: 0.7,
functions,
stream: true,
})
The resulting stream botches the formatting and writes something in free-text.
What is the best way to steer the way that the function result is formatted?
I’ve tried:
- Be explicit of how the result should be handled in the function description.
- Be explicit of how the result should be handled in the system prompt.