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

OpenAI Realtime demo #285

Merged
merged 5 commits into from
Oct 22, 2024
Merged

OpenAI Realtime demo #285

merged 5 commits into from
Oct 22, 2024

Conversation

FelonEkonom
Copy link
Member

No description provided.


## Description and steps

This demo shows how to use Membrane Framework to create a simple app that allows you to have a conversation with ChatGPT using the newest OpenAI Realtime API.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about linking to OpenAI page here?

)
end

def handle_frame(frame, state) do
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
def handle_frame(frame, state) do
@impl true
def handle_frame(frame, state) do

end
```

Then, we will write a Membrane Element that will receive and send raw audio frames via the WebSocket.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Then, we will write a Membrane Element that will receive and send raw audio frames via the WebSocket.
Then, we will create a Membrane Element that will receive and send raw audio frames via the WebSocket.

Because WebRTC requires and provides audio in OPUS format and OpenAI Realtime API uses raw audio, we have to spawn the proper encoder and decoder between WebRTC and OpenAI elements.

```elixir
defmodule BrowserToOpenAi do
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
defmodule BrowserToOpenAi do
defmodule BrowserToOpenAI do

:ok
```

Now, let's start the pipeline. Enter <http://localhost:8000/index.html> from the new tab of Google Chrome and start your conversation with the AI!
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's move the sentence starting at "Enter ..." below the code snippet


## Description and steps

This demo shows how to use Membrane Framework to create a simple app that allows you to have a conversation with ChatGPT using the newest OpenAI Realtime API.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about something like this?

Suggested change
This demo shows how to use Membrane Framework to create a simple app that allows you to have a conversation with ChatGPT using the newest OpenAI Realtime API.
This demo shows how to use Membrane Framework to create a simple WebRTC based app that allows you to have a conversation with ChatGPT using the newest OpenAI Realtime API.

Copy link
Contributor

@varsill varsill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🥇

@FelonEkonom FelonEkonom merged commit 7baf173 into master Oct 22, 2024
1 check passed
@FelonEkonom FelonEkonom deleted the openai-realtime-demo branch October 22, 2024 08:27
@FelonEkonom FelonEkonom self-assigned this Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants