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

Updated websocket examples #15

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open

Conversation

marcelthomas5
Copy link
Contributor

No description provided.

Copy link
Collaborator

@lharries lharries left a comment

Choose a reason for hiding this comment

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

thanks!

examples/websockets/clients/alpha/next/.env.example Outdated Show resolved Hide resolved
examples/websockets/clients/alpha/next/src/app/page.tsx Outdated Show resolved Hide resolved
examples/websockets/servers/basic/node/src/index.ts Outdated Show resolved Hide resolved
examples/websockets/servers/node/src/index.ts Outdated Show resolved Hide resolved
examples/websockets/servers/node/src/index.ts Outdated Show resolved Hide resolved
examples/websockets/servers/node/src/latency.ts Outdated Show resolved Hide resolved
Comment on lines +83 to +88
print(f"first byte sent at: {time.time()}")
async for text in text_chunker(text_iterator):
await websocket.send(json.dumps({"text": text}))
await websocket.send(json.dumps({"text": "", "flush": True}))

await listen_task
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think there's some extra logging we could do here to make it clearer to the user

Screenshot main py — elevenlabs-developer-advocacy (Workspace) (Cursor) 2024-04-25 at 19 35@2x

Show time to first byte explicitly and other info on latency

@@ -0,0 +1,64 @@
import 'dotenv/config';
Copy link
Collaborator

Choose a reason for hiding this comment

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

when running this with the nextjs frontend I'm getting an error that the websocket can't be established

Screenshot ElevenLabs - Next js (Google Chrome) 2024-04-25 at 19 45@2x

(I'm using port 3005 on both as my port 5000 was busy)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This should work if the next app and express app are running on different available ports. Can you please try again?

@lharries
Copy link
Collaborator

lharries commented Apr 25, 2024

Also can you change all the models to the turbo models as they'll give the best results

@lharries
Copy link
Collaborator

lharries commented May 1, 2024

TODOs before merging for Marcel

// TODO: handle timeout between server and elevenlabs
// TODO: handle timeout between client and server
// TODO: get it working for the normal output format (mp3_44100)
// TODO: handle saying that it's the last input

Also note to self:

  • restructure to /incoming/node
  • remove the code which isn't node-express and vanilla JS for now until properly validated

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

Successfully merging this pull request may close these issues.

2 participants