app_trial_current / nova_stream.py
SreekarB's picture
Upload 9 files
965274a verified
raw
history blame contribute delete
560 Bytes
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}")