Spaces:
Sleeping
Sleeping
| import boto3 | |
| import sounddevice as sd | |
| import numpy as np | |
| import base64 | |
| from config import MODEL_ID, REGION, SAMPLE_RATE | |
| def start_nova_stream(session_id): | |
| client = boto3.client("bedrock-runtime", region_name=REGION) | |
| stream = client.invoke_model_with_bidirectional_stream( | |
| modelId=MODEL_ID, | |
| body=b'', | |
| contentType="application/vnd.amazon.eventstream", | |
| accept="application/vnd.amazon.eventstream" | |
| ) | |
| # NOTE: Full real-time stream logic omitted for brevity | |
| print(f"Started Nova stream for session {session_id}") | |