Bundle OpenAI API client. Supports Chat Completions (GPT-4o, o1, etc.), Embeddings, Image Generation (DALL-E), and function/tool calling. Set OPENAI_API_KEY environment variable before use. Compile with -lib openai.
ModerationResult
Result of a content moderation check
Operations
GetCategories #
method : public : GetCategories() ~ JsonElementReturn
| Type | Description |
|---|---|
| JsonElement | the raw categories JSON element |
GetCategory #
Check whether a specific category was flagged
method : public : GetCategory(name:String) ~ BoolParameters
| Name | Type | Description |
|---|---|---|
| name | String | category name (e.g. 'hate', 'violence', 'sexual') |
Return
| Type | Description |
|---|---|
| Bool | true if flagged |
GetScore #
Get the confidence score for a specific category
method : public : GetScore(name:String) ~ FloatParameters
| Name | Type | Description |
|---|---|---|
| name | String | category name |
Return
| Type | Description |
|---|---|
| Float | score in [0.0, 1.0] |
GetScores #
method : public : GetScores() ~ JsonElementReturn
| Type | Description |
|---|---|
| JsonElement | the raw category_scores JSON element |