diff --git a/docs/ChatGptNet.Models/ChatGptChoice.md b/docs/ChatGptNet.Models/ChatGptChoice.md index 92b0b1c..e2c60f9 100644 --- a/docs/ChatGptNet.Models/ChatGptChoice.md +++ b/docs/ChatGptNet.Models/ChatGptChoice.md @@ -16,6 +16,7 @@ public class ChatGptChoice | [FinishReason](ChatGptChoice/FinishReason.md) { get; set; } | Gets or sets a value specifying why the choice has been returned. | | [Index](ChatGptChoice/Index.md) { get; set; } | Gets or sets the index of the choice in the list. | | [IsFiltered](ChatGptChoice/IsFiltered.md) { get; } | Gets or sets a value indicating whether the this [`ChatGptChoice`](./ChatGptChoice.md) has been filtered by the content filtering system. | +| [LogProbabilities](ChatGptChoice/LogProbabilities.md) { get; set; } | Gets or sets the log probabilities associated with this [`ChatGptChoice`](./ChatGptChoice.md). | | [Message](ChatGptChoice/Message.md) { get; set; } | Gets or sets the message associated with this [`ChatGptChoice`](./ChatGptChoice.md), if any. | ## See Also diff --git a/docs/ChatGptNet.Models/ChatGptChoice/LogProbabilities.md b/docs/ChatGptNet.Models/ChatGptChoice/LogProbabilities.md new file mode 100644 index 0000000..bd169c1 --- /dev/null +++ b/docs/ChatGptNet.Models/ChatGptChoice/LogProbabilities.md @@ -0,0 +1,16 @@ +# ChatGptChoice.LogProbabilities property + +Gets or sets the log probabilities associated with this [`ChatGptChoice`](../ChatGptChoice.md). + +```csharp +public ChatGptLogProbability? LogProbabilities { get; set; } +``` + +## See Also + +* class [ChatGptLogProbability](../ChatGptLogProbability.md) +* class [ChatGptLogProbabilityContent](../ChatGptLogProbabilityContent.md) +* class [ChatGptChoice](../ChatGptChoice.md) +* namespace [ChatGptNet.Models](../../ChatGptNet.md) + + diff --git a/docs/ChatGptNet.Models/ChatGptLogProbability.md b/docs/ChatGptNet.Models/ChatGptLogProbability.md new file mode 100644 index 0000000..6f73aa9 --- /dev/null +++ b/docs/ChatGptNet.Models/ChatGptLogProbability.md @@ -0,0 +1,21 @@ +# ChatGptLogProbability class + +Represents the log probability information of a [`completion choice`](./ChatGptChoice.md). + +```csharp +public class ChatGptLogProbability +``` + +## Public Members + +| name | description | +| --- | --- | +| [ChatGptLogProbability](ChatGptLogProbability/ChatGptLogProbability.md)() | The default constructor. | +| [Content](ChatGptLogProbability/Content.md) { get; set; } | Gets or sets the list of message content tokens with log probability information. | + +## See Also + +* namespace [ChatGptNet.Models](../ChatGptNet.md) +* [ChatGptLogProbability.cs](https://github.com/marcominerva/ChatGptNet/tree/master/src/ChatGptNet/Models/ChatGptLogProbability.cs) + + diff --git a/docs/ChatGptNet.Models/ChatGptLogProbability/ChatGptLogProbability.md b/docs/ChatGptNet.Models/ChatGptLogProbability/ChatGptLogProbability.md new file mode 100644 index 0000000..4422fa3 --- /dev/null +++ b/docs/ChatGptNet.Models/ChatGptLogProbability/ChatGptLogProbability.md @@ -0,0 +1,14 @@ +# ChatGptLogProbability constructor + +The default constructor. + +```csharp +public ChatGptLogProbability() +``` + +## See Also + +* class [ChatGptLogProbability](../ChatGptLogProbability.md) +* namespace [ChatGptNet.Models](../../ChatGptNet.md) + + diff --git a/docs/ChatGptNet.Models/ChatGptLogProbability/Content.md b/docs/ChatGptNet.Models/ChatGptLogProbability/Content.md new file mode 100644 index 0000000..859b4e0 --- /dev/null +++ b/docs/ChatGptNet.Models/ChatGptLogProbability/Content.md @@ -0,0 +1,15 @@ +# ChatGptLogProbability.Content property + +Gets or sets the list of message content tokens with log probability information. + +```csharp +public IEnumerable Content { get; set; } +``` + +## See Also + +* class [ChatGptLogProbabilityContent](../ChatGptLogProbabilityContent.md) +* class [ChatGptLogProbability](../ChatGptLogProbability.md) +* namespace [ChatGptNet.Models](../../ChatGptNet.md) + + diff --git a/docs/ChatGptNet.Models/ChatGptLogProbabilityContent.md b/docs/ChatGptNet.Models/ChatGptLogProbabilityContent.md new file mode 100644 index 0000000..d3918e8 --- /dev/null +++ b/docs/ChatGptNet.Models/ChatGptLogProbabilityContent.md @@ -0,0 +1,24 @@ +# ChatGptLogProbabilityContent class + +Represents a message content token with log probability information. + +```csharp +public class ChatGptLogProbabilityContent +``` + +## Public Members + +| name | description | +| --- | --- | +| [ChatGptLogProbabilityContent](ChatGptLogProbabilityContent/ChatGptLogProbabilityContent.md)() | The default constructor. | +| [Bytes](ChatGptLogProbabilityContent/Bytes.md) { get; set; } | Gets or sets a list of integers representing the UTF-8 bytes representation of the token. Useful in instances where characters are represented by multiple tokens and their byte representations must be combined to generate the correct text representation. Can be `null` if there is no bytes representation for the token. | +| [LogProbality](ChatGptLogProbabilityContent/LogProbality.md) { get; set; } | Gets or sets the log probability of this token, if it is within the top 20 most likely tokens. Otherwise, the value -9999.0 is used to signify that the token is very unlikely. | +| [Token](ChatGptLogProbabilityContent/Token.md) { get; set; } | Gets or sets the token. | +| [TopLogProbabilities](ChatGptLogProbabilityContent/TopLogProbabilities.md) { get; set; } | Gets or sets the list of the most likely tokens and their log probability, at this token position. In rare cases, there may be fewer than the number of requested [`TopLogProbabilities`](./ChatGptParameters/TopLogProbabilities.md) returned. | + +## See Also + +* namespace [ChatGptNet.Models](../ChatGptNet.md) +* [ChatGptLogProbabilityContent.cs](https://github.com/marcominerva/ChatGptNet/tree/master/src/ChatGptNet/Models/ChatGptLogProbabilityContent.cs) + + diff --git a/docs/ChatGptNet.Models/ChatGptLogProbabilityContent/Bytes.md b/docs/ChatGptNet.Models/ChatGptLogProbabilityContent/Bytes.md new file mode 100644 index 0000000..b71fd33 --- /dev/null +++ b/docs/ChatGptNet.Models/ChatGptLogProbabilityContent/Bytes.md @@ -0,0 +1,14 @@ +# ChatGptLogProbabilityContent.Bytes property + +Gets or sets a list of integers representing the UTF-8 bytes representation of the token. Useful in instances where characters are represented by multiple tokens and their byte representations must be combined to generate the correct text representation. Can be `null` if there is no bytes representation for the token. + +```csharp +public IEnumerable? Bytes { get; set; } +``` + +## See Also + +* class [ChatGptLogProbabilityContent](../ChatGptLogProbabilityContent.md) +* namespace [ChatGptNet.Models](../../ChatGptNet.md) + + diff --git a/docs/ChatGptNet.Models/ChatGptLogProbabilityContent/ChatGptLogProbabilityContent.md b/docs/ChatGptNet.Models/ChatGptLogProbabilityContent/ChatGptLogProbabilityContent.md new file mode 100644 index 0000000..86c289f --- /dev/null +++ b/docs/ChatGptNet.Models/ChatGptLogProbabilityContent/ChatGptLogProbabilityContent.md @@ -0,0 +1,14 @@ +# ChatGptLogProbabilityContent constructor + +The default constructor. + +```csharp +public ChatGptLogProbabilityContent() +``` + +## See Also + +* class [ChatGptLogProbabilityContent](../ChatGptLogProbabilityContent.md) +* namespace [ChatGptNet.Models](../../ChatGptNet.md) + + diff --git a/docs/ChatGptNet.Models/ChatGptLogProbabilityContent/LogProbality.md b/docs/ChatGptNet.Models/ChatGptLogProbabilityContent/LogProbality.md new file mode 100644 index 0000000..2fbba3d --- /dev/null +++ b/docs/ChatGptNet.Models/ChatGptLogProbabilityContent/LogProbality.md @@ -0,0 +1,14 @@ +# ChatGptLogProbabilityContent.LogProbality property + +Gets or sets the log probability of this token, if it is within the top 20 most likely tokens. Otherwise, the value -9999.0 is used to signify that the token is very unlikely. + +```csharp +public double LogProbality { get; set; } +``` + +## See Also + +* class [ChatGptLogProbabilityContent](../ChatGptLogProbabilityContent.md) +* namespace [ChatGptNet.Models](../../ChatGptNet.md) + + diff --git a/docs/ChatGptNet.Models/ChatGptLogProbabilityContent/Token.md b/docs/ChatGptNet.Models/ChatGptLogProbabilityContent/Token.md new file mode 100644 index 0000000..75d272c --- /dev/null +++ b/docs/ChatGptNet.Models/ChatGptLogProbabilityContent/Token.md @@ -0,0 +1,14 @@ +# ChatGptLogProbabilityContent.Token property + +Gets or sets the token. + +```csharp +public string Token { get; set; } +``` + +## See Also + +* class [ChatGptLogProbabilityContent](../ChatGptLogProbabilityContent.md) +* namespace [ChatGptNet.Models](../../ChatGptNet.md) + + diff --git a/docs/ChatGptNet.Models/ChatGptLogProbabilityContent/TopLogProbabilities.md b/docs/ChatGptNet.Models/ChatGptLogProbabilityContent/TopLogProbabilities.md new file mode 100644 index 0000000..8431c45 --- /dev/null +++ b/docs/ChatGptNet.Models/ChatGptLogProbabilityContent/TopLogProbabilities.md @@ -0,0 +1,15 @@ +# ChatGptLogProbabilityContent.TopLogProbabilities property + +Gets or sets the list of the most likely tokens and their log probability, at this token position. In rare cases, there may be fewer than the number of requested [`TopLogProbabilities`](../ChatGptParameters/TopLogProbabilities.md) returned. + +```csharp +public IEnumerable? TopLogProbabilities { get; set; } +``` + +## See Also + +* property [TopLogProbabilities](../ChatGptParameters/TopLogProbabilities.md) +* class [ChatGptLogProbabilityContent](../ChatGptLogProbabilityContent.md) +* namespace [ChatGptNet.Models](../../ChatGptNet.md) + + diff --git a/docs/ChatGptNet.Models/ChatGptParameters.md b/docs/ChatGptNet.Models/ChatGptParameters.md index 55f2d51..fadb1de 100644 --- a/docs/ChatGptNet.Models/ChatGptParameters.md +++ b/docs/ChatGptNet.Models/ChatGptParameters.md @@ -12,11 +12,13 @@ public class ChatGptParameters | --- | --- | | [ChatGptParameters](ChatGptParameters/ChatGptParameters.md)() | The default constructor. | | [FrequencyPenalty](ChatGptParameters/FrequencyPenalty.md) { get; set; } | Gets or sets the frequency penalties for chat completion. Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim (default: 0). | +| [LogProbabilities](ChatGptParameters/LogProbabilities.md) { get; set; } | Gets or set a value that determines whether to return log probabilities of the output tokens or not. If `true`, returns the log probabilities of each output token returned in the content of message (default: `false`). | | [MaxTokens](ChatGptParameters/MaxTokens.md) { get; set; } | Gets or sets the maximum number of tokens to generate in the chat completion. The total length of input tokens and generated tokens is limited by the model's context length. | | [PresencePenalty](ChatGptParameters/PresencePenalty.md) { get; set; } | Gets or sets the presence penalties for chat completion. Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics (default: 0). | | [ResponseFormat](ChatGptParameters/ResponseFormat.md) { get; set; } | An object specifying the format that the model must output. Used to enable JSON mode. | -| [Seed](ChatGptParameters/Seed.md) { get; set; } | If specified, the system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result. | +| [Seed](ChatGptParameters/Seed.md) { get; set; } | Gets or sets a value such that, if specified, the system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result. | | [Temperature](ChatGptParameters/Temperature.md) { get; set; } | Gets or sets what sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic (default: 1). | +| [TopLogProbabilities](ChatGptParameters/TopLogProbabilities.md) { get; set; } | Gets or sets a value between 0 and 5 specifying the number of most likely tokens to return at each token position, each with an associated log probability. | | [TopP](ChatGptParameters/TopP.md) { get; set; } | Gets or sets an alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with [`TopP`](./ChatGptParameters/TopP.md) probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered (default: 1). | ## Remarks diff --git a/docs/ChatGptNet.Models/ChatGptParameters/LogProbabilities.md b/docs/ChatGptNet.Models/ChatGptParameters/LogProbabilities.md new file mode 100644 index 0000000..9b7a601 --- /dev/null +++ b/docs/ChatGptNet.Models/ChatGptParameters/LogProbabilities.md @@ -0,0 +1,15 @@ +# ChatGptParameters.LogProbabilities property + +Gets or set a value that determines whether to return log probabilities of the output tokens or not. If `true`, returns the log probabilities of each output token returned in the content of message (default: `false`). + +```csharp +public bool? LogProbabilities { get; set; } +``` + +## See Also + +* property [TopLogProbabilities](./TopLogProbabilities.md) +* class [ChatGptParameters](../ChatGptParameters.md) +* namespace [ChatGptNet.Models](../../ChatGptNet.md) + + diff --git a/docs/ChatGptNet.Models/ChatGptParameters/Seed.md b/docs/ChatGptNet.Models/ChatGptParameters/Seed.md index b5ed24b..c5da373 100644 --- a/docs/ChatGptNet.Models/ChatGptParameters/Seed.md +++ b/docs/ChatGptNet.Models/ChatGptParameters/Seed.md @@ -1,6 +1,6 @@ # ChatGptParameters.Seed property -If specified, the system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result. +Gets or sets a value such that, if specified, the system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result. ```csharp public int? Seed { get; set; } diff --git a/docs/ChatGptNet.Models/ChatGptParameters/TopLogProbabilities.md b/docs/ChatGptNet.Models/ChatGptParameters/TopLogProbabilities.md new file mode 100644 index 0000000..fc78765 --- /dev/null +++ b/docs/ChatGptNet.Models/ChatGptParameters/TopLogProbabilities.md @@ -0,0 +1,19 @@ +# ChatGptParameters.TopLogProbabilities property + +Gets or sets a value between 0 and 5 specifying the number of most likely tokens to return at each token position, each with an associated log probability. + +```csharp +public int? TopLogProbabilities { get; set; } +``` + +## Remarks + +[`LogProbabilities`](./LogProbabilities.md)must be set to `true` if this parameter is used. + +## See Also + +* property [LogProbabilities](./LogProbabilities.md) +* class [ChatGptParameters](../ChatGptParameters.md) +* namespace [ChatGptNet.Models](../../ChatGptNet.md) + + diff --git a/docs/README.md b/docs/README.md index 06e28a5..3289e5f 100644 --- a/docs/README.md +++ b/docs/README.md @@ -47,6 +47,8 @@ | class [ChatGptFunction](./ChatGptNet.Models/ChatGptFunction.md) | Represents the description of a function available for ChatGPT. | | class [ChatGptFunctionCall](./ChatGptNet.Models/ChatGptFunctionCall.md) | Represents a response function call. | | class [ChatGptInnerError](./ChatGptNet.Models/ChatGptInnerError.md) | Contains further details about the error. | +| class [ChatGptLogProbability](./ChatGptNet.Models/ChatGptLogProbability.md) | Represents the log probability information of a [`completion choice`](./ChatGptNet.Models/ChatGptChoice.md). | +| class [ChatGptLogProbabilityContent](./ChatGptNet.Models/ChatGptLogProbabilityContent.md) | Represents a message content token with log probability information. | | class [ChatGptMessage](./ChatGptNet.Models/ChatGptMessage.md) | Represents a single chat message. | | class [ChatGptParameters](./ChatGptNet.Models/ChatGptParameters.md) | Represents chat completion parameters. | | class [ChatGptPromptFilterResults](./ChatGptNet.Models/ChatGptPromptFilterResults.md) | Contains information about content filtering for input prompts. |