Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor and rename types and properties for consistency and clarity #225

Merged
merged 2 commits into from
Sep 25, 2024

Conversation

ShivangiReja
Copy link
Collaborator

Summary of Changes

This PR renames the following types and properties for consistency and clarity:

  • Types:

    • OpenAIFileInfoOpenAIFile
    • OpenAIFileInfoCollectionOpenAIFileCollection
    • OpenAIModelInfoOpenAIModel
    • OpenAIModelInfoCollectionOpenAIModelCollection
    • EmbeddingOpenAIEmbedding
    • EmbeddingCollectionOpenAIEmbeddingCollection
  • Properties and Methods:

    • ImageUrlImageUri and method FromImageUrlFromImageUri in MessageContent
    • ParallelToolCallsEnabledAllowParallelToolCalls in RunCreationOptions, ThreadRun, and ChatCompletionOptions
    • PromptTokensInputTokenCount, CompletionTokensOutputTokenCount, and TotalTokensTotalTokenCount in RunTokenUsage
    • InputTokensInputTokenCount and TotalTokensTotalTokenCount 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:

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.

@joseharriaga joseharriaga merged commit 19ceae4 into openai:main Sep 25, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants