-
Notifications
You must be signed in to change notification settings - Fork 168
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor and rename types and properties for consistency and clarity (#…
…225) ### Summary of Changes This PR renames the following types and properties for consistency and clarity: - **Types:** - `OpenAIFileInfo` → `OpenAIFile` - `OpenAIFileInfoCollection` → `OpenAIFileCollection` - `OpenAIModelInfo` → `OpenAIModel` - `OpenAIModelInfoCollection` → `OpenAIModelCollection` - `Embedding` → `OpenAIEmbedding` - `EmbeddingCollection` → `OpenAIEmbeddingCollection` - **Properties and Methods:** - `ImageUrl` → `ImageUri` and method `FromImageUrl` → `FromImageUri` in `MessageContent` - `ParallelToolCallsEnabled` → `AllowParallelToolCalls` in `RunCreationOptions`, `ThreadRun`, and `ChatCompletionOptions` - `PromptTokens` → `InputTokenCount`, `CompletionTokens` → `OutputTokenCount`, and `TotalTokens` → `TotalTokenCount` in `RunTokenUsage` - `InputTokens` → `InputTokenCount` and `TotalTokens` → `TotalTokenCount` in `EmbeddingTokenUsage` This PR also refactors the `ModerationResult` type to consolidate category-specific flags and scores into individual `ModerationCategory` properties, each containing `Flagged` and `Score` properties: ```csharp public class ModerationResult { public bool Flagged { get; } public ModerationCategory Harassment { get; } public ModerationCategory HarassmentThreatening { get; } public ModerationCategory Hate { get; } public ModerationCategory HateThreatening { get; } public ModerationCategory SelfHarm { get; } public ModerationCategory SelfHarmInstructions { get; } public ModerationCategory SelfHarmIntent { get; } public ModerationCategory Sexual { get; } public ModerationCategory SexualMinors { get; } public ModerationCategory Violence { get; } public ModerationCategory ViolenceGraphic { get; } } public class ModerationCategory { public bool Flagged { get; } public float Score { get; } } ``` Additionally, this PR includes smoke tests for the `ModerationResult` type.
- Loading branch information
1 parent
7a8bc8b
commit 19ceae4
Showing
101 changed files
with
1,679 additions
and
1,540 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
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
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 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Diagnostics.CodeAnalysis; | ||
|
||
namespace OpenAI.Assistants | ||
{ | ||
[Experimental("OPENAI001")] | ||
[CodeGenModel("RunCompletionUsage")] | ||
public partial class RunTokenUsage | ||
{ | ||
// CUSTOM: Renamed. | ||
[CodeGenMember("CompletionTokens")] | ||
public int OutputTokenCount { get; } | ||
|
||
// CUSTOM: Renamed. | ||
[CodeGenMember("PromptTokens")] | ||
public int InputTokenCount { get; } | ||
|
||
// CUSTOM: Renamed. | ||
[CodeGenMember("TotalTokens")] | ||
public int TotalTokenCount { get; } | ||
} | ||
} |
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
Oops, something went wrong.