Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@
"Slug": "createmoderation",
"Description": "Classifies if text and/or image inputs are potentially harmful. Learn\nmore in the [moderation guide](https://developers.openai.com/api/docs/guides/moderation).",
"Language": "http",
"Code": "### Create moderation\n# @name createModeration\nPOST {{host}}/moderations\nAuthorization: Bearer {{token}}\nContent-Type: application/json\nAccept: application/json\n\n{\n \u0022input\u0022: \u0022I want to kill them.\u0022,\n \u0022model\u0022: \u0022omni-moderation-2024-09-26\u0022\n}\n\n## Responses\n# 200\n# Description: OK\n# Content-Type: application/json\n# 400\n# Description: Invalid moderation input or unsupported request parameters.\n# Content-Type: application/json\n# 403\n# Description: Access to the requested moderation model was denied.\n# Content-Type: application/json\n# 429\n# Description: The request was rejected because a rate limit was exceeded. A slow_down error means traffic increased too quickly; reduce your request rate, then increase it gradually.\n# Content-Type: application/json\n# 500\n# Description: The moderation request could not be processed due to an internal error.\n# Content-Type: application/json\n# 503\n# Description: The service is temporarily unavailable. A server_is_overloaded error means the requested model is temporarily overloaded; retry after a brief delay.\n# Content-Type: application/json",
"Code": "### Create moderation\n# @name createModeration\nPOST {{host}}/moderations\nAuthorization: Bearer {{token}}\nContent-Type: application/json\nAccept: application/json\n\n{\n \u0022input\u0022: \u0022...text to classify goes here...\u0022,\n \u0022model\u0022: \u0022omni-moderation-2024-09-26\u0022\n}\n\n## Responses\n# 200\n# Description: OK\n# Content-Type: application/json\n# 400\n# Description: Invalid moderation input or unsupported request parameters.\n# Content-Type: application/json\n# 403\n# Description: Access to the requested moderation model was denied.\n# Content-Type: application/json\n# 429\n# Description: The request was rejected because a rate limit was exceeded. A slow_down error means traffic increased too quickly; reduce your request rate, then increase it gradually.\n# Content-Type: application/json\n# 500\n# Description: The moderation request could not be processed due to an internal error.\n# Content-Type: application/json\n# 503\n# Description: The service is temporarily unavailable. A server_is_overloaded error means the requested model is temporarily overloaded; retry after a brief delay.\n# Content-Type: application/json",
"Format": "http",
"OperationId": "createModeration",
"Setup": null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ public sealed partial class CreateModerationRequestInputVariant3ItemVariant2

/// <summary>
/// A string of text to classify.<br/>
/// Example: I want to kill them
/// Example: ...text to classify goes here...
/// </summary>
/// <example>I want to kill them</example>
/// <example>...text to classify goes here...</example>
[global::System.Text.Json.Serialization.JsonPropertyName("text")]
[global::System.Text.Json.Serialization.JsonRequired]
public required string Text { get; set; }
Expand All @@ -35,7 +35,7 @@ public sealed partial class CreateModerationRequestInputVariant3ItemVariant2
/// </summary>
/// <param name="text">
/// A string of text to classify.<br/>
/// Example: I want to kill them
/// Example: ...text to classify goes here...
/// </param>
/// <param name="type">
/// Always `text`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ public enum ServiceTierParam
///
/// </summary>
Priority,
/// <summary>
///
/// </summary>
Ultrafast,
}

/// <summary>
Expand All @@ -47,6 +51,7 @@ public static string ToValueString(this ServiceTierParam value)
ServiceTierParam.Fast => "fast",
ServiceTierParam.Flex => "flex",
ServiceTierParam.Priority => "priority",
ServiceTierParam.Ultrafast => "ultrafast",
_ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null),
};
}
Expand All @@ -62,6 +67,7 @@ public static string ToValueString(this ServiceTierParam value)
"fast" => ServiceTierParam.Fast,
"flex" => ServiceTierParam.Flex,
"priority" => ServiceTierParam.Priority,
"ultrafast" => ServiceTierParam.Ultrafast,
_ => null,
};
}
Expand Down
16 changes: 9 additions & 7 deletions src/libs/tryAGI.OpenAI/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10716,15 +10716,15 @@ paths:
-H "Authorization: Bearer $OPENAI_API_KEY" \
-d '{
"model": "omni-moderation-latest",
"input": "I want to kill them."
"input": "...text to classify goes here..."
}'
python: |
from openai import OpenAI
client = OpenAI()

moderation = client.moderations.create(
model="omni-moderation-latest",
input="I want to kill them.",
input="...text to classify goes here...",
)
print(moderation)
javascript: |
Expand All @@ -10735,7 +10735,7 @@ paths:
async function main() {
const moderation = await openai.moderations.create({
model: "omni-moderation-latest",
input: "I want to kill them.",
input: "...text to classify goes here...",
});

console.log(moderation);
Expand All @@ -10757,7 +10757,7 @@ paths:


ClientResult<ModerationResult> moderation =
client.ClassifyText("I want to kill them.");
client.ClassifyText("...text to classify goes here...");
response: |
{
"id": "modr-AB8CjOTu2jiq12hp1AQPfeqFWaORR",
Expand Down Expand Up @@ -47212,13 +47212,13 @@ components:
- type: string
description: A string of text to classify for moderation.
default: ""
example: I want to kill them.
example: ...text to classify goes here...
- type: array
description: An array of strings to classify for moderation.
items:
type: string
default: ""
example: I want to kill them.
example: ...text to classify goes here...
- type: array
description: An array of multi-modal inputs to the moderation model.
items:
Expand Down Expand Up @@ -47259,7 +47259,7 @@ components:
text:
description: A string of text to classify.
type: string
example: I want to kill them
example: ...text to classify goes here...
required:
- type
- text
Expand Down Expand Up @@ -94937,12 +94937,14 @@ components:
- flex
- priority
- fast
- ultrafast
x-enumDescriptions:
- Selects the service tier automatically.
- Uses the default service tier.
- Uses the flex service tier.
- Uses the priority service tier.
- Uses the fast service tier.
- Uses the ultrafast service tier.
description: The service tier used for model requests.
PersistedAgentToolConfigParamFunction:
type: object
Expand Down
Loading