Skip to content

[BUG] StartConversationSessionAsync(model: "gpt-4o-mini-realtime-preview"), takes quite a few seconds to execute #587

@cjkarande

Description

@cjkarande

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

  1. 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

  2. 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

Metadata

Metadata

Assignees

Labels

feature-requestCategory: A new feature or enhancement to an existing feature is being requested.issue-addressedWorkflow: The OpenAI maintainers believe the issue to be addressed and ready to close.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions