# Using SmartRealTimeAdapter

## Overview

The [SmartRealTimeAdapter](/ai/components/adapters/smartrealtimeadapter.md) enables real-time, continuous interaction between the user and the AI model via voice input and spoken responses. This adapter facilitates seamless communication by supporting both the reception of voice commands from the user and the delivery of AI-generated spoken replies. The [SmartRealTimeAdapter](/ai/components/adapters/smartrealtimeadapter.md) can be used independently or in conjunction with other adapters.

To use the SmartRealTimeAdapter, you must also configure an instance of the OpenAIEndpointRealtime endpoint. This is the only endpoint supported by the SmartRealTimeAdapter.&#x20;

Additionally, this adapter requires a browser environment, as it relies on browser capabilities to capture the user’s voice and facilitate real-time communication with the [OpenAI endpoint](https://platform.openai.com/docs/guides/realtime). Therefore, it cannot be used in console or service applications.

## Examples

The example below demonstrates a basic approach to creating the SmartRealTimeAdapter and initiating voice listening. In this example, each response from the AI is displayed to the user in an alert box.

```csharp
var hub = new SmartHub { 
    Endpoint = new OpenAIEndpointRealtime { ApiKey = "..." }
};
var adapter = new SmartRealtimeAdapter
{
	Hub = hub,
};
adapter.AnswerReceived += (s, e) =>
{
	AlertBox.Show(e.Text);
};
adapter.StartListening();
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.wisej.com/ai/components/using-smartrealtimeadapter.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
