Commit 19ceae4
authored
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.1 parent 7a8bc8b commit 19ceae4
File tree
101 files changed
+1679
-1540
lines changed- api
- examples
- Assistants
- Embeddings
- src
- Custom
- Assistants
- Chat
- Embeddings
- Files
- Models
- Moderations
- Internal
- VectorStores
- Generated
- Models
- tests
- Assistants
- Batch
- Embeddings
- Files
- Models
- Moderations
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
101 files changed
+1679
-1540
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
3 | 22 | | |
4 | 23 | | |
5 | 24 | | |
| |||
Large diffs are not rendered by default.
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
| 52 | + | |
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| |||
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
132 | | - | |
| 132 | + | |
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
| 53 | + | |
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| |||
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
133 | | - | |
| 133 | + | |
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
| 47 | + | |
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| |||
0 commit comments