Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syncing long conversations conversation.item.create #464

Open
josancamon19 opened this issue Oct 28, 2024 · 0 comments
Open

Syncing long conversations conversation.item.create #464

josancamon19 opened this issue Oct 28, 2024 · 0 comments

Comments

@josancamon19
Copy link

I've cached the items conversation, when syncing a page reload, to continue the conversation, or after 15min disconnect.

I tried sending user audio input, assistant text messages, 1 by 1.

The conversations get's received in items.events, but all the audio inputs sent, end up being returned as an empty Int16Array.

const addUserMessageAudio = (id: string, audio: Int16Array, text: string, previousItemId: string | undefined) => {
    console.log('~addUserMessageAudio', { id, text, previousItemId, audioLength: audio.length });
    clientRef.current.realtime.send('conversation.item.create', {
      item: {
        type: 'message',
        role: 'user',
        status: 'completed',
        content: [{ type: 'input_audio', audio: RealtimeUtils.arrayBufferToBase64(audio), transcript: text }],
        // content: [{ type: 'input_text', text: text }], 
      },
    });
  }

And if send the text, then when I speak to the model, it only responds with text, doesn't send any audio at that point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant