-
Notifications
You must be signed in to change notification settings - Fork 69
Adding a new example to exemplify the bot-output RTVI event #109
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
base: main
Are you sure you want to change the base?
Conversation
294dab7 to
818e46b
Compare
1e742fb to
337cb6c
Compare
00485f9 to
f2b80ee
Compare
markbackman
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Off to a good start! Just some minor clean up before this is ready.
code-helper/client/package.json
Outdated
| "preview": "vite preview" | ||
| }, | ||
| "dependencies": { | ||
| "@pipecat-ai/client-js": "file:../../../pipecat-client-web/client-js", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update with the latest client releases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the future, it would be nice to refactor to use the voice-ui-kit (or add a voice-ui-kit example doing the same thing).
code-helper/client/src/app.js.bak
Outdated
| @@ -0,0 +1,244 @@ | |||
| import { PipecatClient, RTVIEvent } from '@pipecat-ai/client-js'; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove?
code-helper/server/pyproject.toml
Outdated
| description = "Voice AI bot built with Pipecat" | ||
| requires-python = ">=3.10" | ||
| dependencies = [ | ||
| "pipecat-ai[deepgram,cartesia, elevenlabs,local-smart-turn-v3,openai,runner,silero,webrtc]", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's set a minimum version to ensure the right pipecat-ai version is installed.
| "pipecat-ai[deepgram,cartesia, elevenlabs,local-smart-turn-v3,openai,runner,silero,webrtc]", | |
| "pipecat-ai[deepgram,cartesia, elevenlabs,local-smart-turn-v3,openai,runner,silero,webrtc]>=0.0.96", |
code-helper/server/pyproject.toml
Outdated
| select = ["I"] | ||
|
|
||
| [tool.uv.sources] | ||
| pipecat-ai = { path = "../../../pipecat", editable = true } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can remove tool.uv.sources now.
code-helper/server/bot.py
Outdated
| pipeline = Pipeline( | ||
| [ | ||
| transport.input(), | ||
| rtviIn, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To align with other examples, this should be just rtvi:
| rtviIn, | |
| rtvi, |
code-helper/server/bot.py
Outdated
| return "XXXX-XXXX-XXXX-" + text[-4:] | ||
|
|
||
| rtviIn = RTVIProcessor() | ||
| rtviOut = RTVIObserver(rtviIn) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe rtvi_observer to make it more clear what this is (also using snake_case for python).
| rtviOut = RTVIObserver(rtviIn) | |
| rtvi_observer = RTVIObserver(rtvi) |
code-helper/server/bot.py
Outdated
| async def obfuscate_credit_card(text: str, type: str) -> str: | ||
| return "XXXX-XXXX-XXXX-" + text[-4:] | ||
|
|
||
| rtviIn = RTVIProcessor() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Align with how RTVI is referenced in other examples.
| rtviIn = RTVIProcessor() | |
| rtvi = RTVIProcessor() |
code-helper/server/bot.py
Outdated
|
|
||
| rtviIn = RTVIProcessor() | ||
| rtviOut = RTVIObserver(rtviIn) | ||
| rtviOut.add_bot_output_transformer(obfuscate_credit_card, "credit_card") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| rtviOut.add_bot_output_transformer(obfuscate_credit_card, "credit_card") | |
| rtvi_observer.add_bot_output_transformer(obfuscate_credit_card, "credit_card") |
code-helper/server/bot.py
Outdated
| enable_metrics=True, | ||
| enable_usage_metrics=True, | ||
| ), | ||
| observers=[rtviOut], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sticking with the change from above.
| observers=[rtviOut], | |
| observers=[rtvi_observer], |
4b3b4d3 to
ed38034
Compare
ed38034 to
aa23015
Compare
markbackman
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.

TODO: Update existing examples to use bot-output