Adding new moderation model constants (#875)
This commit is contained in:
@@ -14,6 +14,8 @@ import (
|
||||
// If you use text-moderation-stable, we will provide advanced notice before updating the model.
|
||||
// Accuracy of text-moderation-stable may be slightly lower than for text-moderation-latest.
|
||||
const (
|
||||
ModerationOmniLatest = "omni-moderation-latest"
|
||||
ModerationOmni20240926 = "omni-moderation-2024-09-26"
|
||||
ModerationTextStable = "text-moderation-stable"
|
||||
ModerationTextLatest = "text-moderation-latest"
|
||||
// Deprecated: use ModerationTextStable and ModerationTextLatest instead.
|
||||
@@ -25,6 +27,8 @@ var (
|
||||
)
|
||||
|
||||
var validModerationModel = map[string]struct{}{
|
||||
ModerationOmniLatest: {},
|
||||
ModerationOmni20240926: {},
|
||||
ModerationTextStable: {},
|
||||
ModerationTextLatest: {},
|
||||
}
|
||||
|
||||
@@ -37,6 +37,8 @@ func TestModerationsWithDifferentModelOptions(t *testing.T) {
|
||||
getModerationModelTestOption(openai.GPT3Dot5Turbo, openai.ErrModerationInvalidModel),
|
||||
getModerationModelTestOption(openai.ModerationTextStable, nil),
|
||||
getModerationModelTestOption(openai.ModerationTextLatest, nil),
|
||||
getModerationModelTestOption(openai.ModerationOmni20240926, nil),
|
||||
getModerationModelTestOption(openai.ModerationOmniLatest, nil),
|
||||
getModerationModelTestOption("", nil),
|
||||
)
|
||||
client, server, teardown := setupOpenAITestServer()
|
||||
|
||||
Reference in New Issue
Block a user