From c58205b03b624d475ace4360536b158e19f341bd Mon Sep 17 00:00:00 2001 From: Marco Minerva Date: Mon, 16 Oct 2023 15:21:41 +0200 Subject: [PATCH] Documentation update --- .../ChatGptNet.Exceptions/ChatGptException.md | 2 +- .../EmbeddingException.md | 21 +++++ .../EmbeddingException/EmbeddingException.md | 20 +++++ .../EmbeddingException/Error.md | 15 ++++ .../ChatGptNet.Extensions/EmbeddingUtility.md | 20 +++++ .../EmbeddingUtility/CosineSimilarity.md | 77 +++++++++++++++++++ docs/ChatGptNet.Models.Common/Response.md | 30 ++++++++ .../Response}/Error.md | 8 +- .../Response}/IsSuccessful.md | 6 +- .../Response}/Model.md | 6 +- .../Response}/Object.md | 6 +- .../Response/Response.md | 14 ++++ .../Response}/Usage.md | 8 +- .../EmbeddingData.md | 23 ++++++ .../EmbeddingData/Embedding.md | 14 ++++ .../EmbeddingData/EmbeddingData.md | 14 ++++ .../EmbeddingData/Index.md | 14 ++++ .../EmbeddingData/Object.md | 14 ++++ .../EmbeddingResponse.md | 23 ++++++ .../EmbeddingResponse/Data.md | 15 ++++ .../EmbeddingResponse/EmbeddingResponse.md | 14 ++++ .../EmbeddingResponse/GetEmbedding.md | 18 +++++ .../OpenAIEmbeddingModels.md | 24 ++++++ .../TextEmbeddingAda002.md | 14 ++++ docs/ChatGptNet.Models/ChatGptResponse.md | 8 +- docs/ChatGptNet/ChatGptOptions.md | 1 + .../ChatGptOptions/DefaultEmbeddingModel.md | 15 ++++ docs/ChatGptNet/ChatGptOptionsBuilder.md | 1 + .../DefaultEmbeddingModel.md | 15 ++++ docs/ChatGptNet/IChatGptClient.md | 3 +- docs/ChatGptNet/IChatGptClient/AskAsync.md | 8 +- .../IChatGptClient/AskStreamAsync.md | 4 +- .../IChatGptClient/ConversationExistsAsync.md | 2 +- .../IChatGptClient/GenerateEmbeddingAsync.md | 65 ++++++++++++++++ docs/README.md | 18 ++++- src/ChatGptNet/ChatGptOptions.cs | 1 + src/ChatGptNet/ChatGptOptionsBuilder.cs | 1 + .../ChatGptServiceCollectionExtensions.cs | 1 + .../Embeddings/OpenAIEmbeddingModels.cs | 2 +- 39 files changed, 531 insertions(+), 34 deletions(-) create mode 100644 docs/ChatGptNet.Exceptions/EmbeddingException.md create mode 100644 docs/ChatGptNet.Exceptions/EmbeddingException/EmbeddingException.md create mode 100644 docs/ChatGptNet.Exceptions/EmbeddingException/Error.md create mode 100644 docs/ChatGptNet.Extensions/EmbeddingUtility.md create mode 100644 docs/ChatGptNet.Extensions/EmbeddingUtility/CosineSimilarity.md create mode 100644 docs/ChatGptNet.Models.Common/Response.md rename docs/{ChatGptNet.Models/ChatGptResponse => ChatGptNet.Models.Common/Response}/Error.md (53%) rename docs/{ChatGptNet.Models/ChatGptResponse => ChatGptNet.Models.Common/Response}/IsSuccessful.md (56%) rename docs/{ChatGptNet.Models/ChatGptResponse => ChatGptNet.Models.Common/Response}/Model.md (59%) rename docs/{ChatGptNet.Models/ChatGptResponse => ChatGptNet.Models.Common/Response}/Object.md (56%) create mode 100644 docs/ChatGptNet.Models.Common/Response/Response.md rename docs/{ChatGptNet.Models/ChatGptResponse => ChatGptNet.Models.Common/Response}/Usage.md (60%) create mode 100644 docs/ChatGptNet.Models.Embeddings/EmbeddingData.md create mode 100644 docs/ChatGptNet.Models.Embeddings/EmbeddingData/Embedding.md create mode 100644 docs/ChatGptNet.Models.Embeddings/EmbeddingData/EmbeddingData.md create mode 100644 docs/ChatGptNet.Models.Embeddings/EmbeddingData/Index.md create mode 100644 docs/ChatGptNet.Models.Embeddings/EmbeddingData/Object.md create mode 100644 docs/ChatGptNet.Models.Embeddings/EmbeddingResponse.md create mode 100644 docs/ChatGptNet.Models.Embeddings/EmbeddingResponse/Data.md create mode 100644 docs/ChatGptNet.Models.Embeddings/EmbeddingResponse/EmbeddingResponse.md create mode 100644 docs/ChatGptNet.Models.Embeddings/EmbeddingResponse/GetEmbedding.md create mode 100644 docs/ChatGptNet.Models.Embeddings/OpenAIEmbeddingModels.md create mode 100644 docs/ChatGptNet.Models.Embeddings/OpenAIEmbeddingModels/TextEmbeddingAda002.md create mode 100644 docs/ChatGptNet/ChatGptOptions/DefaultEmbeddingModel.md create mode 100644 docs/ChatGptNet/ChatGptOptionsBuilder/DefaultEmbeddingModel.md create mode 100644 docs/ChatGptNet/IChatGptClient/GenerateEmbeddingAsync.md diff --git a/docs/ChatGptNet.Exceptions/ChatGptException.md b/docs/ChatGptNet.Exceptions/ChatGptException.md index 28833dd..913e8b9 100644 --- a/docs/ChatGptNet.Exceptions/ChatGptException.md +++ b/docs/ChatGptNet.Exceptions/ChatGptException.md @@ -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 diff --git a/docs/ChatGptNet.Exceptions/EmbeddingException.md b/docs/ChatGptNet.Exceptions/EmbeddingException.md new file mode 100644 index 0000000..c4fa885 --- /dev/null +++ b/docs/ChatGptNet.Exceptions/EmbeddingException.md @@ -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) + + diff --git a/docs/ChatGptNet.Exceptions/EmbeddingException/EmbeddingException.md b/docs/ChatGptNet.Exceptions/EmbeddingException/EmbeddingException.md new file mode 100644 index 0000000..53b27e6 --- /dev/null +++ b/docs/ChatGptNet.Exceptions/EmbeddingException/EmbeddingException.md @@ -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) + + diff --git a/docs/ChatGptNet.Exceptions/EmbeddingException/Error.md b/docs/ChatGptNet.Exceptions/EmbeddingException/Error.md new file mode 100644 index 0000000..21bbac1 --- /dev/null +++ b/docs/ChatGptNet.Exceptions/EmbeddingException/Error.md @@ -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) + + diff --git a/docs/ChatGptNet.Extensions/EmbeddingUtility.md b/docs/ChatGptNet.Extensions/EmbeddingUtility.md new file mode 100644 index 0000000..cdf16d6 --- /dev/null +++ b/docs/ChatGptNet.Extensions/EmbeddingUtility.md @@ -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) + + diff --git a/docs/ChatGptNet.Extensions/EmbeddingUtility/CosineSimilarity.md b/docs/ChatGptNet.Extensions/EmbeddingUtility/CosineSimilarity.md new file mode 100644 index 0000000..731fe04 --- /dev/null +++ b/docs/ChatGptNet.Extensions/EmbeddingUtility/CosineSimilarity.md @@ -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 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 x, ReadOnlySpan 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) + + diff --git a/docs/ChatGptNet.Models.Common/Response.md b/docs/ChatGptNet.Models.Common/Response.md new file mode 100644 index 0000000..6147df5 --- /dev/null +++ b/docs/ChatGptNet.Models.Common/Response.md @@ -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) + + diff --git a/docs/ChatGptNet.Models/ChatGptResponse/Error.md b/docs/ChatGptNet.Models.Common/Response/Error.md similarity index 53% rename from docs/ChatGptNet.Models/ChatGptResponse/Error.md rename to docs/ChatGptNet.Models.Common/Response/Error.md index 4346763..a17f483 100644 --- a/docs/ChatGptNet.Models/ChatGptResponse/Error.md +++ b/docs/ChatGptNet.Models.Common/Response/Error.md @@ -1,4 +1,4 @@ -# ChatGptResponse.Error property +# Response.Error property Gets or sets the error occurred during the chat completion execution, if any. @@ -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) diff --git a/docs/ChatGptNet.Models/ChatGptResponse/IsSuccessful.md b/docs/ChatGptNet.Models.Common/Response/IsSuccessful.md similarity index 56% rename from docs/ChatGptNet.Models/ChatGptResponse/IsSuccessful.md rename to docs/ChatGptNet.Models.Common/Response/IsSuccessful.md index 7987f9e..ed1646d 100644 --- a/docs/ChatGptNet.Models/ChatGptResponse/IsSuccessful.md +++ b/docs/ChatGptNet.Models.Common/Response/IsSuccessful.md @@ -1,4 +1,4 @@ -# ChatGptResponse.IsSuccessful property +# Response.IsSuccessful property Gets a value that determines if the response was successful. @@ -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) diff --git a/docs/ChatGptNet.Models/ChatGptResponse/Model.md b/docs/ChatGptNet.Models.Common/Response/Model.md similarity index 59% rename from docs/ChatGptNet.Models/ChatGptResponse/Model.md rename to docs/ChatGptNet.Models.Common/Response/Model.md index ab4e10b..47a971b 100644 --- a/docs/ChatGptNet.Models/ChatGptResponse/Model.md +++ b/docs/ChatGptNet.Models.Common/Response/Model.md @@ -1,4 +1,4 @@ -# ChatGptResponse.Model property +# Response.Model property Gets or sets the model name that has been used to generate the response. @@ -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) diff --git a/docs/ChatGptNet.Models/ChatGptResponse/Object.md b/docs/ChatGptNet.Models.Common/Response/Object.md similarity index 56% rename from docs/ChatGptNet.Models/ChatGptResponse/Object.md rename to docs/ChatGptNet.Models.Common/Response/Object.md index 9c12250..efb41b9 100644 --- a/docs/ChatGptNet.Models/ChatGptResponse/Object.md +++ b/docs/ChatGptNet.Models.Common/Response/Object.md @@ -1,4 +1,4 @@ -# ChatGptResponse.Object property +# Response.Object property Gets or sets the source object for this response. @@ -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) diff --git a/docs/ChatGptNet.Models.Common/Response/Response.md b/docs/ChatGptNet.Models.Common/Response/Response.md new file mode 100644 index 0000000..3344a27 --- /dev/null +++ b/docs/ChatGptNet.Models.Common/Response/Response.md @@ -0,0 +1,14 @@ +# Response constructor + +The default constructor. + +```csharp +protected Response() +``` + +## See Also + +* class [Response](../Response.md) +* namespace [ChatGptNet.Models.Common](../../ChatGptNet.md) + + diff --git a/docs/ChatGptNet.Models/ChatGptResponse/Usage.md b/docs/ChatGptNet.Models.Common/Response/Usage.md similarity index 60% rename from docs/ChatGptNet.Models/ChatGptResponse/Usage.md rename to docs/ChatGptNet.Models.Common/Response/Usage.md index af1f6e2..b6db9ce 100644 --- a/docs/ChatGptNet.Models/ChatGptResponse/Usage.md +++ b/docs/ChatGptNet.Models.Common/Response/Usage.md @@ -1,4 +1,4 @@ -# ChatGptResponse.Usage property +# Response.Usage property Gets or sets information about token usage. @@ -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) diff --git a/docs/ChatGptNet.Models.Embeddings/EmbeddingData.md b/docs/ChatGptNet.Models.Embeddings/EmbeddingData.md new file mode 100644 index 0000000..6dc1520 --- /dev/null +++ b/docs/ChatGptNet.Models.Embeddings/EmbeddingData.md @@ -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) + + diff --git a/docs/ChatGptNet.Models.Embeddings/EmbeddingData/Embedding.md b/docs/ChatGptNet.Models.Embeddings/EmbeddingData/Embedding.md new file mode 100644 index 0000000..30a8f1e --- /dev/null +++ b/docs/ChatGptNet.Models.Embeddings/EmbeddingData/Embedding.md @@ -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) + + diff --git a/docs/ChatGptNet.Models.Embeddings/EmbeddingData/EmbeddingData.md b/docs/ChatGptNet.Models.Embeddings/EmbeddingData/EmbeddingData.md new file mode 100644 index 0000000..3427e99 --- /dev/null +++ b/docs/ChatGptNet.Models.Embeddings/EmbeddingData/EmbeddingData.md @@ -0,0 +1,14 @@ +# EmbeddingData constructor + +The default constructor. + +```csharp +public EmbeddingData() +``` + +## See Also + +* class [EmbeddingData](../EmbeddingData.md) +* namespace [ChatGptNet.Models.Embeddings](../../ChatGptNet.md) + + diff --git a/docs/ChatGptNet.Models.Embeddings/EmbeddingData/Index.md b/docs/ChatGptNet.Models.Embeddings/EmbeddingData/Index.md new file mode 100644 index 0000000..f6363a5 --- /dev/null +++ b/docs/ChatGptNet.Models.Embeddings/EmbeddingData/Index.md @@ -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) + + diff --git a/docs/ChatGptNet.Models.Embeddings/EmbeddingData/Object.md b/docs/ChatGptNet.Models.Embeddings/EmbeddingData/Object.md new file mode 100644 index 0000000..de26294 --- /dev/null +++ b/docs/ChatGptNet.Models.Embeddings/EmbeddingData/Object.md @@ -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) + + diff --git a/docs/ChatGptNet.Models.Embeddings/EmbeddingResponse.md b/docs/ChatGptNet.Models.Embeddings/EmbeddingResponse.md new file mode 100644 index 0000000..ac3fb1b --- /dev/null +++ b/docs/ChatGptNet.Models.Embeddings/EmbeddingResponse.md @@ -0,0 +1,23 @@ +# EmbeddingResponse class + +Represents an embedding response. + +```csharp +public class EmbeddingResponse : Response +``` + +## Public Members + +| name | description | +| --- | --- | +| [EmbeddingResponse](EmbeddingResponse/EmbeddingResponse.md)() | The default constructor. | +| [Data](EmbeddingResponse/Data.md) { get; set; } | Gets or sets the array of embedding objects. | +| [GetEmbedding](EmbeddingResponse/GetEmbedding.md)() | Gets the first embedding data, if availably. | + +## See Also + +* class [Response](../ChatGptNet.Models.Common/Response.md) +* namespace [ChatGptNet.Models.Embeddings](../ChatGptNet.md) +* [EmbeddingResponse.cs](https://github.com/marcominerva/ChatGptNet/tree/master/src/ChatGptNet/Models/Embeddings/EmbeddingResponse.cs) + + diff --git a/docs/ChatGptNet.Models.Embeddings/EmbeddingResponse/Data.md b/docs/ChatGptNet.Models.Embeddings/EmbeddingResponse/Data.md new file mode 100644 index 0000000..2877c14 --- /dev/null +++ b/docs/ChatGptNet.Models.Embeddings/EmbeddingResponse/Data.md @@ -0,0 +1,15 @@ +# EmbeddingResponse.Data property + +Gets or sets the array of embedding objects. + +```csharp +public EmbeddingData[]? Data { get; set; } +``` + +## See Also + +* class [EmbeddingData](../EmbeddingData.md) +* class [EmbeddingResponse](../EmbeddingResponse.md) +* namespace [ChatGptNet.Models.Embeddings](../../ChatGptNet.md) + + diff --git a/docs/ChatGptNet.Models.Embeddings/EmbeddingResponse/EmbeddingResponse.md b/docs/ChatGptNet.Models.Embeddings/EmbeddingResponse/EmbeddingResponse.md new file mode 100644 index 0000000..af13708 --- /dev/null +++ b/docs/ChatGptNet.Models.Embeddings/EmbeddingResponse/EmbeddingResponse.md @@ -0,0 +1,14 @@ +# EmbeddingResponse constructor + +The default constructor. + +```csharp +public EmbeddingResponse() +``` + +## See Also + +* class [EmbeddingResponse](../EmbeddingResponse.md) +* namespace [ChatGptNet.Models.Embeddings](../../ChatGptNet.md) + + diff --git a/docs/ChatGptNet.Models.Embeddings/EmbeddingResponse/GetEmbedding.md b/docs/ChatGptNet.Models.Embeddings/EmbeddingResponse/GetEmbedding.md new file mode 100644 index 0000000..c9ca056 --- /dev/null +++ b/docs/ChatGptNet.Models.Embeddings/EmbeddingResponse/GetEmbedding.md @@ -0,0 +1,18 @@ +# EmbeddingResponse.GetEmbedding method + +Gets the first embedding data, if availably. + +```csharp +public float[]? GetEmbedding() +``` + +## Return Value + +The first embedding data, if available. + +## See Also + +* class [EmbeddingResponse](../EmbeddingResponse.md) +* namespace [ChatGptNet.Models.Embeddings](../../ChatGptNet.md) + + diff --git a/docs/ChatGptNet.Models.Embeddings/OpenAIEmbeddingModels.md b/docs/ChatGptNet.Models.Embeddings/OpenAIEmbeddingModels.md new file mode 100644 index 0000000..46cb076 --- /dev/null +++ b/docs/ChatGptNet.Models.Embeddings/OpenAIEmbeddingModels.md @@ -0,0 +1,24 @@ +# OpenAIEmbeddingModels class + +Contains all the embedding models that are currently supported by OpenAI. + +```csharp +public static class OpenAIEmbeddingModels +``` + +## Public Members + +| name | description | +| --- | --- | +| const [TextEmbeddingAda002](OpenAIEmbeddingModels/TextEmbeddingAda002.md) | The second generation embedding model provided by OpenAI. | + +## Remarks + +See [Models overview](https://platform.openai.com/docs/models/embeddings) for more information. + +## See Also + +* namespace [ChatGptNet.Models.Embeddings](../ChatGptNet.md) +* [OpenAIEmbeddingModels.cs](https://github.com/marcominerva/ChatGptNet/tree/master/src/ChatGptNet/Models/Embeddings/OpenAIEmbeddingModels.cs) + + diff --git a/docs/ChatGptNet.Models.Embeddings/OpenAIEmbeddingModels/TextEmbeddingAda002.md b/docs/ChatGptNet.Models.Embeddings/OpenAIEmbeddingModels/TextEmbeddingAda002.md new file mode 100644 index 0000000..1480502 --- /dev/null +++ b/docs/ChatGptNet.Models.Embeddings/OpenAIEmbeddingModels/TextEmbeddingAda002.md @@ -0,0 +1,14 @@ +# OpenAIEmbeddingModels.TextEmbeddingAda002 field + +The second generation embedding model provided by OpenAI. + +```csharp +public const string TextEmbeddingAda002; +``` + +## See Also + +* class [OpenAIEmbeddingModels](../OpenAIEmbeddingModels.md) +* namespace [ChatGptNet.Models.Embeddings](../../ChatGptNet.md) + + diff --git a/docs/ChatGptNet.Models/ChatGptResponse.md b/docs/ChatGptNet.Models/ChatGptResponse.md index ac37d45..7929d4e 100644 --- a/docs/ChatGptNet.Models/ChatGptResponse.md +++ b/docs/ChatGptNet.Models/ChatGptResponse.md @@ -3,7 +3,7 @@ Represents a chat completion response. ```csharp -public class ChatGptResponse +public class ChatGptResponse : Response ``` ## Public Members @@ -14,21 +14,17 @@ public class ChatGptResponse | [Choices](ChatGptResponse/Choices.md) { get; set; } | Gets or sets the list of choices that has been provided by chat completion. | | [ConversationId](ChatGptResponse/ConversationId.md) { get; set; } | Gets or sets the Conversation Id, that is used to group messages of the same conversation. | | [CreatedAt](ChatGptResponse/CreatedAt.md) { get; set; } | Gets or sets the UTC date and time at which the response has been generated. | -| [Error](ChatGptResponse/Error.md) { get; set; } | Gets or sets the error occurred during the chat completion execution, if any. | | [Id](ChatGptResponse/Id.md) { get; set; } | Gets or sets the Id of the response. | | [IsContentFiltered](ChatGptResponse/IsContentFiltered.md) { get; } | Gets a value indicating whether the first choice, if available, has been filtered by the content filtering system. | | [IsFunctionCall](ChatGptResponse/IsFunctionCall.md) { get; } | Gets a value indicating whether the first choice, if available, contains a function call. | | [IsPromptFiltered](ChatGptResponse/IsPromptFiltered.md) { get; } | Gets or sets a value indicating whether any prompt has been filtered by the content filtering system. | -| [IsSuccessful](ChatGptResponse/IsSuccessful.md) { get; } | Gets a value that determines if the response was successful. | -| [Model](ChatGptResponse/Model.md) { get; set; } | Gets or sets the model name that has been used to generate the response. | -| [Object](ChatGptResponse/Object.md) { get; set; } | Gets or sets the source object for this response. | | [PromptFilterResults](ChatGptResponse/PromptFilterResults.md) { get; set; } | Gets or sets the list of prompt filter results determined by the content filtering system. | -| [Usage](ChatGptResponse/Usage.md) { get; set; } | Gets or sets information about token usage. | | [GetContent](ChatGptResponse/GetContent.md)() | Gets the content of the first choice, if available. | | [GetFunctionCall](ChatGptResponse/GetFunctionCall.md)() | Gets or sets the function call for the message of the first choice, if available. | ## See Also +* class [Response](../ChatGptNet.Models.Common/Response.md) * namespace [ChatGptNet.Models](../ChatGptNet.md) * [ChatGptResponse.cs](https://github.com/marcominerva/ChatGptNet/tree/master/src/ChatGptNet/Models/ChatGptResponse.cs) diff --git a/docs/ChatGptNet/ChatGptOptions.md b/docs/ChatGptNet/ChatGptOptions.md index 7fca4a4..876f0b7 100644 --- a/docs/ChatGptNet/ChatGptOptions.md +++ b/docs/ChatGptNet/ChatGptOptions.md @@ -11,6 +11,7 @@ public class ChatGptOptions | name | description | | --- | --- | | [ChatGptOptions](ChatGptOptions/ChatGptOptions.md)() | The default constructor. | +| [DefaultEmbeddingModel](ChatGptOptions/DefaultEmbeddingModel.md) { get; set; } | Gets or sets the default model for embedding. (default: [`TextEmbeddingAda002`](../ChatGptNet.Models.Embeddings/OpenAIEmbeddingModels/TextEmbeddingAda002.md) when the provider is OpenAI). | | [DefaultModel](ChatGptOptions/DefaultModel.md) { get; set; } | Gets or sets the default model for chat completion. (default: [`Gpt35Turbo`](../ChatGptNet.Models/OpenAIChatGptModels/Gpt35Turbo.md) when the provider is OpenAI). | | [DefaultParameters](ChatGptOptions/DefaultParameters.md) { get; } | Gets or sets the default parameters for chat completion. | | [MessageExpiration](ChatGptOptions/MessageExpiration.md) { get; set; } | Gets or sets the expiration for cached conversation messages (default: 1 hour). | diff --git a/docs/ChatGptNet/ChatGptOptions/DefaultEmbeddingModel.md b/docs/ChatGptNet/ChatGptOptions/DefaultEmbeddingModel.md new file mode 100644 index 0000000..65fcad1 --- /dev/null +++ b/docs/ChatGptNet/ChatGptOptions/DefaultEmbeddingModel.md @@ -0,0 +1,15 @@ +# ChatGptOptions.DefaultEmbeddingModel property + +Gets or sets the default model for embedding. (default: [`TextEmbeddingAda002`](../../ChatGptNet.Models.Embeddings/OpenAIEmbeddingModels/TextEmbeddingAda002.md) when the provider is OpenAI). + +```csharp +public string? DefaultEmbeddingModel { get; set; } +``` + +## See Also + +* class [OpenAIEmbeddingModels](../../ChatGptNet.Models.Embeddings/OpenAIEmbeddingModels.md) +* class [ChatGptOptions](../ChatGptOptions.md) +* namespace [ChatGptNet](../../ChatGptNet.md) + + diff --git a/docs/ChatGptNet/ChatGptOptionsBuilder.md b/docs/ChatGptNet/ChatGptOptionsBuilder.md index f43ae09..d5fde27 100644 --- a/docs/ChatGptNet/ChatGptOptionsBuilder.md +++ b/docs/ChatGptNet/ChatGptOptionsBuilder.md @@ -11,6 +11,7 @@ public class ChatGptOptionsBuilder | name | description | | --- | --- | | [ChatGptOptionsBuilder](ChatGptOptionsBuilder/ChatGptOptionsBuilder.md)() | The default constructor. | +| [DefaultEmbeddingModel](ChatGptOptionsBuilder/DefaultEmbeddingModel.md) { get; set; } | Gets or sets the default model for embedding. (default: [`TextEmbeddingAda002`](../ChatGptNet.Models.Embeddings/OpenAIEmbeddingModels/TextEmbeddingAda002.md) when the provider is OpenAI). | | [DefaultModel](ChatGptOptionsBuilder/DefaultModel.md) { get; set; } | Gets or sets the default model for chat completion. (default: [`Gpt35Turbo`](../ChatGptNet.Models/OpenAIChatGptModels/Gpt35Turbo.md) when the provider is OpenAI). | | [DefaultParameters](ChatGptOptionsBuilder/DefaultParameters.md) { get; set; } | Gets or sets the default parameters for chat completion. | | [MessageExpiration](ChatGptOptionsBuilder/MessageExpiration.md) { get; set; } | Gets or sets the expiration for cached conversation messages (default: 1 hour). | diff --git a/docs/ChatGptNet/ChatGptOptionsBuilder/DefaultEmbeddingModel.md b/docs/ChatGptNet/ChatGptOptionsBuilder/DefaultEmbeddingModel.md new file mode 100644 index 0000000..0eedd46 --- /dev/null +++ b/docs/ChatGptNet/ChatGptOptionsBuilder/DefaultEmbeddingModel.md @@ -0,0 +1,15 @@ +# ChatGptOptionsBuilder.DefaultEmbeddingModel property + +Gets or sets the default model for embedding. (default: [`TextEmbeddingAda002`](../../ChatGptNet.Models.Embeddings/OpenAIEmbeddingModels/TextEmbeddingAda002.md) when the provider is OpenAI). + +```csharp +public string? DefaultEmbeddingModel { get; set; } +``` + +## See Also + +* class [OpenAIEmbeddingModels](../../ChatGptNet.Models.Embeddings/OpenAIEmbeddingModels.md) +* class [ChatGptOptionsBuilder](../ChatGptOptionsBuilder.md) +* namespace [ChatGptNet](../../ChatGptNet.md) + + diff --git a/docs/ChatGptNet/IChatGptClient.md b/docs/ChatGptNet/IChatGptClient.md index 85f33f4..c6c2b1d 100644 --- a/docs/ChatGptNet/IChatGptClient.md +++ b/docs/ChatGptNet/IChatGptClient.md @@ -14,8 +14,9 @@ public interface IChatGptClient | [AddInteractionAsync](IChatGptClient/AddInteractionAsync.md)(…) | Explicitly adds a new interaction (a question and the corresponding answer) to the conversation history. | | [AskAsync](IChatGptClient/AskAsync.md)(…) | Requests a new chat interaction. (4 methods) | | [AskStreamAsync](IChatGptClient/AskStreamAsync.md)(…) | Requests a new chat interaction with streaming response, like in ChatGPT. (2 methods) | -| [ConversationExistsAsync](IChatGptClient/ConversationExistsAsync.md)(…) | Determines if a chat conversation exists. | +| [ConversationExistsAsync](IChatGptClient/ConversationExistsAsync.md)(…) | Checks if a chat conversation exists. | | [DeleteConversationAsync](IChatGptClient/DeleteConversationAsync.md)(…) | Deletes a chat conversation, clearing all the history. | +| [GenerateEmbeddingAsync](IChatGptClient/GenerateEmbeddingAsync.md)(…) | Generates embeddings for a message. (2 methods) | | [GetConversationAsync](IChatGptClient/GetConversationAsync.md)(…) | Retrieves a chat conversation from the cache. | | [LoadConversationAsync](IChatGptClient/LoadConversationAsync.md)(…) | Loads messages into a new conversation. (2 methods) | | [SetupAsync](IChatGptClient/SetupAsync.md)(…) | Setups a new conversation with a system message, that is used to influence assistant behavior. (2 methods) | diff --git a/docs/ChatGptNet/IChatGptClient/AskAsync.md b/docs/ChatGptNet/IChatGptClient/AskAsync.md index eeb9ead..e0da978 100644 --- a/docs/ChatGptNet/IChatGptClient/AskAsync.md +++ b/docs/ChatGptNet/IChatGptClient/AskAsync.md @@ -12,7 +12,7 @@ public Task AskAsync(string message, ChatGptParameters? paramet | --- | --- | | message | The message. | | parameters | A [`ChatGptParameters`](../../ChatGptNet.Models/ChatGptParameters.md) object used to override the default completion parameters in the [`DefaultParameters`](../ChatGptOptions/DefaultParameters.md) property. | -| model | The chat completion model to use. If model is `null`, then the one specified in the [`DefaultModel`](../ChatGptOptions/DefaultModel.md) property will be used. | +| model | The chat completion model to use. If *model* is `null`, then the one specified in the [`DefaultModel`](../ChatGptOptions/DefaultModel.md) property will be used. | | addToConversationHistory | Set to `true` to add the current chat interaction to the conversation history. | | cancellationToken | The token to monitor for cancellation requests. | @@ -56,7 +56,7 @@ public Task AskAsync(Guid conversationId, string message, | conversationId | The unique identifier of the conversation, used to automatically retrieve previous messages in the chat history. | | message | The message. | | parameters | A object used to override the default completion parameters in the [`DefaultParameters`](../ChatGptOptions/DefaultParameters.md) property. | -| model | The chat completion model to use. If model is `null`, then the one specified in the [`DefaultModel`](../ChatGptOptions/DefaultModel.md) property will be used. | +| model | The chat completion model to use. If *model* is `null`, then the one specified in the [`DefaultModel`](../ChatGptOptions/DefaultModel.md) property will be used. | | addToConversationHistory | Set to `true` to add the current chat interaction to the conversation history. | | cancellationToken | The token to monitor for cancellation requests. | @@ -96,7 +96,7 @@ public Task AskAsync(string message, | message | The message. | | functionParameters | A [`ChatGptFunctionParameters`](../../ChatGptNet.Models/ChatGptFunctionParameters.md) object that contains the list of available functions for calling. | | parameters | A [`ChatGptParameters`](../../ChatGptNet.Models/ChatGptParameters.md) object used to override the default completion parameters in the [`DefaultParameters`](../ChatGptOptions/DefaultParameters.md) property. | -| model | The chat completion model to use. If model is `null`, then the one specified in the [`DefaultModel`](../ChatGptOptions/DefaultModel.md) property will be used. | +| model | The chat completion model to use. If *model* is `null`, then the one specified in the [`DefaultModel`](../ChatGptOptions/DefaultModel.md) property will be used. | | addToConversationHistory | Set to `true` to add the current chat interaction to the conversation history. | | cancellationToken | The token to monitor for cancellation requests. | @@ -145,7 +145,7 @@ public Task AskAsync(Guid conversationId, string message, | message | The message. | | functionParameters | A [`ChatGptFunctionParameters`](../../ChatGptNet.Models/ChatGptFunctionParameters.md) object that contains the list of available functions for calling. | | parameters | A object used to override the default completion parameters in the [`DefaultParameters`](../ChatGptOptions/DefaultParameters.md) property. | -| model | The chat completion model to use. If model is `null`, then the one specified in the [`DefaultModel`](../ChatGptOptions/DefaultModel.md) property will be used. | +| model | The chat completion model to use. If *model* is `null`, then the one specified in the [`DefaultModel`](../ChatGptOptions/DefaultModel.md) property will be used. | | addToConversationHistory | Set to `true` to add the current chat interaction to the conversation history. | | cancellationToken | The token to monitor for cancellation requests. | diff --git a/docs/ChatGptNet/IChatGptClient/AskStreamAsync.md b/docs/ChatGptNet/IChatGptClient/AskStreamAsync.md index 5120b94..38ec3aa 100644 --- a/docs/ChatGptNet/IChatGptClient/AskStreamAsync.md +++ b/docs/ChatGptNet/IChatGptClient/AskStreamAsync.md @@ -12,7 +12,7 @@ public IAsyncEnumerable AskStreamAsync(string message, | --- | --- | | message | The message. | | parameters | A [`ChatGptParameters`](../../ChatGptNet.Models/ChatGptParameters.md) object used to override the default completion parameters in the [`DefaultParameters`](../ChatGptOptions/DefaultParameters.md) property. | -| model | The chat completion model to use. If model is `null`, then the one specified in the [`DefaultModel`](../ChatGptOptions/DefaultModel.md) property will be used. | +| model | The chat completion model to use. If *model* is `null`, then the one specified in the [`DefaultModel`](../ChatGptOptions/DefaultModel.md) property will be used. | | addToConversationHistory | Set to `true` to add the current chat interaction to the conversation history. | | cancellationToken | The token to monitor for cancellation requests. | @@ -55,7 +55,7 @@ public IAsyncEnumerable AskStreamAsync(Guid conversationId, str | conversationId | The unique identifier of the conversation, used to automatically retrieve previous messages in the chat history. | | message | The message. | | parameters | A [`ChatGptParameters`](../../ChatGptNet.Models/ChatGptParameters.md) object used to override the default completion parameters in the [`DefaultParameters`](../ChatGptOptions/DefaultParameters.md) property. | -| model | The chat completion model to use. If model is `null`, then the one specified in the [`DefaultModel`](../ChatGptOptions/DefaultModel.md) property will be used. | +| model | The chat completion model to use. If *model* is `null`, then the one specified in the [`DefaultModel`](../ChatGptOptions/DefaultModel.md) property will be used. | | addToConversationHistory | Set to `true` to add the current chat interaction to the conversation history. | | cancellationToken | The token to monitor for cancellation requests. | diff --git a/docs/ChatGptNet/IChatGptClient/ConversationExistsAsync.md b/docs/ChatGptNet/IChatGptClient/ConversationExistsAsync.md index 19d8ab6..4421c01 100644 --- a/docs/ChatGptNet/IChatGptClient/ConversationExistsAsync.md +++ b/docs/ChatGptNet/IChatGptClient/ConversationExistsAsync.md @@ -1,6 +1,6 @@ # IChatGptClient.ConversationExistsAsync method -Determines if a chat conversation exists. +Checks if a chat conversation exists. ```csharp public Task ConversationExistsAsync(Guid conversationId, diff --git a/docs/ChatGptNet/IChatGptClient/GenerateEmbeddingAsync.md b/docs/ChatGptNet/IChatGptClient/GenerateEmbeddingAsync.md new file mode 100644 index 0000000..b1e3aab --- /dev/null +++ b/docs/ChatGptNet/IChatGptClient/GenerateEmbeddingAsync.md @@ -0,0 +1,65 @@ +# IChatGptClient.GenerateEmbeddingAsync method (1 of 2) + +Generates embeddings for a list of messages. + +```csharp +public Task GenerateEmbeddingAsync(IEnumerable messages, + string? model = null, CancellationToken cancellationToken = default) +``` + +| parameter | description | +| --- | --- | +| messages | The messages to use for generating embeddings. | +| model | The name of the embedding model. If *model* is `null`, then the one specified in the [`DefaultEmbeddingModel`](../ChatGptOptions/DefaultEmbeddingModel.md) property will be used. | +| cancellationToken | The token to monitor for cancellation requests. | + +## Return Value + +The embeddings for the provided messages. + +## Exceptions + +| exception | condition | +| --- | --- | +| [EmbeddingException](../../ChatGptNet.Exceptions/EmbeddingException.md) | An error occurred while calling the API and the [`ThrowExceptionOnError`](../ChatGptOptions/ThrowExceptionOnError.md) is `true`. | + +## See Also + +* class [EmbeddingResponse](../../ChatGptNet.Models.Embeddings/EmbeddingResponse.md) +* interface [IChatGptClient](../IChatGptClient.md) +* namespace [ChatGptNet](../../ChatGptNet.md) + +--- + +# IChatGptClient.GenerateEmbeddingAsync method (2 of 2) + +Generates embeddings for a message. + +```csharp +public Task GenerateEmbeddingAsync(string message, string? model = null, + CancellationToken cancellationToken = default) +``` + +| parameter | description | +| --- | --- | +| message | The message to use for generating embeddings. | +| model | The name of the embedding model. If *model* is `null`, then the one specified in the [`DefaultEmbeddingModel`](../ChatGptOptions/DefaultEmbeddingModel.md) property will be used. | +| cancellationToken | The token to monitor for cancellation requests. | + +## Return Value + +The embeddings for the provided message. + +## Exceptions + +| exception | condition | +| --- | --- | +| [EmbeddingException](../../ChatGptNet.Exceptions/EmbeddingException.md) | An error occurred while calling the API and the [`ThrowExceptionOnError`](../ChatGptOptions/ThrowExceptionOnError.md) is `true`. | + +## See Also + +* class [EmbeddingResponse](../../ChatGptNet.Models.Embeddings/EmbeddingResponse.md) +* interface [IChatGptClient](../IChatGptClient.md) +* namespace [ChatGptNet](../../ChatGptNet.md) + + diff --git a/docs/README.md b/docs/README.md index a433676..6806e58 100644 --- a/docs/README.md +++ b/docs/README.md @@ -18,13 +18,15 @@ | public type | description | | --- | --- | -| class [ChatGptException](./ChatGptNet.Exceptions/ChatGptException.md) | Represents errors that occur during API invocation. | +| class [ChatGptException](./ChatGptNet.Exceptions/ChatGptException.md) | Represents errors that occur during ChatGPT API invocation. | +| class [EmbeddingException](./ChatGptNet.Exceptions/EmbeddingException.md) | Represents errors that occur during Embeddings API invocation. | ## ChatGptNet.Extensions namespace | public type | description | | --- | --- | | static class [ChatGptResponseExtensions](./ChatGptNet.Extensions/ChatGptResponseExtensions.md) | Provides extension methods for the [`ChatGptResponse`](./ChatGptNet.Models/ChatGptResponse.md) class. | +| static class [EmbeddingUtility](./ChatGptNet.Extensions/EmbeddingUtility.md) | Provides utility methods to work with embeddings. | ## ChatGptNet.Models namespace @@ -50,6 +52,20 @@ | class [ChatGptUsage](./ChatGptNet.Models/ChatGptUsage.md) | Contains information about the API usage. | | static class [OpenAIChatGptModels](./ChatGptNet.Models/OpenAIChatGptModels.md) | Contains all the chat completion models that are currently supported by OpenAI. | +## ChatGptNet.Models.Common namespace + +| public type | description | +| --- | --- | +| abstract class [Response](./ChatGptNet.Models.Common/Response.md) | Contains common properties for all response types. | + +## ChatGptNet.Models.Embeddings namespace + +| public type | description | +| --- | --- | +| class [EmbeddingData](./ChatGptNet.Models.Embeddings/EmbeddingData.md) | Represents an embedding. | +| class [EmbeddingResponse](./ChatGptNet.Models.Embeddings/EmbeddingResponse.md) | Represents an embedding response. | +| static class [OpenAIEmbeddingModels](./ChatGptNet.Models.Embeddings/OpenAIEmbeddingModels.md) | Contains all the embedding models that are currently supported by OpenAI. | + ## ChatGptNet.ServiceConfigurations namespace | public type | description | diff --git a/src/ChatGptNet/ChatGptOptions.cs b/src/ChatGptNet/ChatGptOptions.cs index f34cc1b..6393de0 100644 --- a/src/ChatGptNet/ChatGptOptions.cs +++ b/src/ChatGptNet/ChatGptOptions.cs @@ -1,5 +1,6 @@ using ChatGptNet.Exceptions; using ChatGptNet.Models; +using ChatGptNet.Models.Embeddings; using ChatGptNet.ServiceConfigurations; namespace ChatGptNet; diff --git a/src/ChatGptNet/ChatGptOptionsBuilder.cs b/src/ChatGptNet/ChatGptOptionsBuilder.cs index 4dff382..cbca942 100644 --- a/src/ChatGptNet/ChatGptOptionsBuilder.cs +++ b/src/ChatGptNet/ChatGptOptionsBuilder.cs @@ -1,5 +1,6 @@ using ChatGptNet.Exceptions; using ChatGptNet.Models; +using ChatGptNet.Models.Embeddings; using ChatGptNet.ServiceConfigurations; namespace ChatGptNet; diff --git a/src/ChatGptNet/ChatGptServiceCollectionExtensions.cs b/src/ChatGptNet/ChatGptServiceCollectionExtensions.cs index 3fac0f4..3b408b8 100644 --- a/src/ChatGptNet/ChatGptServiceCollectionExtensions.cs +++ b/src/ChatGptNet/ChatGptServiceCollectionExtensions.cs @@ -1,4 +1,5 @@ using ChatGptNet.Models; +using ChatGptNet.Models.Embeddings; using ChatGptNet.ServiceConfigurations; using Microsoft.Extensions.Caching.Memory; using Microsoft.Extensions.Configuration; diff --git a/src/ChatGptNet/Models/Embeddings/OpenAIEmbeddingModels.cs b/src/ChatGptNet/Models/Embeddings/OpenAIEmbeddingModels.cs index 62127cc..8a1102c 100644 --- a/src/ChatGptNet/Models/Embeddings/OpenAIEmbeddingModels.cs +++ b/src/ChatGptNet/Models/Embeddings/OpenAIEmbeddingModels.cs @@ -1,6 +1,6 @@ using ChatGptNet.ServiceConfigurations; -namespace ChatGptNet.Models; +namespace ChatGptNet.Models.Embeddings; /// /// Contains all the embedding models that are currently supported by OpenAI.