Moderation api types
Some checks failed
ci/woodpecker/push/author-tests Pipeline failed

This commit is contained in:
Ryan Voots 2023-12-31 18:58:23 -05:00
parent 4145bc6a63
commit bf4f20792e
3 changed files with 121 additions and 975 deletions

1049
.vstags

File diff suppressed because it is too large Load diff

View file

@ -277,4 +277,11 @@ class OpenAIAsync::Types::Requests::CreateTranslations :does(OpenAIAsync::Types:
field $temperature = undef; # number, between 0 and 1. higher values with make the ouput more random but lower values will make it more deterministic.
}
class OpenAIAsync::Types::Requests::Moderations :does(OpenAIAsync::Types::Requests::Base) :Struct {
method _endpoint() {"/moderations"}
field $input :JSONStr;
field $model :JSONStr = undef;
}
1;

View file

@ -120,3 +120,43 @@ class OpenAIAsync::Types::Results::ModelInfo :does(OpenAIAsync::Types::Base) :St
field $object :JSONStr = "model";
field $owned_by :JSONStr;
}
class OpenAIAsync::Types::Results::Moderation :does(OpenAIAsync::Types::Base) :Struct {
field $id :JSONStr;
field $model :JSONStr;
field $results :MarshalTo([OpenAIAsync::Types::Results::ModerationResults]); # Not really sure why it's an array, the input doesn't allow multiple things to categorize
}
class OpenAIAsync::Types::Results::ModerationResults :does(OpenAIAsync::Types::Base) :Struct {
field $flagged :JSONBool;
field $categories :MarshalTo(OpenAIAsync::Types::Results::ModerationResultsCategories);
field $category_scores :MarshalTo(OpenAIAsync::Types::Results::ModerationResultsCategoryScores);
}
class OpenAIAsync::Types::Results::ModerationResultsCategories :does(OpenAIAsync::Types::Base) :Struct {
field $hate :JSONBool;
field $hate_threatening :JSONBool :JSONKey(hate/threatening);
field $harassment :JSONBool;
field $harassment_threatening :JSONBool :JSONKey(harassment/threatening);
field $self_harm :JSONBool :JSONKey(self-harm);
field $self_harm_intent :JSONBool :JSONKey(self-harm/intent);
field $self_harm_instructions :JSONBool :JSONKey(self-harm/instructions);
field $sexual :JSONBool;
field $sexual_minors :JSONBool :JSONKey(sexual/minors);
field $violence :JSONBool;
field $violence_graphic :JSONBool :JSONKey(violence/graphic);
}
class OpenAIAsync::Types::Results::ModerationResultsCategoryScores :does(OpenAIAsync::Types::Base) :Struct {
field $hate :JSONNum;
field $hate_threatening :JSONNum :JSONKey(hate/threatening);
field $harassment :JSONNum;
field $harassment_threatening :JSONNum :JSONKey(harassment/threatening);
field $self_harm :JSONNum :JSONKey(self-harm);
field $self_harm_intent :JSONNum :JSONKey(self-harm/intent);
field $self_harm_instructions :JSONNum :JSONKey(self-harm/instructions);
field $sexual :JSONNum;
field $sexual_minors :JSONNum :JSONKey(sexual/minors);
field $violence :JSONNum;
field $violence_graphic :JSONNum :JSONKey(violence/graphic);
}