Skip to content

Commit

Permalink
Documentation update (#128)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcominerva committed Oct 16, 2023
2 parents 8c11ab0 + c58205b commit b655376
Show file tree
Hide file tree
Showing 39 changed files with 531 additions and 34 deletions.
2 changes: 1 addition & 1 deletion docs/ChatGptNet.Exceptions/ChatGptException.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ChatGptException class

Represents errors that occur during API invocation.
Represents errors that occur during ChatGPT API invocation.

```csharp
public class ChatGptException : HttpRequestException
Expand Down
21 changes: 21 additions & 0 deletions docs/ChatGptNet.Exceptions/EmbeddingException.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# EmbeddingException class

Represents errors that occur during Embeddings API invocation.

```csharp
public class EmbeddingException : HttpRequestException
```

## Public Members

| name | description |
| --- | --- |
| [EmbeddingException](EmbeddingException/EmbeddingException.md)(…) | Initializes a new instance of the [`EmbeddingException`](./EmbeddingException.md) class with the specified *error* details. |
| [Error](EmbeddingException/Error.md) { get; } | Gets the detailed error information. |

## See Also

* namespace [ChatGptNet.Exceptions](../ChatGptNet.md)
* [EmbeddingException.cs](https://github.com/marcominerva/ChatGptNet/tree/master/src/ChatGptNet/Exceptions/EmbeddingException.cs)
<!-- DO NOT EDIT: generated by xmldocmd for ChatGptNet.dll -->
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# EmbeddingException constructor

Initializes a new instance of the [`EmbeddingException`](../EmbeddingException.md) class with the specified *error* details.

```csharp
public EmbeddingException(ChatGptError? error, HttpStatusCode statusCode)
```

| parameter | description |
| --- | --- |
| error | The detailed error information |
| statusCode | The HTTP status code |

## See Also

* class [ChatGptError](../../ChatGptNet.Models/ChatGptError.md)
* class [EmbeddingException](../EmbeddingException.md)
* namespace [ChatGptNet.Exceptions](../../ChatGptNet.md)

<!-- DO NOT EDIT: generated by xmldocmd for ChatGptNet.dll -->
15 changes: 15 additions & 0 deletions docs/ChatGptNet.Exceptions/EmbeddingException/Error.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# EmbeddingException.Error property

Gets the detailed error information.

```csharp
public ChatGptError Error { get; }
```

## See Also

* class [ChatGptError](../../ChatGptNet.Models/ChatGptError.md)
* class [EmbeddingException](../EmbeddingException.md)
* namespace [ChatGptNet.Exceptions](../../ChatGptNet.md)

<!-- DO NOT EDIT: generated by xmldocmd for ChatGptNet.dll -->
20 changes: 20 additions & 0 deletions docs/ChatGptNet.Extensions/EmbeddingUtility.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# EmbeddingUtility class

Provides utility methods to work with embeddings.

```csharp
public static class EmbeddingUtility
```

## Public Members

| name | description |
| --- | --- |
| static [CosineSimilarity](EmbeddingUtility/CosineSimilarity.md)(…) | Computes the cosine similarity between two vectors. (3 methods) |

## See Also

* namespace [ChatGptNet.Extensions](../ChatGptNet.md)
* [EmbeddingUtility.cs](https://github.com/marcominerva/ChatGptNet/tree/master/src/ChatGptNet/Extensions/EmbeddingUtility.cs)
<!-- DO NOT EDIT: generated by xmldocmd for ChatGptNet.dll -->
77 changes: 77 additions & 0 deletions docs/ChatGptNet.Extensions/EmbeddingUtility/CosineSimilarity.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# EmbeddingUtility.CosineSimilarity method (1 of 3)

Computes the cosine similarity between the results of two embedding requests.

```csharp
public static float CosineSimilarity(this EmbeddingResponse embeddingResponse,
EmbeddingResponse otherResponse)
```

| parameter | description |
| --- | --- |
| embeddingResponse | The first embedding response. |
| otherResponse | The second embedding response. |

## Return Value

The cosine similarity.

## See Also

* method [GenerateEmbeddingAsync](../../ChatGptNet/IChatGptClient/GenerateEmbeddingAsync.md)
* class [EmbeddingResponse](../../ChatGptNet.Models.Embeddings/EmbeddingResponse.md)
* class [EmbeddingUtility](../EmbeddingUtility.md)
* namespace [ChatGptNet.Extensions](../../ChatGptNet.md)

---

# EmbeddingUtility.CosineSimilarity method (2 of 3)

Computes the cosine similarity between the result of an embedding request and another vector.

```csharp
public static float CosineSimilarity(this EmbeddingResponse embeddingResponse,
ReadOnlySpan<float> y)
```

| parameter | description |
| --- | --- |
| embeddingResponse | The embedding response. |
| y | The other vector. |

## Return Value

The cosine similarity.

## See Also

* method [GenerateEmbeddingAsync](../../ChatGptNet/IChatGptClient/GenerateEmbeddingAsync.md)
* class [EmbeddingResponse](../../ChatGptNet.Models.Embeddings/EmbeddingResponse.md)
* class [EmbeddingUtility](../EmbeddingUtility.md)
* namespace [ChatGptNet.Extensions](../../ChatGptNet.md)

---

# EmbeddingUtility.CosineSimilarity method (3 of 3)

Computes the cosine similarity between two vectors.

```csharp
public static float CosineSimilarity(ReadOnlySpan<float> x, ReadOnlySpan<float> y)
```

| parameter | description |
| --- | --- |
| x | The first vector. |
| y | The second vector. |

## Return Value

The cosine similarity.

## See Also

* class [EmbeddingUtility](../EmbeddingUtility.md)
* namespace [ChatGptNet.Extensions](../../ChatGptNet.md)

<!-- DO NOT EDIT: generated by xmldocmd for ChatGptNet.dll -->
30 changes: 30 additions & 0 deletions docs/ChatGptNet.Models.Common/Response.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Response class

Contains common properties for all response types.

```csharp
public abstract class Response
```

## Public Members

| name | description |
| --- | --- |
| [Error](Response/Error.md) { get; set; } | Gets or sets the error occurred during the chat completion execution, if any. |
| [IsSuccessful](Response/IsSuccessful.md) { get; } | Gets a value that determines if the response was successful. |
| [Model](Response/Model.md) { getset; } | Gets or sets the model name that has been used to generate the response. |
| [Object](Response/Object.md) { getset; } | Gets or sets the source object for this response. |
| [Usage](Response/Usage.md) { getset; } | Gets or sets information about token usage. |

## Protected Members

| name | description |
| --- | --- |
| [Response](Response/Response.md)() | The default constructor. |

## See Also

* namespace [ChatGptNet.Models.Common](../ChatGptNet.md)
* [Response.cs](https://github.com/marcominerva/ChatGptNet/tree/master/src/ChatGptNet/Models/Common/Response.cs)
<!-- DO NOT EDIT: generated by xmldocmd for ChatGptNet.dll -->
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# ChatGptResponse.Error property
# Response.Error property

Gets or sets the error occurred during the chat completion execution, if any.

Expand All @@ -8,8 +8,8 @@ public ChatGptError? Error { get; set; }

## See Also

* class [ChatGptError](../ChatGptError.md)
* class [ChatGptResponse](../ChatGptResponse.md)
* namespace [ChatGptNet.Models](../../ChatGptNet.md)
* class [ChatGptError](../../ChatGptNet.Models/ChatGptError.md)
* class [Response](../Response.md)
* namespace [ChatGptNet.Models.Common](../../ChatGptNet.md)

<!-- DO NOT EDIT: generated by xmldocmd for ChatGptNet.dll -->
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# ChatGptResponse.IsSuccessful property
# Response.IsSuccessful property

Gets a value that determines if the response was successful.

Expand All @@ -8,7 +8,7 @@ public bool IsSuccessful { get; }

## See Also

* class [ChatGptResponse](../ChatGptResponse.md)
* namespace [ChatGptNet.Models](../../ChatGptNet.md)
* class [Response](../Response.md)
* namespace [ChatGptNet.Models.Common](../../ChatGptNet.md)

<!-- DO NOT EDIT: generated by xmldocmd for ChatGptNet.dll -->
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# ChatGptResponse.Model property
# Response.Model property

Gets or sets the model name that has been used to generate the response.

Expand All @@ -8,7 +8,7 @@ public string Model { get; set; }

## See Also

* class [ChatGptResponse](../ChatGptResponse.md)
* namespace [ChatGptNet.Models](../../ChatGptNet.md)
* class [Response](../Response.md)
* namespace [ChatGptNet.Models.Common](../../ChatGptNet.md)

<!-- DO NOT EDIT: generated by xmldocmd for ChatGptNet.dll -->
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# ChatGptResponse.Object property
# Response.Object property

Gets or sets the source object for this response.

Expand All @@ -8,7 +8,7 @@ public string Object { get; set; }

## See Also

* class [ChatGptResponse](../ChatGptResponse.md)
* namespace [ChatGptNet.Models](../../ChatGptNet.md)
* class [Response](../Response.md)
* namespace [ChatGptNet.Models.Common](../../ChatGptNet.md)

<!-- DO NOT EDIT: generated by xmldocmd for ChatGptNet.dll -->
14 changes: 14 additions & 0 deletions docs/ChatGptNet.Models.Common/Response/Response.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Response constructor

The default constructor.

```csharp
protected Response()
```

## See Also

* class [Response](../Response.md)
* namespace [ChatGptNet.Models.Common](../../ChatGptNet.md)

<!-- DO NOT EDIT: generated by xmldocmd for ChatGptNet.dll -->
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# ChatGptResponse.Usage property
# Response.Usage property

Gets or sets information about token usage.

Expand All @@ -12,8 +12,8 @@ The `Usage` property is always `null` when requesting response streaming with Ca

## See Also

* class [ChatGptUsage](../ChatGptUsage.md)
* class [ChatGptResponse](../ChatGptResponse.md)
* namespace [ChatGptNet.Models](../../ChatGptNet.md)
* class [ChatGptUsage](../../ChatGptNet.Models/ChatGptUsage.md)
* class [Response](../Response.md)
* namespace [ChatGptNet.Models.Common](../../ChatGptNet.md)

<!-- DO NOT EDIT: generated by xmldocmd for ChatGptNet.dll -->
23 changes: 23 additions & 0 deletions docs/ChatGptNet.Models.Embeddings/EmbeddingData.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# EmbeddingData class

Represents an embedding.

```csharp
public class EmbeddingData
```

## Public Members

| name | description |
| --- | --- |
| [EmbeddingData](EmbeddingData/EmbeddingData.md)() | The default constructor. |
| [Embedding](EmbeddingData/Embedding.md) { get; set; } | Gets or sets the embedding data. |
| [Index](EmbeddingData/Index.md) { getset; } | Gets or sets the index of the embedding. |
| [Object](EmbeddingData/Object.md) { getset; } | Gets or sets the source object for this response. |

## See Also

* namespace [ChatGptNet.Models.Embeddings](../ChatGptNet.md)
* [EmbeddingData.cs](https://github.com/marcominerva/ChatGptNet/tree/master/src/ChatGptNet/Models/Embeddings/EmbeddingData.cs)
<!-- DO NOT EDIT: generated by xmldocmd for ChatGptNet.dll -->
14 changes: 14 additions & 0 deletions docs/ChatGptNet.Models.Embeddings/EmbeddingData/Embedding.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# EmbeddingData.Embedding property

Gets or sets the embedding data.

```csharp
public float[] Embedding { get; set; }
```

## See Also

* class [EmbeddingData](../EmbeddingData.md)
* namespace [ChatGptNet.Models.Embeddings](../../ChatGptNet.md)

<!-- DO NOT EDIT: generated by xmldocmd for ChatGptNet.dll -->
14 changes: 14 additions & 0 deletions docs/ChatGptNet.Models.Embeddings/EmbeddingData/EmbeddingData.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# EmbeddingData constructor

The default constructor.

```csharp
public EmbeddingData()
```

## See Also

* class [EmbeddingData](../EmbeddingData.md)
* namespace [ChatGptNet.Models.Embeddings](../../ChatGptNet.md)

<!-- DO NOT EDIT: generated by xmldocmd for ChatGptNet.dll -->
14 changes: 14 additions & 0 deletions docs/ChatGptNet.Models.Embeddings/EmbeddingData/Index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# EmbeddingData.Index property

Gets or sets the index of the embedding.

```csharp
public int Index { get; set; }
```

## See Also

* class [EmbeddingData](../EmbeddingData.md)
* namespace [ChatGptNet.Models.Embeddings](../../ChatGptNet.md)

<!-- DO NOT EDIT: generated by xmldocmd for ChatGptNet.dll -->
14 changes: 14 additions & 0 deletions docs/ChatGptNet.Models.Embeddings/EmbeddingData/Object.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# EmbeddingData.Object property

Gets or sets the source object for this response.

```csharp
public string Object { get; set; }
```

## See Also

* class [EmbeddingData](../EmbeddingData.md)
* namespace [ChatGptNet.Models.Embeddings](../../ChatGptNet.md)

<!-- DO NOT EDIT: generated by xmldocmd for ChatGptNet.dll -->

0 comments on commit b655376

Please sign in to comment.