# EmbeddedDocument

Namespace: **Wisej.AI.Embeddings**

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

Represents a document that can be embedded with metadata and embedding data.

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

```csharp
public class EmbeddedDocument : ICloneable
```

{% endtab %}

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

```visual-basic
Public Class EmbeddedDocument
    Inherits ICloneable
```

{% endtab %}
{% endtabs %}

The [EmbeddedDocument](/ai/components/api/embeddings/wisej.ai.embeddings.embeddeddocument.md) class is designed to hold information about a document that can be embedded within a system. It contains properties for the document's name, metadata, and embedding data. This class provides constructors for initializing a document with or without embedding data.\
The embedded documents can be used in systems that require document similarity measures or need to store additional metadata for each document.

## Constructors

### ![](/files/ptrKjmmRoQB76pvrIqh0) EmbeddedDocument(name, metadata, embedding)

Initializes a new instance of the [EmbeddedDocument](/ai/components/api/embeddings/wisej.ai.embeddings.embeddeddocument.md) class with the specified name, metadata, and embedding.

| Name          | Type                                                                        | Description                                                                                               |
| ------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- |
| **name**      | [String](https://docs.microsoft.com/dotnet/api/system.string)               | The name of the document. Cannot be null.                                                                 |
| **metadata**  | [Metadata](/ai/components/api/embeddings/wisej.ai.embeddings.metadata.md)   | Optional metadata associated with the document. If null, a new [Metadata](#metadata) instance is created. |
| **embedding** | [Embedding](/ai/components/api/embeddings/wisej.ai.embeddings.embedding.md) | Optional embedding data for the document.                                                                 |

**Throws:**

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

## Properties

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

[Metadata](/ai/components/api/embeddings/wisej.ai.embeddings.metadata.md): Gets the metadata of the document.

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

[String](https://docs.microsoft.com/dotnet/api/system.string): Gets the name of the document.

## Methods

### ![](/files/ptrKjmmRoQB76pvrIqh0) Clone(includeEmbedding)

Creates a deep copy of the current [EmbeddedDocument](/ai/components/api/embeddings/wisej.ai.embeddings.embeddeddocument.md) instance.

| Parameter            | Type                                                            | Description                      |
| -------------------- | --------------------------------------------------------------- | -------------------------------- |
| **includeEmbedding** | [Boolean](https://docs.microsoft.com/dotnet/api/system.boolean) | Whether to clone the embeddings. |

**Returns:** [EmbeddedDocument](/ai/components/api/embeddings/wisej.ai.embeddings.embeddeddocument.md). A new [EmbeddedDocument](/ai/components/api/embeddings/wisej.ai.embeddings.embeddeddocument.md) instance that is a deep copy of the current instance.

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

Retrieves the embedding data associated with the document.

**Returns:** [Embedding](/ai/components/api/embeddings/wisej.ai.embeddings.embedding.md). The embedding data of the document.

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

**Returns:** [Matches](/ai/components/api/embeddings/wisej.ai.embeddings.matches.md).

### ![](/files/ptrKjmmRoQB76pvrIqh0) SetEmbedding(embedding)

Sets the embedding data for the document.

| Parameter     | Type                                                                        | Description                                 |
| ------------- | --------------------------------------------------------------------------- | ------------------------------------------- |
| **embedding** | [Embedding](/ai/components/api/embeddings/wisej.ai.embeddings.embedding.md) | The embedding data to set for the document. |

**Returns:** [EmbeddedDocument](/ai/components/api/embeddings/wisej.ai.embeddings.embeddeddocument.md). The current instance of [EmbeddedDocument](/ai/components/api/embeddings/wisej.ai.embeddings.embeddeddocument.md) with updated embedding data.

Use this method to update the embedding data of an existing document. This might be necessary when the document's context or representation changes.

```csharp

  var document = new EmbeddedDocument("SampleDoc");
  var newEmbedding = new Embedding();
  document.SetEmbedding(newEmbedding);

```

### ![](/files/ptrKjmmRoQB76pvrIqh0) SetMatches(matches)

| Parameter   | Type                                                                    | Description |
| ----------- | ----------------------------------------------------------------------- | ----------- |
| **matches** | [Matches](/ai/components/api/embeddings/wisej.ai.embeddings.matches.md) |             |

**Returns:** [EmbeddedDocument](/ai/components/api/embeddings/wisej.ai.embeddings.embeddeddocument.md).


---

# 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/api/embeddings/wisej.ai.embeddings.embeddeddocument.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.
