> For the complete documentation index, see [llms.txt](https://docs.wisej.com/ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.wisej.com/ai/components/api/smartendpoint/wisej.ai.smartendpoint.response.md).

# SmartEndpoint.Response

Namespace: **Wisej.AI**

Assembly: **Wisej.AI** (3.5.0.0)

Represents a response that can be initialized with a stream or a string and provides methods to read its content.

{% tabs %}
{% tab title="C#" %}

```csharp
public class Response
```

{% endtab %}

{% tab title="VB.NET" %}

```visual-basic
Public Class Response
```

{% endtab %}
{% endtabs %}

## Constructors

### ![](/files/ptrKjmmRoQB76pvrIqh0) Response(stream)

Initializes a new instance of the [Response](/ai/components/api/smartendpoint/wisej.ai.smartendpoint.response.md) class with the specified stream.

| Name       | Type                                                             | Description                                 |
| ---------- | ---------------------------------------------------------------- | ------------------------------------------- |
| **stream** | [Stream](https://docs.microsoft.com/dotnet/api/system.io.stream) | The stream to initialize the response with. |

**Throws:**

* [ArgumentNullException](https://docs.microsoft.com/dotnet/api/system.argumentnullexception)\
  Thrown when the *stream* is null.

### ![](/files/ptrKjmmRoQB76pvrIqh0) Response(response)

Initializes a new instance of the [Response](/ai/components/api/smartendpoint/wisej.ai.smartendpoint.response.md) class with the specified string.

| Name         | Type                                                          | Description                                 |
| ------------ | ------------------------------------------------------------- | ------------------------------------------- |
| **response** | [String](https://docs.microsoft.com/dotnet/api/system.string) | The string to initialize the response with. |

**Throws:**

* [ArgumentNullException](https://docs.microsoft.com/dotnet/api/system.argumentnullexception)\
  Thrown when the *response* is null.

## Properties

### ![](/files/ptrKjmmRoQB76pvrIqh0) Stream

[Stream](https://docs.microsoft.com/dotnet/api/system.io.stream): Gets a copy of the underlying stream.

The returned stream is a copy of the original stream, allowing for independent reading without affecting the original stream's position.

## Methods

### ![](/files/ptrKjmmRoQB76pvrIqh0) ReadBufferAsync()

Asynchronously reads the content of the response as a byte array.

**Returns:** [Task\<Byte\[\]>](https://docs.microsoft.com/dotnet/api/system.threading.tasks.task-1). A task that represents the asynchronous read operation. The task result contains the content of the response as a byte array.

This method reads the entire content of the stream and returns it as a byte array.

### ![](/files/ptrKjmmRoQB76pvrIqh0) ReadContentAsync()

Asynchronously reads the content of the response as a string.

**Returns:** [Task\<String>](https://docs.microsoft.com/dotnet/api/system.threading.tasks.task-1). A task that represents the asynchronous read operation. The task result contains the content of the response as a string.

This method reads the entire content of the stream and returns it as a string.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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/api/smartendpoint/wisej.ai.smartendpoint.response.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.
