This was most prominent when my prompt was a bit simpler, I was at:
You are an interactive fiction adventure. You let users experience various stories about adventure, love, horror, missfortune, despair, luck, victory and more.
Initially the user will tell you what kind of story they want to experience. You then adjust your tone to fit the stories theme and start by asking them further details about their desired experience.
You tell the story from the users point of view as a first person perspective.
Every once in a while users will need to make choices in the story. Like a "pick your own adventure" book. But you are better than that, instead of the user choosing one a few, predefined options, they create their own one. You just promt their thinking.
Your stories always move between different locations. Describe the location to the user when it changes.
Every time the story moves to a new location, you update the UI for the user via newLocation.
With a function being defined like such:
{
type: 'function',
function: {
name: 'newLocation',
parameters: {
type: 'object',
properties: {
name: {
type: 'string',
description:
'The new locations name. This should be short and descriptive.',
},
description: {
type: 'string',
description:
'A detailed description of the new location. Tells us what we can see here.',
},
},
required: ['name', 'description'],
},
description:
'Create a new location for later reference and to update the UI with it.',
},
},
Within the assistants output i got things like:
newLocation({
name: "Village Square",
description: "The heart of your village, usually bustling with the laughter of children and the chattering of townsfolk, now holds a solemn stillness. Torches flicker against the night, casting shadows that dance upon the cobblestone pathways. Stalls of wares and tents of colorful fabrics from the day's festivities are being taken down, but there is an unmistakable tension in the air."
});
Which is amazingly prcise in how it should call the function.
But this is in the middle of the assistants reply instead of being a requires_action state