Skip to content

Conversation

@mattieruth
Copy link
Contributor

TODO: Update existing examples to use bot-output

Copy link
Contributor

@markbackman markbackman left a 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.

"preview": "vite preview"
},
"dependencies": {
"@pipecat-ai/client-js": "file:../../../pipecat-client-web/client-js",
Copy link
Contributor

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.

Copy link
Contributor

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).

@@ -0,0 +1,244 @@
import { PipecatClient, RTVIEvent } from '@pipecat-ai/client-js';
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove?

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]",
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 set a minimum version to ensure the right pipecat-ai version is installed.

Suggested change
"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",

select = ["I"]

[tool.uv.sources]
pipecat-ai = { path = "../../../pipecat", editable = true }
Copy link
Contributor

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.

pipeline = Pipeline(
[
transport.input(),
rtviIn,
Copy link
Contributor

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:

Suggested change
rtviIn,
rtvi,

return "XXXX-XXXX-XXXX-" + text[-4:]

rtviIn = RTVIProcessor()
rtviOut = RTVIObserver(rtviIn)
Copy link
Contributor

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).

Suggested change
rtviOut = RTVIObserver(rtviIn)
rtvi_observer = RTVIObserver(rtvi)

async def obfuscate_credit_card(text: str, type: str) -> str:
return "XXXX-XXXX-XXXX-" + text[-4:]

rtviIn = RTVIProcessor()
Copy link
Contributor

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.

Suggested change
rtviIn = RTVIProcessor()
rtvi = RTVIProcessor()


rtviIn = RTVIProcessor()
rtviOut = RTVIObserver(rtviIn)
rtviOut.add_bot_output_transformer(obfuscate_credit_card, "credit_card")
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
rtviOut.add_bot_output_transformer(obfuscate_credit_card, "credit_card")
rtvi_observer.add_bot_output_transformer(obfuscate_credit_card, "credit_card")

enable_metrics=True,
enable_usage_metrics=True,
),
observers=[rtviOut],
Copy link
Contributor

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.

Suggested change
observers=[rtviOut],
observers=[rtvi_observer],

@markbackman markbackman marked this pull request as ready for review December 1, 2025 17:46
Copy link
Contributor

@markbackman markbackman left a comment

Choose a reason for hiding this comment

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

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.

3 participants