-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
39 changed files
with
531 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 --> |
20 changes: 20 additions & 0 deletions
20
docs/ChatGptNet.Exceptions/EmbeddingException/EmbeddingException.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
77
docs/ChatGptNet.Extensions/EmbeddingUtility/CosineSimilarity.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) { get; set; } | Gets or sets the model name that has been used to generate the response. | | ||
| [Object](Response/Object.md) { get; set; } | Gets or sets the source object for this response. | | ||
| [Usage](Response/Usage.md) { get; set; } | 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 --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) { get; set; } | Gets or sets the index of the embedding. | | ||
| [Object](EmbeddingData/Object.md) { get; set; } | 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
14
docs/ChatGptNet.Models.Embeddings/EmbeddingData/Embedding.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
14
docs/ChatGptNet.Models.Embeddings/EmbeddingData/EmbeddingData.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 --> |
Oops, something went wrong.