mirror of
https://github.com/MervinPraison/PraisonAI.git
synced 2026-11-12 18:47:44 -10:00
Change realtime_connect/arealtime_connect and the CLI realtime handler default from the deprecated gpt-4o-realtime-preview to the GA gpt-realtime id, and update the example. Explicit model strings are unchanged. Co-authored-by: Dhivya-Bharathy <[email protected]>
24 lines
692 B
Python
24 lines
692 B
Python
"""
|
|
Realtime Capability Example
|
|
|
|
Demonstrates realtime session creation for audio/video streaming.
|
|
"""
|
|
|
|
from praisonai.capabilities import realtime_connect
|
|
|
|
# Create a realtime session
|
|
print("=== Realtime Session ===")
|
|
session = realtime_connect(
|
|
model="gpt-realtime",
|
|
modalities=["text", "audio"],
|
|
voice="alloy"
|
|
)
|
|
print(f"Session ID: {session.id}")
|
|
print(f"Status: {session.status}")
|
|
print(f"URL: {session.url}")
|
|
print(f"Modalities: {session.metadata.get('modalities')}")
|
|
print(f"Voice: {session.metadata.get('voice')}")
|
|
|
|
print("\nNote: To use this session, connect via WebSocket to the URL above.")
|
|
print("See OpenAI Realtime API documentation for WebSocket protocol details.")
|