Realtime Api: updating prompt during conversation

Im trying to update my prompt in the middle of a realtime conversation using session.update. i get back a notification session.updated, but the responses seem to ignore the new instructions. Any idea how can i change the bot behavior throughout the conversation ?

1 Like

I believe using session.update should work well for this. I was able to get it working successfully.
Would you mind sharing a snippet or an example of what you’ve tried so far? That way, we can better understand what went wrong.

This is my update:

const nprompt = {
          type: 'session.update',
          session: {
            instructions: message['response']['prompt'],
            input_audio_transcription: { model: 'whisper-1' },
          },
        };
        this.log('Updating prompt', nprompt);
        client.realtime.send(nprompt.type, nprompt);

I do get back: session.updated with the updated instruction, but it seems not to effect the ‘Bots’ interaction

1 Like

Did you end up figuring this out? I am having similar issues

You can use session.update to change the bot’s instructions, but it may not work right away. Make sure your update is clear. Also, the change may only work for new messages, not the current one.

Im using the session.update, but it doesn’t immediately effect the behavior, in some cases it responds based on the conversation progress so far