diff --git a/OpenAI_API.sln.DotSettings b/OpenAI_API.sln.DotSettings new file mode 100644 index 0000000..27d751e --- /dev/null +++ b/OpenAI_API.sln.DotSettings @@ -0,0 +1,2 @@ + + True \ No newline at end of file diff --git a/OpenAI_API/Chat/ChatRequest.cs b/OpenAI_API/Chat/ChatRequest.cs index 166afb2..1d3d358 100644 --- a/OpenAI_API/Chat/ChatRequest.cs +++ b/OpenAI_API/Chat/ChatRequest.cs @@ -1,8 +1,7 @@ using Newtonsoft.Json; -using System; using System.Collections.Generic; using System.Linq; -using System.Text; +using OpenAI_API.Completions; namespace OpenAI_API.Chat { @@ -16,7 +15,7 @@ public class ChatRequest /// The model to use for this request /// [JsonProperty("model")] - public string Model { get; set; } = OpenAI_API.Models.Model.ChatGPTTurbo; + public string Model { get; set; } = Models.Model.ChatGPTTurbo; /// /// The messages to send with this Chat Request @@ -46,7 +45,7 @@ public class ChatRequest /// Specifies where the results should stream and be returned at one time. Do not set this yourself, use the appropriate methods on instead. /// [JsonProperty("stream")] - public bool Stream { get; internal set; } = false; + public bool Stream { get; internal set; } /// /// This is only used for serializing the request into JSON, do not use it directly. @@ -77,7 +76,7 @@ internal object CompiledStop [JsonIgnore] public string StopSequence { - get => MultipleStopSequences?.FirstOrDefault() ?? null; + get => MultipleStopSequences?.FirstOrDefault(); set { if (value != null) diff --git a/OpenAI_API/Completions/CompletionResult.cs b/OpenAI_API/Completions/CompletionResult.cs index c8e4ee7..a48652f 100644 --- a/OpenAI_API/Completions/CompletionResult.cs +++ b/OpenAI_API/Completions/CompletionResult.cs @@ -1,5 +1,4 @@ using Newtonsoft.Json; -using OpenAI_API.Embedding; using System.Collections.Generic; namespace OpenAI_API.Completions @@ -89,18 +88,32 @@ public override string ToString() } } - + /// + /// Represents the logprobs property of a completion choice + /// public class Logprobs { + /// + /// The tokens that were used to generate the completion + /// [JsonProperty("tokens")] public List Tokens { get; set; } + /// + /// The log probabilities of each token + /// [JsonProperty("token_logprobs")] public List TokenLogprobs { get; set; } + /// + /// The top log probabilities for each token + /// [JsonProperty("top_logprobs")] public IList> TopLogprobs { get; set; } + /// + /// The token ids of the tokens + /// [JsonProperty("text_offset")] public List TextOffsets { get; set; } } diff --git a/OpenAI_API/Files/IFilesEndpoint.cs b/OpenAI_API/Files/IFilesEndpoint.cs index cd53fbf..baee77c 100644 --- a/OpenAI_API/Files/IFilesEndpoint.cs +++ b/OpenAI_API/Files/IFilesEndpoint.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using System.Net.Http; using System.Threading.Tasks; namespace OpenAI_API.Files @@ -40,7 +41,7 @@ public interface IFilesEndpoint /// Upload a file that contains document(s) to be used across various endpoints/features. Currently, the size of all the files uploaded by one organization can be up to 1 GB. Please contact OpenAI if you need to increase the storage limit /// /// The name of the file to use for this request - /// The intendend purpose of the uploaded documents. Use "fine-tune" for Fine-tuning. This allows us to validate the format of the uploaded file. + /// The intended purpose of the uploaded documents. Use "fine-tune" for Fine-tuning. This allows us to validate the format of the uploaded file. Task UploadFileAsync(string filePath, string purpose = "fine-tune"); } } \ No newline at end of file diff --git a/OpenAI_API/Model/Model.cs b/OpenAI_API/Model/Model.cs index bdeeb2b..afb811c 100644 --- a/OpenAI_API/Model/Model.cs +++ b/OpenAI_API/Model/Model.cs @@ -230,6 +230,9 @@ public class Permissions [JsonProperty("allow_search_indices")] public bool AllowSearchIndices { get; set; } + /// + /// Does the model allow viewing? + /// [JsonProperty("allow_view")] public bool AllowView { get; set; } @@ -252,6 +255,9 @@ public class Permissions [JsonProperty("group")] public string Group { get; set; } + /// + /// Is the model allowed to be used for blocking? May not be implemented yet. + /// [JsonProperty("is_blocking")] public bool IsBlocking { get; set; } } diff --git a/OpenAI_Tests/OpenAI_Tests.csproj b/OpenAI_Tests/OpenAI_Tests.csproj index f26766e..f0498ed 100644 --- a/OpenAI_Tests/OpenAI_Tests.csproj +++ b/OpenAI_Tests/OpenAI_Tests.csproj @@ -1,7 +1,7 @@ - netcoreapp3.1 + net6.0 false