-
Notifications
You must be signed in to change notification settings - Fork 301
Description
Describe the bug
StartConversationSessionAsync(model: "gpt-4o-mini-realtime-preview") experiences significant initialization delay of 4-6 seconds, likely due to model loading occurring during conversation startup. This impacts the user experience with noticeable pauses at the beginning of each conversation session.
Current Behavior:
Conversation startup takes 4-6 seconds
Model appears to be loaded synchronously during StartConversationSessionAsync
Users experience significant delays before conversation begins
Expected Behavior
Faster conversation initialization
Model preloading capability to eliminate startup delays
Graceful session management
Proposed Solution
-
Model Preloading: Introduce a method to preload models at the RealTimeClient level before calling StartConversationSessionAsync
// Suggested API
var client = GetRealtimeClient("gpt-4o-mini-realtime-preview");
// Model is preloaded here, making subsequent StartConversationSessionAsync calls faster -
Graceful Session Termination: Add a dedicated StopConversationSessionAsync() method instead of relying solely on object disposal for session cleanup
csharp
// Suggested API
await session.StopConversationSessionAsync();
Steps to reproduce
Call StartConversationSessionAsync with a specific model
realtimeSession = await realtimeClient.StartConversationSessionAsync(
model: "gpt-4o-mini-realtime-preview");//gpt-4o-realtime-preview
Code snippets
OS
Android/iOS (Xamarin Forms)
.NET version
.NET Standard 2.0
Library version
2.2.0