Skip to main content

Code snippet

After adding the models, you can get a ready-to-use code snippet from the TrueFoundry platform or use the examples below. The example below demonstrates a realtime audio session, streaming microphone input to the model and playing back audio responses through the speaker. You can adapt the code to use other modalities as needed.
Amazon Nova Sonic (AWS Bedrock) uses HTTP/2 EventStream at /live/{account}/bedrock/..., not a WebSocket upgrade. See Nova Sonic (Bedrock) for the endpoint and Python example.