Spaces:
Sleeping
Sleeping
{ | |
"openapi": "3.0.0", | |
"info": { | |
"title": "Infosys Responsible AI - LLM Moderation - OpenAPI 3.0", | |
"description": "API specs for Infosys Responsible AI LLM Moderation layer in OpenAPI 3.0 format", | |
"contact": { | |
"email": "[email protected]" | |
}, | |
"license": { | |
"name": "Infosys", | |
"url": "https://www.infosys.com/" | |
}, | |
"version": "0.0.1" | |
}, | |
"security": [ | |
{ | |
"oauth_auth": [ | |
"write:users", | |
"read:users" | |
] | |
} | |
], | |
"paths": { | |
"/": { | |
"head": { | |
"summary": "Status", | |
"security": [ | |
{ | |
"my_auth": [ | |
"write:users" | |
] | |
} | |
], | |
"operationId": "status__head", | |
"responses": { | |
"200": { | |
"description": "Successful Response", | |
"content": { | |
"application/json": { | |
"schema": {} | |
} | |
} | |
} | |
} | |
} | |
}, | |
"/rai/v1/moderations": { | |
"post": { | |
"tags": [ | |
"Infosys Responsible AI - LLM Moderation" | |
], | |
"security": [ | |
{ | |
"BearerAuth": [] | |
} | |
], | |
"summary": "Moderations", | |
"operationId": "generate_text_rai_v1_moderations_post", | |
"parameters": [ | |
{ | |
"name": "authorization", | |
"in": "header", | |
"required": false, | |
"schema": { | |
"type": "string", | |
"title": "Authorization" | |
} | |
} | |
], | |
"requestBody": { | |
"required": true, | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/completionRequest" | |
} | |
} | |
} | |
}, | |
"responses": { | |
"200": { | |
"description": "Successful Response", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/ModerationResults" | |
} | |
} | |
} | |
}, | |
"422": { | |
"description": "Validation Error", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/HTTPValidationError" | |
} | |
} | |
} | |
} | |
} | |
} | |
}, | |
"/rai/v1/moderations/coupledmoderations": { | |
"post": { | |
"tags": [ | |
"Infosys Responsible AI - LLM Moderation" | |
], | |
"security": [ | |
{ | |
"BearerAuth": [] | |
} | |
], | |
"summary": "Coupled Moderations", | |
"operationId": "generate_text_rai_v1_moderations_coupledmoderations_post", | |
"parameters": [ | |
{ | |
"name": "authorization", | |
"in": "header", | |
"required": false, | |
"schema": { | |
"type": "string", | |
"title": "Authorization" | |
} | |
} | |
], | |
"requestBody": { | |
"required": true, | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/coupledcompletionRequest" | |
} | |
} | |
} | |
}, | |
"responses": { | |
"200": { | |
"description": "Successful Response", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/completionResponse" | |
} | |
} | |
} | |
}, | |
"422": { | |
"description": "Validation Error", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/HTTPValidationError" | |
} | |
} | |
} | |
} | |
} | |
} | |
}, | |
"/rai/v1/moderations/getTemplates/{userId}": { | |
"get": { | |
"tags": [ | |
"Infosys Responsible AI - LLM Moderation" | |
], | |
"security": [ | |
{ | |
"BearerAuth": [] | |
} | |
], | |
"parameters": [ | |
{ | |
"name": "userId", | |
"in": "path", | |
"required": true, | |
"schema": { | |
"type": "string", | |
"title": "userId" | |
} | |
} | |
], | |
"summary": "Get Templates", | |
"operationId": "generate_text_rai_v1_moderations_templates_get", | |
"responses": { | |
"200": { | |
"description": "Successful Response", | |
"content": { | |
"application/json": { | |
"schema": {} | |
} | |
} | |
} | |
} | |
} | |
}, | |
"/rai/v1/moderations/evalLLM": { | |
"post": { | |
"tags": [ | |
"Infosys Responsible AI - LLM Moderation" | |
], | |
"security": [ | |
{ | |
"my_auth": [ | |
"write:users" | |
] | |
} | |
], | |
"summary": "Eval LLM", | |
"operationId": "generate_text_rai_v1_moderations_evalLLM_post", | |
"requestBody": { | |
"required": true, | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/evalLLMCheckRequest" | |
} | |
} | |
} | |
}, | |
"responses": { | |
"200": { | |
"description": "Successful Response", | |
"content": { | |
"application/json": { | |
"schema": {} | |
} | |
} | |
}, | |
"422": { | |
"description": "Validation Error", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/HTTPValidationError" | |
} | |
} | |
} | |
} | |
} | |
} | |
}, | |
"/rai/v1/moderations/multimodal": { | |
"post": { | |
"tags": [ | |
"Infosys Responsible AI - LLM Moderation" | |
], | |
"security": [ | |
{ | |
"my_auth": [ | |
"write:users" | |
] | |
} | |
], | |
"summary": "Multimodal", | |
"operationId": "generate_text_rai_v1_moderations_multimodal_post", | |
"requestBody": { | |
"required": true, | |
"content": { | |
"multipart/form-data": { | |
"schema": { | |
"$ref": "#/components/schemas/multimodalRequest" | |
} | |
} | |
} | |
}, | |
"responses": { | |
"200": { | |
"description": "Successful Response", | |
"content": { | |
"application/json": { | |
"schema": {} | |
} | |
} | |
}, | |
"422": { | |
"description": "Validation Error", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/HTTPValidationError" | |
} | |
} | |
} | |
} | |
} | |
} | |
}, | |
"/rai/v1/moderations/translate": { | |
"post": { | |
"tags": [ | |
"Infosys Responsible AI - LLM Moderation" | |
], | |
"security": [ | |
{ | |
"my_auth": [ | |
"write:users" | |
] | |
} | |
], | |
"summary": "Translate", | |
"operationId": "generate_text_rai_v1_moderations_translate_post", | |
"requestBody": { | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/translateRequest" | |
} | |
} | |
}, | |
"required": true | |
}, | |
"responses": { | |
"200": { | |
"description": "Successful Response", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/translateResponse" | |
} | |
} | |
} | |
}, | |
"422": { | |
"description": "Validation Error", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/HTTPValidationError" | |
} | |
} | |
} | |
} | |
} | |
} | |
}, | |
"/rai/v1/moderations/openai": { | |
"post": { | |
"tags": [ | |
"Infosys Responsible AI - LLM Moderation" | |
], | |
"security": [ | |
{ | |
"my_auth": [ | |
"write:users" | |
] | |
} | |
], | |
"summary": "Open AI Completion", | |
"operationId": "generate_text_rai_v1_moderations_openai_post", | |
"requestBody": { | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/openAIRequest" | |
} | |
} | |
}, | |
"required": true | |
}, | |
"responses": { | |
"200": { | |
"description": "Successful Response", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/Choice" | |
} | |
} | |
} | |
}, | |
"422": { | |
"description": "Validation Error", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/HTTPValidationError" | |
} | |
} | |
} | |
} | |
} | |
} | |
}, | |
"/rai/v1/moderations/openaiCOT": { | |
"post": { | |
"tags": [ | |
"Infosys Responsible AI - LLM Moderation" | |
], | |
"security": [ | |
{ | |
"my_auth": [ | |
"write:users" | |
] | |
} | |
], | |
"summary": "Chain of Thought", | |
"operationId": "generate_text_rai_v1_moderations_openaiCOT_post", | |
"requestBody": { | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/openAIRequest" | |
} | |
} | |
}, | |
"required": true | |
}, | |
"responses": { | |
"200": { | |
"description": "Successful Response", | |
"content": { | |
"application/json": { | |
"schema": {} | |
} | |
} | |
}, | |
"422": { | |
"description": "Validation Error", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/HTTPValidationError" | |
} | |
} | |
} | |
} | |
} | |
} | |
}, | |
"/rai/v1/moderations/healthcareopenaiCOT": { | |
"post": { | |
"tags": [ | |
"Infosys Responsible AI - LLM Moderation" | |
], | |
"security": [{ | |
"my_auth": ["write:users"] | |
}], | |
"summary": "Explain Chain of Thought Text", | |
"operationId": "generate_text_rai_v1_moderations_healthcareopenaiCOT_post", | |
"requestBody": { | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/healthcareopenaiCOT" | |
} | |
} | |
}, | |
"required": true | |
}, | |
"responses": { | |
"200": { | |
"description": "Successful Response", | |
"content": { | |
"application/json": { | |
"schema": {} | |
} | |
} | |
}, | |
"422": { | |
"description": "Validation Error", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/HTTPValidationError" | |
} | |
} | |
} | |
} | |
} | |
} | |
}, | |
"/rai/v1/moderations/openaiTHOT": { | |
"post": { | |
"tags": [ | |
"Infosys Responsible AI - LLM Moderation" | |
], | |
"security": [ | |
{ | |
"my_auth": [ | |
"write:users" | |
] | |
} | |
], | |
"summary": "Thread of Thought", | |
"operationId": "generate_text_rai_v1_moderations_openaiTHOT_post", | |
"requestBody": { | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/openAIRequest" | |
} | |
} | |
}, | |
"required": true | |
}, | |
"responses": { | |
"200": { | |
"description": "Successful Response", | |
"content": { | |
"application/json": { | |
"schema": {} | |
} | |
} | |
}, | |
"422": { | |
"description": "Validation Error", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/HTTPValidationError" | |
} | |
} | |
} | |
} | |
} | |
} | |
}, | |
"/rai/v1/moderations/ModerationTime": { | |
"get": { | |
"tags": [ | |
"Infosys Responsible AI - LLM Moderation" | |
], | |
"security": [ | |
{ | |
"my_auth": [ | |
"write:users" | |
] | |
} | |
], | |
"summary": "Moderation Time", | |
"operationId": "generate_text_rai_v1_moderations_ModerationTime_get", | |
"responses": { | |
"200": { | |
"description": "Successful Response", | |
"content": { | |
"application/json": { | |
"schema": {} | |
} | |
} | |
} | |
} | |
} | |
}, | |
"/rai/v1/moderations/setTelemetry": { | |
"post": { | |
"tags": [ | |
"Infosys Responsible AI - LLM Moderation" | |
], | |
"security": [ | |
{ | |
"my_auth": [ | |
"write:users" | |
] | |
} | |
], | |
"summary": "Telemetry Status", | |
"operationId": "telemetry_status_rai_v1_moderations_setTelemetry_post", | |
"parameters": [ | |
{ | |
"name": "payload", | |
"in": "query", | |
"required": true, | |
"schema": { | |
"type": "boolean", | |
"title": "Payload" | |
} | |
} | |
], | |
"responses": { | |
"200": { | |
"description": "Successful Response", | |
"content": { | |
"application/json": { | |
"schema": {} | |
} | |
} | |
}, | |
"422": { | |
"description": "Validation Error", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/HTTPValidationError" | |
} | |
} | |
} | |
} | |
} | |
} | |
}, | |
"/rai/v1/moderations/ToxicityPopup": { | |
"post": { | |
"tags": [ | |
"Infosys Responsible AI - LLM Moderation" | |
], | |
"security": [ | |
{ | |
"my_auth": [ | |
"write:users" | |
] | |
} | |
], | |
"summary": "Toxicity Check", | |
"operationId": "toxicity_check_rai_v1_moderations_ToxicityPopup_post", | |
"parameters": [ | |
{ | |
"name": "authorization", | |
"in": "header", | |
"required": false, | |
"schema": { | |
"type": "string", | |
"title": "Authorization" | |
} | |
} | |
], | |
"requestBody": { | |
"required": true, | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/toxicityPopupRequest" | |
} | |
} | |
} | |
}, | |
"responses": { | |
"200": { | |
"description": "Successful Response", | |
"content": { | |
"application/json": { | |
"schema": {} | |
} | |
} | |
}, | |
"422": { | |
"description": "Validation Error", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/HTTPValidationError" | |
} | |
} | |
} | |
} | |
} | |
} | |
}, | |
"/rai/v1/moderations/ProfanityPopup": { | |
"post": { | |
"tags": [ | |
"Infosys Responsible AI - LLM Moderation" | |
], | |
"security": [ | |
{ | |
"my_auth": [ | |
"write:users" | |
] | |
} | |
], | |
"summary": "Profanity Check", | |
"operationId": "profanity_check_rai_v1_moderations_ProfanityPopup_post", | |
"parameters": [ | |
{ | |
"name": "authorization", | |
"in": "header", | |
"required": false, | |
"schema": { | |
"type": "string", | |
"title": "Authorization" | |
} | |
} | |
], | |
"requestBody": { | |
"required": true, | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/profanityPopupRequest" | |
} | |
} | |
} | |
}, | |
"responses": { | |
"200": { | |
"description": "Successful Response", | |
"content": { | |
"application/json": { | |
"schema": {} | |
} | |
} | |
}, | |
"422": { | |
"description": "Validation Error", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/HTTPValidationError" | |
} | |
} | |
} | |
} | |
} | |
} | |
}, | |
"/rai/v1/moderations/PrivacyPopup": { | |
"post": { | |
"tags": [ | |
"Infosys Responsible AI - LLM Moderation" | |
], | |
"security": [ | |
{ | |
"my_auth": [ | |
"write:users" | |
] | |
} | |
], | |
"summary": "Privacy Check", | |
"operationId": "privacy_check_rai_v1_moderations_PrivacyPopup_post", | |
"requestBody": { | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/privacyPopupRequest" | |
} | |
} | |
}, | |
"required": true | |
}, | |
"responses": { | |
"200": { | |
"description": "Successful Response", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/PrivacyPopupResponse" | |
} | |
} | |
} | |
}, | |
"422": { | |
"description": "Validation Error", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/HTTPValidationError" | |
} | |
} | |
} | |
} | |
} | |
} | |
}, | |
"/rai/v1/moderations/feedback": { | |
"post": { | |
"tags": [ | |
"Infosys Responsible AI - LLM Moderation" | |
], | |
"security": [ | |
{ | |
"my_auth": [ | |
"write:users" | |
] | |
} | |
], | |
"summary": "Feedback", | |
"operationId": "feedback_rai_v1_moderations_feedback_post", | |
"requestBody": { | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/Feedback" | |
} | |
} | |
}, | |
"required": true | |
}, | |
"responses": { | |
"200": { | |
"description": "Successful Response", | |
"content": { | |
"application/json": { | |
"schema": {} | |
} | |
} | |
}, | |
"422": { | |
"description": "Validation Error", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/HTTPValidationError" | |
} | |
} | |
} | |
} | |
} | |
} | |
}, | |
"/rai/v1/moderations/COV": { | |
"post": { | |
"tags": [ | |
"Infosys Responsible AI - LLM Moderation" | |
], | |
"security": [ | |
{ | |
"my_auth": [ | |
"write:users" | |
] | |
} | |
], | |
"summary": "Chain Of Verification", | |
"operationId": "chain_of_verification_rai_v1_moderations_COV_post", | |
"parameters": [ | |
{ | |
"name": "authorization", | |
"in": "header", | |
"required": false, | |
"schema": { | |
"type": "string", | |
"title": "Authorization" | |
} | |
} | |
], | |
"requestBody": { | |
"required": true, | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/covRequest" | |
} | |
} | |
} | |
}, | |
"responses": { | |
"200": { | |
"description": "Successful Response", | |
"content": { | |
"application/json": { | |
"schema": {} | |
} | |
} | |
}, | |
"422": { | |
"description": "Validation Error", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/HTTPValidationError" | |
} | |
} | |
} | |
} | |
} | |
} | |
}, | |
"/rai/v1/moderations/OrgPolicy": { | |
"post": { | |
"tags": [ | |
"Infosys Responsible AI - LLM Moderation" | |
], | |
"security": [ | |
{ | |
"my_auth": [ | |
"write:users" | |
] | |
} | |
], | |
"summary": "Org Policy", | |
"operationId": "org_policy_rai_v1_moderations_OrgPolicy_post", | |
"parameters": [ | |
{ | |
"name": "authorization", | |
"in": "header", | |
"required": false, | |
"schema": { | |
"type": "string", | |
"title": "Authorization" | |
} | |
} | |
], | |
"requestBody": { | |
"required": true, | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/RestrictedTopicRequest" | |
} | |
} | |
} | |
}, | |
"responses": { | |
"200": { | |
"description": "Successful Response", | |
"content": { | |
"application/json": { | |
"schema": {} | |
} | |
} | |
}, | |
"422": { | |
"description": "Validation Error", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/HTTPValidationError" | |
} | |
} | |
} | |
} | |
} | |
} | |
}, | |
"/rai/v1/moderations/gEval": { | |
"post": { | |
"tags": [ | |
"Infosys Responsible AI - LLM Moderation" | |
], | |
"security": [ | |
{ | |
"my_auth": [ | |
"write:users" | |
] | |
} | |
], | |
"summary": "Faithfullness", | |
"operationId": "Faithfullness_rai_v1_moderations_gEval_post", | |
"parameters": [ | |
{ | |
"name": "authorization", | |
"in": "header", | |
"required": false, | |
"schema": { | |
"type": "string", | |
"title": "Authorization" | |
} | |
} | |
], | |
"requestBody": { | |
"required": true, | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/Faithfullness" | |
} | |
} | |
} | |
}, | |
"responses": { | |
"200": { | |
"description": "Successful Response", | |
"content": { | |
"application/json": { | |
"schema": {} | |
} | |
} | |
}, | |
"422": { | |
"description": "Validation Error", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/HTTPValidationError" | |
} | |
} | |
} | |
} | |
} | |
} | |
}, | |
"/rai/v1/moderations/Hallucination_Check": { | |
"post": { | |
"tags": [ | |
"Infosys Responsible AI - LLM Moderation" | |
], | |
"security": [ | |
{ | |
"my_auth": [ | |
"write:users" | |
] | |
} | |
], | |
"summary": "Hallucination Check", | |
"operationId": "hallucination_check_rai_v1_moderations_Hallucination_Check_post", | |
"parameters": [ | |
{ | |
"name": "authorization", | |
"in": "header", | |
"required": false, | |
"schema": { | |
"type": "string", | |
"title": "Authorization" | |
} | |
} | |
], | |
"requestBody": { | |
"required": true, | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/Show_score" | |
} | |
} | |
} | |
}, | |
"responses": { | |
"200": { | |
"description": "Successful Response", | |
"content": { | |
"application/json": { | |
"schema": {} | |
} | |
} | |
}, | |
"422": { | |
"description": "Validation Error", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/HTTPValidationError" | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
}, | |
"components": { | |
"schemas": { | |
"COUPLEDMODERATIONTHRESHOLD": { | |
"properties": { | |
"PromptinjectionThreshold": { | |
"type": "number", | |
"title": "Promptinjectionthreshold", | |
"example": 0.7 | |
}, | |
"JailbreakThreshold": { | |
"type": "number", | |
"title": "Jailbreakthreshold", | |
"example": 0.7 | |
}, | |
"PiientitiesConfiguredToBlock": { | |
"items": { | |
"$ref": "#/components/schemas/PIICHECKS" | |
}, | |
"type": "array", | |
"title": "Piientitiesconfiguredtoblock", | |
"example": [ | |
"AADHAR_NUMBER", | |
"PAN_Number", | |
"IN_PAN" | |
] | |
}, | |
"RefusalThreshold": { | |
"type": "number", | |
"title": "Refusalthreshold", | |
"example": 0.7 | |
}, | |
"ToxicityThresholds": { | |
"$ref": "#/components/schemas/TOXTHRESHOLDS" | |
}, | |
"ProfanityCountThreshold": { | |
"type": "integer", | |
"title": "Profanitycountthreshold", | |
"example": 1 | |
}, | |
"RestrictedtopicDetails": { | |
"$ref": "#/components/schemas/RTTHRESHOLDS" | |
}, | |
"CustomTheme": { | |
"$ref": "#/components/schemas/CustomThemeTexts" | |
}, | |
"SmoothLlmThreshold": { | |
"$ref": "#/components/schemas/SmoothLlmThreshold" | |
} | |
}, | |
"type": "object", | |
"required": [ | |
"PromptinjectionThreshold", | |
"JailbreakThreshold", | |
"PiientitiesConfiguredToDetect", | |
"PiientitiesConfiguredToBlock", | |
"RefusalThreshold", | |
"ToxicityThresholds", | |
"ProfanityCountThreshold", | |
"RestrictedtopicDetails", | |
"CustomTheme", | |
"SmoothLlmThreshold" | |
], | |
"title": "COUPLEDMODERATIONTHRESHOLD" | |
}, | |
"Choice": { | |
"properties": { | |
"text": { | |
"type": "string", | |
"title": "Text", | |
"example": "Russia is the biggest country by area." | |
}, | |
"index": { | |
"type": "integer", | |
"title": "Index", | |
"example": 0 | |
}, | |
"finishReason": { | |
"type": "string", | |
"title": "Finishreason", | |
"example": "length" | |
} | |
}, | |
"type": "object", | |
"required": [ | |
"text", | |
"index", | |
"finishReason" | |
], | |
"title": "Choice" | |
}, | |
"CoupledModerationResults": { | |
"properties": { | |
"requestModeration": { | |
"$ref": "#/components/schemas/CoupledRequestModeration" | |
}, | |
"responseModeration": { | |
"$ref": "#/components/schemas/ResponseModeration" | |
} | |
}, | |
"type": "object", | |
"required": [ | |
"requestModeration", | |
"responseModeration" | |
], | |
"title": "CoupledModerationResults" | |
}, | |
"CoupledRequestModeration": { | |
"properties": { | |
"text": { | |
"type": "string", | |
"title": "Text", | |
"example": "Which is the biggest country in the world?" | |
}, | |
"promptInjectionCheck": { | |
"$ref": "#/components/schemas/promptInjectionCheck" | |
}, | |
"jailbreakCheck": { | |
"$ref": "#/components/schemas/jailbreakCheck" | |
}, | |
"privacyCheck": { | |
"$ref": "#/components/schemas/privacyCheck" | |
}, | |
"profanityCheck": { | |
"$ref": "#/components/schemas/profanityCheck" | |
}, | |
"toxicityCheck": { | |
"$ref": "#/components/schemas/toxicityCheck" | |
}, | |
"restrictedtopic": { | |
"$ref": "#/components/schemas/restrictedtopic" | |
}, | |
"textQuality": { | |
"$ref": "#/components/schemas/textQuality" | |
}, | |
"refusalCheck": { | |
"$ref": "#/components/schemas/refusalCheck" | |
}, | |
"customThemeCheck": { | |
"$ref": "#/components/schemas/customThemeCheck" | |
}, | |
"smoothLlmCheck": { | |
"$ref": "#/components/schemas/smoothLlmCheck" | |
}, | |
"bergeronCheck": { | |
"$ref": "#/components/schemas/bergeronCheck" | |
}, | |
"summary": { | |
"$ref": "#/components/schemas/summary" | |
} | |
}, | |
"type": "object", | |
"required": [ | |
"text", | |
"promptInjectionCheck", | |
"jailbreakCheck", | |
"privacyCheck", | |
"profanityCheck", | |
"toxicityCheck", | |
"restrictedtopic", | |
"textQuality", | |
"refusalCheck", | |
"customThemeCheck", | |
"smoothLlmCheck", | |
"bergeronCheck", | |
"summary" | |
], | |
"title": "CoupledRequestModeration" | |
}, | |
"CustomThemeTexts": { | |
"properties": { | |
"Themename": { | |
"type": "string", | |
"title": "Themename" | |
}, | |
"Themethresold": { | |
"type": "number", | |
"title": "Themethresold", | |
"example": 0.6 | |
}, | |
"ThemeTexts": { | |
"items": {}, | |
"type": "array", | |
"title": "Themetexts", | |
"example": [ | |
"Text1", | |
"Text2", | |
"Text3" | |
] | |
} | |
}, | |
"type": "object", | |
"required": [ | |
"Themename", | |
"Themethresold", | |
"ThemeTexts" | |
], | |
"title": "CustomThemeTexts" | |
}, | |
"Faithfullness": { | |
"properties": { | |
"text": { | |
"type": "string", | |
"title": "Text", | |
"example": "Sachin Tendulkar, often hailed as the \"God of Cricket,\" is a legendary Indian batsman whose impact transcends the boundaries of the sport. Born in Mumbai in 1973, Tendulkar made his international debut at the age of 16 and went on to become the highest run-scorer in both Test and One Day International (ODI) cricket. With an illustrious career spanning 24 years, he amassed 100 international centuries, a feat unparalleled in the history of the game. Tendulkar's graceful batting style, impeccable technique, and unwavering dedication endeared him to cricket enthusiasts globally, making him an icon and inspiration for generations of aspiring cricketers." | |
}, | |
"summary": { | |
"type": "string", | |
"title": "Summary", | |
"example": "Sachin Tendulkar, the \"Father of Cricket,\" is a legendary Indian batsman, debuting at 20. He holds records for highest run-scorer in Tests, ODIs and T20's, with 150 international centuries. Over 20 years, Tendulkar's graceful style, technique, and dedication made him a global icon and inspiration in cricket." | |
}, | |
"model_name": { | |
"anyOf": [ | |
{ | |
"type": "string" | |
}, | |
{ | |
"type": "null" | |
} | |
], | |
"title": "model_name", | |
"example": "gpt4" | |
} | |
}, | |
"type": "object", | |
"required": [ | |
"text", | |
"summary" | |
], | |
"title": "Faithfullness" | |
}, | |
"Feedback": { | |
"properties": { | |
"user_id": { | |
"type": "string", | |
"title": "User Id" | |
}, | |
"message": { | |
"type": "string", | |
"title": "Message" | |
}, | |
"rating": { | |
"$ref": "#/components/schemas/Rating" | |
} | |
}, | |
"type": "object", | |
"required": [ | |
"user_id", | |
"message", | |
"rating" | |
], | |
"title": "Feedback" | |
}, | |
"HTTPValidationError": { | |
"properties": { | |
"detail": { | |
"items": { | |
"$ref": "#/components/schemas/ValidationError" | |
}, | |
"type": "array", | |
"title": "Detail" | |
} | |
}, | |
"type": "object", | |
"title": "HTTPValidationError" | |
}, | |
"MODCHECKS": { | |
"type": "string", | |
"enum": [ | |
"PromptInjection", | |
"JailBreak", | |
"Toxicity", | |
"Piidetct", | |
"Refusal", | |
"Profanity", | |
"RestrictTopic", | |
"TextQuality", | |
"TextRelevance", | |
"CustomizedTheme", | |
"<class 'ModerationLayer.mapper.mapper.MODCHECKS.Config'>" | |
], | |
"title": "MODCHECKS" | |
}, | |
"MODTHRESHOLDS": { | |
"properties": { | |
"PromptinjectionThreshold": { | |
"type": "number", | |
"title": "Promptinjectionthreshold", | |
"example": 0.7 | |
}, | |
"JailbreakThreshold": { | |
"type": "number", | |
"title": "Jailbreakthreshold", | |
"example": 0.7 | |
}, | |
"PiientitiesConfiguredToBlock": { | |
"items": { | |
"$ref": "#/components/schemas/PIICHECKS" | |
}, | |
"type": "array", | |
"title": "Piientitiesconfiguredtoblock", | |
"example": [ | |
"AADHAR_NUMBER", | |
"PAN_Number", | |
"IN_PAN" | |
] | |
}, | |
"RefusalThreshold": { | |
"type": "number", | |
"title": "Refusalthreshold", | |
"example": 0.7 | |
}, | |
"ToxicityThresholds": { | |
"$ref": "#/components/schemas/TOXTHRESHOLDS" | |
}, | |
"ProfanityCountThreshold": { | |
"type": "integer", | |
"title": "Profanitycountthreshold", | |
"example": 1 | |
}, | |
"RestrictedtopicDetails": { | |
"$ref": "#/components/schemas/RTTHRESHOLDS" | |
}, | |
"CustomTheme": { | |
"$ref": "#/components/schemas/CustomThemeTexts" | |
} | |
}, | |
"type": "object", | |
"required": [ | |
"PromptinjectionThreshold", | |
"JailbreakThreshold", | |
"PiientitiesConfiguredToDetect", | |
"PiientitiesConfiguredToBlock", | |
"RefusalThreshold", | |
"ToxicityThresholds", | |
"ProfanityCountThreshold", | |
"RestrictedtopicDetails", | |
"CustomTheme" | |
], | |
"title": "MODTHRESHOLDS" | |
}, | |
"ModerationResults": { | |
"properties": { | |
"lotNumber": { | |
"anyOf": [ | |
{ | |
"type": "string" | |
}, | |
{ | |
"type": "null" | |
} | |
], | |
"title": "Lotnumber", | |
"example": "1" | |
}, | |
"uniqueid": { | |
"type": "string", | |
"title": "Uniqueid", | |
"example": "123e4567-e89b-12d3-a456-426614174000" | |
}, | |
"created": { | |
"anyOf": [ | |
{ | |
"type": "string" | |
}, | |
{ | |
"type": "null" | |
} | |
], | |
"title": "Created", | |
"example": "1646932609" | |
}, | |
"moderationResults": { | |
"$ref": "#/components/schemas/RequestModeration" | |
} | |
}, | |
"type": "object", | |
"required": [ | |
"lotNumber", | |
"uniqueid", | |
"created", | |
"moderationResults" | |
], | |
"title": "ModerationResults" | |
}, | |
"PIICHECKS": { | |
"type": "string", | |
"enum": [ | |
"PERSON", | |
"LOCATION", | |
"DATE", | |
"AU_ABN", | |
"AU_ACN", | |
"AADHAR_NUMBER", | |
"AU_MEDICARE", | |
"AU_TFN", | |
"CREDIT_CARD", | |
"CRYPTO", | |
"DATE_TIME", | |
"EMAIL_ADDRESS", | |
"ES_NIF", | |
"IBAN_CODE", | |
"IP_ADDRESS", | |
"IT_DRIVER_LICENSE", | |
"IT_FISCAL_CODE", | |
"IT_IDENTITY_CARD", | |
"IT_PASSPORT", | |
"IT_VAT_CODE", | |
"MEDICAL_LICENSE", | |
"PAN_Number", | |
"PHONE_NUMBER", | |
"SG_NRIC_FIN", | |
"UK_NHS", | |
"URL", | |
"PASSPORT", | |
"US_ITIN", | |
"US_PASSPORT", | |
"US_SSN", | |
"<class 'ModerationLayer.mapper.mapper.PIICHECKS.Config'>" | |
], | |
"title": "PIICHECKS" | |
}, | |
"PiiEntitiesforPopup": { | |
"properties": { | |
"EntityType": { | |
"type": "string", | |
"title": "Entitytype", | |
"example": "US_SSN" | |
}, | |
"beginOffset": { | |
"type": "integer", | |
"title": "Beginoffset", | |
"example": 19 | |
}, | |
"endOffset": { | |
"type": "integer", | |
"title": "Endoffset", | |
"example": 28 | |
}, | |
"score": { | |
"type": "integer", | |
"title": "Score", | |
"example": 28 | |
}, | |
"value": { | |
"type": "string", | |
"title": "Value", | |
"example": "Karan" | |
} | |
}, | |
"type": "object", | |
"required": [ | |
"EntityType", | |
"beginOffset", | |
"endOffset", | |
"value" | |
], | |
"title": "PiiEntitiesforPopup" | |
}, | |
"PrivacyPopup": { | |
"properties": { | |
"entitiesToDetect": { | |
"items": {}, | |
"type": "array", | |
"title": "Entitiestodetect", | |
"example": [ | |
"US_SSN" | |
] | |
}, | |
"entitiesToBlock": { | |
"items": {}, | |
"type": "array", | |
"title": "Entitiestoblock", | |
"example": [ | |
"US_SSN" | |
] | |
}, | |
"entitiesRecognized": { | |
"items": { | |
"$ref": "#/components/schemas/PiiEntitiesforPopup" | |
}, | |
"type": "array", | |
"title": "Entitiesrecognized" | |
}, | |
"result": { | |
"type": "string", | |
"title": "Result", | |
"example": "Passsed" | |
} | |
}, | |
"type": "object", | |
"required": [ | |
"entitiesToDetect", | |
"entitiesToBlock", | |
"entitiesRecognized", | |
"result" | |
], | |
"title": "PrivacyPopup" | |
}, | |
"PrivacyPopupResponse": { | |
"properties": { | |
"privacyCheck": { | |
"items": { | |
"$ref": "#/components/schemas/PrivacyPopup" | |
}, | |
"type": "array", | |
"title": "Privacycheck" | |
} | |
}, | |
"type": "object", | |
"required": [ | |
"privacyCheck" | |
], | |
"title": "PrivacyPopupResponse" | |
}, | |
"RTTHRESHOLDS": { | |
"properties": { | |
"RestrictedtopicThreshold": { | |
"type": "number", | |
"title": "Restrictedtopicthreshold", | |
"example": 0.7 | |
}, | |
"Restrictedtopics": { | |
"items": {}, | |
"type": "array", | |
"title": "Restrictedtopics", | |
"default": [ | |
"Terrorism", | |
"Explosives" | |
] | |
} | |
}, | |
"type": "object", | |
"required": [ | |
"RestrictedtopicThreshold" | |
], | |
"title": "RTTHRESHOLDS" | |
}, | |
"Rating": { | |
"type": "string", | |
"enum": [ | |
"Good", | |
"Bad" | |
], | |
"title": "Rating" | |
}, | |
"RequestModeration": { | |
"properties": { | |
"text": { | |
"type": "string", | |
"title": "Text", | |
"example": "Which is the biggest country in the world?" | |
}, | |
"promptInjectionCheck": { | |
"$ref": "#/components/schemas/promptInjectionCheck" | |
}, | |
"jailbreakCheck": { | |
"$ref": "#/components/schemas/jailbreakCheck" | |
}, | |
"privacyCheck": { | |
"$ref": "#/components/schemas/privacyCheck" | |
}, | |
"profanityCheck": { | |
"$ref": "#/components/schemas/profanityCheck" | |
}, | |
"toxicityCheck": { | |
"$ref": "#/components/schemas/toxicityCheck" | |
}, | |
"restrictedtopic": { | |
"$ref": "#/components/schemas/restrictedtopic" | |
}, | |
"textQuality": { | |
"$ref": "#/components/schemas/textQuality" | |
}, | |
"refusalCheck": { | |
"$ref": "#/components/schemas/refusalCheck" | |
}, | |
"customThemeCheck": { | |
"$ref": "#/components/schemas/customThemeCheck" | |
}, | |
"summary": { | |
"$ref": "#/components/schemas/summary" | |
} | |
}, | |
"type": "object", | |
"required": [ | |
"text", | |
"promptInjectionCheck", | |
"jailbreakCheck", | |
"privacyCheck", | |
"profanityCheck", | |
"toxicityCheck", | |
"restrictedtopic", | |
"textQuality", | |
"refusalCheck", | |
"customThemeCheck", | |
"summary" | |
], | |
"title": "RequestModeration" | |
}, | |
"ResponseModeration": { | |
"properties": { | |
"generatedText": { | |
"type": "string", | |
"title": "Generatedtext", | |
"example": "Russia is the biggest country by area." | |
}, | |
"privacyCheck": { | |
"$ref": "#/components/schemas/privacyCheck" | |
}, | |
"profanityCheck": { | |
"$ref": "#/components/schemas/profanityCheck" | |
}, | |
"toxicityCheck": { | |
"$ref": "#/components/schemas/toxicityCheck" | |
}, | |
"restrictedtopic": { | |
"$ref": "#/components/schemas/restrictedtopic" | |
}, | |
"textQuality": { | |
"$ref": "#/components/schemas/textQuality" | |
}, | |
"textRelevanceCheck": { | |
"$ref": "#/components/schemas/textRelevanceCheck" | |
}, | |
"refusalCheck": { | |
"$ref": "#/components/schemas/refusalCheck" | |
}, | |
"summary": { | |
"$ref": "#/components/schemas/summary" | |
} | |
}, | |
"type": "object", | |
"required": [ | |
"generatedText", | |
"privacyCheck", | |
"profanityCheck", | |
"toxicityCheck", | |
"restrictedtopic", | |
"textQuality", | |
"textRelevanceCheck", | |
"refusalCheck", | |
"summary" | |
], | |
"title": "ResponseModeration" | |
}, | |
"RestrictedTopicRequest": { | |
"properties": { | |
"text": { | |
"type": "string", | |
"title": "Text", | |
"example": "Russia is the biggest country by area." | |
}, | |
"labels": { | |
"items": {}, | |
"type": "array", | |
"title": "Labels", | |
"default": [ | |
"Terrorism", | |
"Explosives" | |
] | |
} | |
}, | |
"type": "object", | |
"required": [ | |
"text" | |
], | |
"title": "RestrictedTopicRequest" | |
}, | |
"Result": { | |
"type": "string", | |
"enum": [ | |
"PASSED", | |
"FAILED", | |
"UNMODERATED", | |
"<class 'ModerationLayer.mapper.mapper.Result.Config'>" | |
], | |
"title": "Result" | |
}, | |
"Show_score": { | |
"properties": { | |
"prompt": { | |
"type": "string", | |
"title": "Prompt", | |
"example": "Total area of India" | |
}, | |
"response": { | |
"type": "string", | |
"title": "Response", | |
"example": "Response to the input question" | |
}, | |
"sourcearr": { | |
"items": { | |
"type": "string" | |
}, | |
"type": "array", | |
"title": "Sourcearr", | |
"example": [ | |
"source 1", | |
"source 2" | |
] | |
} | |
}, | |
"type": "object", | |
"required": [ | |
"prompt", | |
"response", | |
"sourcearr" | |
], | |
"title": "Show_score" | |
}, | |
"SmoothLlmThreshold": { | |
"properties": { | |
"input_pertubation": { | |
"type": "number", | |
"title": "Input Pertubation", | |
"example": 0.1 | |
}, | |
"number_of_iteration": { | |
"type": "integer", | |
"title": "Number Of Iteration", | |
"example": 4 | |
}, | |
"SmoothLlmThreshold": { | |
"type": "number", | |
"title": "Smoothllmthreshold", | |
"example": 0.6 | |
} | |
}, | |
"type": "object", | |
"required": [ | |
"input_pertubation", | |
"number_of_iteration", | |
"SmoothLlmThreshold" | |
], | |
"title": "SmoothLlmThreshold" | |
}, | |
"TOXTHRESHOLDS": { | |
"properties": { | |
"ToxicityThreshold": { | |
"type": "number", | |
"title": "Toxicitythreshold", | |
"example": 0.6 | |
}, | |
"SevereToxicityThreshold": { | |
"type": "number", | |
"title": "Severetoxicitythreshold", | |
"example": 0.6 | |
}, | |
"ObsceneThreshold": { | |
"type": "number", | |
"title": "Obscenethreshold", | |
"example": 0.6 | |
}, | |
"ThreatThreshold": { | |
"type": "number", | |
"title": "Threatthreshold", | |
"example": 0.6 | |
}, | |
"InsultThreshold": { | |
"type": "number", | |
"title": "Insultthreshold", | |
"example": 0.6 | |
}, | |
"IdentityAttackThreshold": { | |
"type": "number", | |
"title": "Identityattackthreshold", | |
"example": 0.6 | |
}, | |
"SexualExplicitThreshold": { | |
"type": "number", | |
"title": "Sexualexplicitthreshold", | |
"example": 0.6 | |
} | |
}, | |
"type": "object", | |
"required": [ | |
"ToxicityThreshold", | |
"SevereToxicityThreshold", | |
"ObsceneThreshold", | |
"ThreatThreshold", | |
"InsultThreshold", | |
"IdentityAttackThreshold", | |
"SexualExplicitThreshold" | |
], | |
"title": "TOXTHRESHOLDS" | |
}, | |
"ValidationError": { | |
"properties": { | |
"loc": { | |
"items": { | |
"anyOf": [ | |
{ | |
"type": "string" | |
}, | |
{ | |
"type": "integer" | |
} | |
] | |
}, | |
"type": "array", | |
"title": "Location" | |
}, | |
"msg": { | |
"type": "string", | |
"title": "Message" | |
}, | |
"type": { | |
"type": "string", | |
"title": "Error Type" | |
} | |
}, | |
"type": "object", | |
"required": [ | |
"loc", | |
"msg", | |
"type" | |
], | |
"title": "ValidationError" | |
}, | |
"bergeronCheck": { | |
"properties": { | |
"text": { | |
"type": "string", | |
"title": "Text", | |
"example": "SAFE" | |
}, | |
"result": { | |
"allOf": [ | |
{ | |
"$ref": "#/components/schemas/Result" | |
} | |
], | |
"example": "PASSED" | |
} | |
}, | |
"type": "object", | |
"required": [ | |
"text", | |
"result" | |
], | |
"title": "bergeronCheck" | |
}, | |
"completionRequest": { | |
"properties": { | |
"AccountName": { | |
"anyOf": [ | |
{ | |
"type": "string" | |
}, | |
{ | |
"type": "null" | |
} | |
], | |
"title": "Accountname", | |
"example": "None" | |
}, | |
"userid": { | |
"type": "string", | |
"title": "Userid", | |
"example": "None" | |
}, | |
"PortfolioName": { | |
"anyOf": [ | |
{ | |
"type": "string" | |
}, | |
{ | |
"type": "null" | |
} | |
], | |
"title": "Portfolioname", | |
"example": "None" | |
}, | |
"lotNumber": { | |
"anyOf": [ | |
{ | |
"type": "string" | |
}, | |
{ | |
"type": "null" | |
} | |
], | |
"title": "Lotnumber", | |
"example": "1" | |
}, | |
"EmojiModeration": { | |
"type": "string", | |
"title": "EmojiModeration", | |
"example": "yes" | |
}, | |
"Prompt": { | |
"type": "string", | |
"title": "Prompt", | |
"example": "Which is the biggest country in the world?" | |
}, | |
"ModerationChecks": { | |
"items": { | |
"$ref": "#/components/schemas/MODCHECKS" | |
}, | |
"type": "array", | |
"title": "Moderationchecks", | |
"example": [ | |
"PromptInjection", | |
"JailBreak", | |
"Toxicity", | |
"Piidetct", | |
"Refusal", | |
"Profanity", | |
"RestrictTopic", | |
"TextQuality", | |
"CustomizedTheme" | |
] | |
}, | |
"ModerationCheckThresholds": { | |
"anyOf": [ | |
{ | |
"$ref": "#/components/schemas/MODTHRESHOLDS" | |
}, | |
{ | |
"$ref": "#/components/schemas/COUPLEDMODERATIONTHRESHOLD" | |
} | |
], | |
"title": "Moderationcheckthresholds" | |
} | |
}, | |
"type": "object", | |
"required": [ | |
"Prompt", | |
"ModerationChecks", | |
"ModerationCheckThresholds" | |
], | |
"title": "completionRequest" | |
}, | |
"completionResponse": { | |
"properties": { | |
"uniqueid": { | |
"type": "string", | |
"title": "Uniqueid", | |
"example": "123e4567-e89b-12d3-a456-426614174000" | |
}, | |
"object": { | |
"type": "string", | |
"title": "Object", | |
"example": "text_completion" | |
}, | |
"userid": { | |
"type": "string", | |
"title": "Userid", | |
"example": "None" | |
}, | |
"lotNumber": { | |
"type": "string", | |
"title": "Lotnumber", | |
"example": 1 | |
}, | |
"created": { | |
"type": "string", | |
"title": "Created", | |
"example": "1646932609" | |
}, | |
"model": { | |
"type": "string", | |
"title": "Model", | |
"example": "gpt-35-turbo" | |
}, | |
"choices": { | |
"items": { | |
"$ref": "#/components/schemas/Choice" | |
}, | |
"type": "array", | |
"title": "Choices" | |
}, | |
"moderationResults": { | |
"$ref": "#/components/schemas/CoupledModerationResults" | |
} | |
}, | |
"type": "object", | |
"required": [ | |
"uniqueid", | |
"object", | |
"userid", | |
"lotNumber", | |
"created", | |
"model", | |
"choices", | |
"moderationResults" | |
], | |
"title": "completionResponse" | |
}, | |
"coupledcompletionRequest": { | |
"properties": { | |
"AccountName": { | |
"anyOf": [ | |
{ | |
"type": "string" | |
}, | |
{ | |
"type": "null" | |
} | |
], | |
"title": "Accountname", | |
"example": "None" | |
}, | |
"PortfolioName": { | |
"anyOf": [ | |
{ | |
"type": "string" | |
}, | |
{ | |
"type": "null" | |
} | |
], | |
"title": "Portfolioname", | |
"example": "None" | |
}, | |
"userid": { | |
"anyOf": [ | |
{ | |
"type": "string" | |
}, | |
{ | |
"type": "null" | |
} | |
], | |
"title": "Userid", | |
"example": "None" | |
}, | |
"lotNumber": { | |
"anyOf": [ | |
{ | |
"type": "integer" | |
}, | |
{ | |
"type": "null" | |
} | |
], | |
"title": "Lotnumber", | |
"example": 1 | |
}, | |
"model_name": { | |
"anyOf": [ | |
{ | |
"type": "string" | |
}, | |
{ | |
"type": "null" | |
} | |
], | |
"title": "model_name", | |
"example": "gpt4" | |
}, | |
"translate": { | |
"type": "string", | |
"title": "translate", | |
"example": "no" | |
}, | |
"temperature": { | |
"type": "string", | |
"title": "Temperature", | |
"example": "0" | |
}, | |
"LLMinteraction": { | |
"type": "string", | |
"title": "Llminteraction", | |
"example": "yes" | |
}, | |
"PromptTemplate": { | |
"type": "string", | |
"title": "Prompttemplate", | |
"example": "GoalPriority" | |
}, | |
"EmojiModeration": { | |
"type": "string", | |
"title": "EmojiModeration", | |
"example": "yes" | |
}, | |
"Prompt": { | |
"type": "string", | |
"title": "Prompt", | |
"example": "Which is the biggest country in the world?" | |
}, | |
"InputModerationChecks": { | |
"items": { | |
"$ref": "#/components/schemas/MODCHECKS" | |
}, | |
"type": "array", | |
"title": "Inputmoderationchecks", | |
"example": [ | |
"PromptInjection", | |
"JailBreak", | |
"Toxicity", | |
"Piidetct", | |
"Refusal", | |
"Profanity", | |
"RestrictTopic", | |
"TextQuality", | |
"CustomizedTheme" | |
] | |
}, | |
"OutputModerationChecks": { | |
"items": { | |
"$ref": "#/components/schemas/MODCHECKS" | |
}, | |
"type": "array", | |
"title": "Outputmoderationchecks", | |
"example": [ | |
"Toxicity", | |
"Piidetct", | |
"Refusal", | |
"Profanity", | |
"RestrictTopic", | |
"TextQuality", | |
"TextRelevance" | |
] | |
}, | |
"llm_BasedChecks": { | |
"items": { | |
"$ref": "#/components/schemas/llm_Based_Checks" | |
}, | |
"type": "array", | |
"title": "Llm Basedchecks", | |
"example": [ | |
"randomNoiseCheck", | |
"advancedJailbreakCheck" | |
] | |
}, | |
"ModerationCheckThresholds": { | |
"$ref": "#/components/schemas/COUPLEDMODERATIONTHRESHOLD" | |
} | |
}, | |
"type": "object", | |
"required": [ | |
"temperature", | |
"LLMinteraction", | |
"PromptTemplate", | |
"Prompt", | |
"InputModerationChecks", | |
"OutputModerationChecks", | |
"llm_BasedChecks", | |
"ModerationCheckThresholds" | |
], | |
"title": "coupledcompletionRequest" | |
}, | |
"covRequest": { | |
"properties": { | |
"text": { | |
"type": "string", | |
"title": "Text", | |
"example": "Which is the biggest country in the world?" | |
}, | |
"complexity": { | |
"type": "string", | |
"enum": [ | |
"simple", | |
"medium", | |
"complex" | |
], | |
"title": "Complexity" | |
}, | |
"model_name": { | |
"anyOf": [ | |
{ | |
"type": "string" | |
}, | |
{ | |
"type": "null" | |
} | |
], | |
"title": "model_name", | |
"example": "gpt4" | |
} | |
}, | |
"type": "object", | |
"required": [ | |
"text", | |
"complexity" | |
], | |
"title": "covRequest" | |
}, | |
"customThemeCheck": { | |
"properties": { | |
"customSimilarityScore": { | |
"type": "string", | |
"title": "Customsimilarityscore", | |
"example": "0.82" | |
}, | |
"themeThreshold": { | |
"type": "string", | |
"title": "Themethreshold", | |
"example": "0.6" | |
}, | |
"result": { | |
"allOf": [ | |
{ | |
"$ref": "#/components/schemas/Result" | |
} | |
], | |
"example": "PASSED" | |
} | |
}, | |
"type": "object", | |
"required": [ | |
"customSimilarityScore", | |
"themeThreshold", | |
"result" | |
], | |
"title": "customThemeCheck" | |
}, | |
"jailbreakCheck": { | |
"properties": { | |
"jailbreakSimilarityScore": { | |
"type": "string", | |
"title": "Jailbreaksimilarityscore", | |
"example": "0.82" | |
}, | |
"jailbreakThreshold": { | |
"type": "string", | |
"title": "Jailbreakthreshold", | |
"example": "0.6" | |
}, | |
"result": { | |
"allOf": [ | |
{ | |
"$ref": "#/components/schemas/Result" | |
} | |
], | |
"example": "PASSED" | |
} | |
}, | |
"type": "object", | |
"required": [ | |
"jailbreakSimilarityScore", | |
"jailbreakThreshold", | |
"result" | |
], | |
"title": "jailbreakCheck" | |
}, | |
"llm_Based_Checks": { | |
"type": "string", | |
"enum": [ | |
"smoothLlmCheck", | |
"bergeronCheck", | |
"<class 'ModerationLayer.mapper.mapper.llm_Based_Checks.Config'>" | |
], | |
"title": "llm_Based_Checks" | |
}, | |
"translateRequest": { | |
"properties": { | |
"Prompt": { | |
"type": "string", | |
"title": "Prompt", | |
"example": "Which is the biggest country in the world?" | |
}, | |
"choice": { | |
"type": "string", | |
"title": "choice", | |
"example": "google" | |
} | |
}, | |
"type": "object", | |
"required": [ | |
"Prompt", | |
"choice" | |
], | |
"title": "translateRequest" | |
}, | |
"translateResponse": { | |
"properties": { | |
"text": { | |
"type": "string", | |
"title": "Text", | |
"example": "Russia is the biggest country by area." | |
}, | |
"language": { | |
"type": "string", | |
"title": "language", | |
"example": "English" | |
} | |
}, | |
"type": "object", | |
"required": [ | |
"text", | |
"language" | |
], | |
"title": "translateResponse" | |
}, | |
"openAIRequest": { | |
"properties": { | |
"Prompt": { | |
"type": "string", | |
"title": "Prompt", | |
"example": "Which is the biggest country in the world?" | |
}, | |
"temperature": { | |
"type": "string", | |
"title": "Temperature", | |
"example": "0" | |
}, | |
"model_name": { | |
"anyOf": [ | |
{ | |
"type": "string" | |
}, | |
{ | |
"type": "null" | |
} | |
], | |
"title": "model_name", | |
"example": "gpt4" | |
} | |
}, | |
"type": "object", | |
"required": [ | |
"Prompt", | |
"temperature" | |
], | |
"title": "openAIRequest" | |
}, | |
"healthcareopenaiCOT": { | |
"properties": { | |
"Prompt": { | |
"type": "string", | |
"title": "Prompt", | |
"example": "Which is the biggest country in the world?" | |
}, | |
"PromptResponse": { | |
"type": "string", | |
"title": "Prompt Response", | |
"example": "The largest country in the world by area is Russia. To determine this, we can refer to widely accepted global records and geographic data. Here's a step-by-step explanation of how we can confirm this information:\n\n1. **Definition of \"Biggest\"**: First, we need to clarify what \"biggest\" means in this context. It typically refers to the total area of a country, which includes land and water within the international boundaries.\n\n2. **Source of Information**: We can look at reputable sources such as the CIA World Factbook, the United Nations, or various educational resources that provide information on country sizes.\n\n3. **Comparison**: By comparing the total area of all countries, we can determine which one is the largest. This comparison is generally available in the form of lists or rankings based on area.\n\n4. **Consensus**: There is a global consensus that Russia is the largest country in the world, with a total area of about 17,098,242 square kilometers (6,601,668 square miles).\n\n5. **Verification**: To verify this information, we can check multiple reliable sources. However, as an AI developed by OpenAI, I don't browse the internet in real-time. Instead, I rely on the data I was trained on, which includes factual information up to my last update in 2023.\n\n6. **Responsibility**: To ensure the information is not misleading, it's important to note that geopolitical changes can affect country sizes, but as of my last update, there have been no changes affecting the status of Russia as the largest country.\n\nWhile I cannot provide a direct website link, you can easily verify this information by checking a current world atlas, a recent publication from a reputable source like the United Nations, or by searching for the largest countries in the world using a trusted search engine." | |
}, | |
"temperature": { | |
"type": "string", | |
"title": "Temperature", | |
"example": "0" | |
}, | |
"model_name": { | |
"anyOf": [ | |
{ | |
"type": "string" | |
}, | |
{ | |
"type": "null" | |
} | |
], | |
"title": "model_name", | |
"example": "gpt4" | |
} | |
}, | |
"type": "object", | |
"required": [ | |
"Prompt", | |
"temperature", | |
"PromptResponse" | |
], | |
"title": "healthcareopenaiCOT" | |
}, | |
"privacyCheck": { | |
"properties": { | |
"entitiesRecognised": { | |
"items": {}, | |
"type": "array", | |
"title": "Entitiesrecognised", | |
"example": [ | |
"PERSON" | |
] | |
}, | |
"entitiesConfiguredToBlock": { | |
"items": {}, | |
"type": "array", | |
"title": "Entitiesconfiguredtoblock", | |
"example": [ | |
"ADHAR_NUMBER" | |
] | |
}, | |
"result": { | |
"allOf": [ | |
{ | |
"$ref": "#/components/schemas/Result" | |
} | |
], | |
"example": "PASSED" | |
} | |
}, | |
"type": "object", | |
"required": [ | |
"entitiesRecognised", | |
"entitiesConfiguredToBlock", | |
"result" | |
], | |
"title": "privacyCheck" | |
}, | |
"privacyPopupRequest": { | |
"properties": { | |
"text": { | |
"type": "string", | |
"title": "Text", | |
"example": "Which is the biggest country in the world?" | |
}, | |
"PiientitiesConfiguredToDetect": { | |
"items": { | |
"$ref": "#/components/schemas/PIICHECKS" | |
}, | |
"type": "array", | |
"title": "Piientitiesconfiguredtodetect", | |
"example": [ | |
"PERSON", | |
"LOCATION", | |
"DATE", | |
"AU_ABN", | |
"AU_ACN", | |
"AADHAR_NUMBER", | |
"AU_MEDICARE", | |
"AU_TFN", | |
"CREDIT_CARD", | |
"CRYPTO", | |
"DATE_TIME", | |
"EMAIL_ADDRESS", | |
"ES_NIF", | |
"IBAN_CODE", | |
"IP_ADDRESS", | |
"IT_DRIVER_LICENSE", | |
"IT_FISCAL_CODE", | |
"IT_IDENTITY_CARD", | |
"IT_PASSPORT", | |
"IT_VAT_CODE", | |
"MEDICAL_LICENSE", | |
"PAN_Number", | |
"IN_PAN", | |
"PHONE_NUMBER", | |
"SG_NRIC_FIN", | |
"UK_NHS", | |
"URL", | |
"PASSPORT", | |
"US_ITIN", | |
"US_PASSPORT", | |
"US_SSN" | |
] | |
}, | |
"PiientitiesConfiguredToBlock": { | |
"items": { | |
"$ref": "#/components/schemas/PIICHECKS" | |
}, | |
"type": "array", | |
"title": "Piientitiesconfiguredtoblock", | |
"example": [ | |
"AADHAR_NUMBER", | |
"PAN_Number", | |
"IN_PAN" | |
] | |
} | |
}, | |
"type": "object", | |
"required": [ | |
"text", | |
"PiientitiesConfiguredToBlock" | |
], | |
"title": "privacyPopupRequest" | |
}, | |
"profanityCheck": { | |
"properties": { | |
"profaneWordsIdentified": { | |
"items": {}, | |
"type": "array", | |
"title": "Profanewordsidentified", | |
"default": [ | |
"bullshit" | |
] | |
}, | |
"profaneWordsthreshold": { | |
"type": "string", | |
"title": "Profanewordsthreshold", | |
"example": "2" | |
}, | |
"result": { | |
"allOf": [ | |
{ | |
"$ref": "#/components/schemas/Result" | |
} | |
], | |
"example": "PASSED" | |
} | |
}, | |
"type": "object", | |
"required": [ | |
"profaneWordsthreshold", | |
"result" | |
], | |
"title": "profanityCheck" | |
}, | |
"profanityPopupRequest": { | |
"properties": { | |
"text": { | |
"type": "string", | |
"title": "Text", | |
"example": "Which is the biggest country in the world?" | |
} | |
}, | |
"type": "object", | |
"required": [ | |
"text" | |
], | |
"title": "profanityPopupRequest" | |
}, | |
"promptInjectionCheck": { | |
"properties": { | |
"injectionConfidenceScore": { | |
"type": "string", | |
"title": "Injectionconfidencescore", | |
"example": "0.98" | |
}, | |
"injectionThreshold": { | |
"type": "string", | |
"title": "Injectionthreshold", | |
"example": "0.70" | |
}, | |
"result": { | |
"allOf": [ | |
{ | |
"$ref": "#/components/schemas/Result" | |
} | |
], | |
"example": "PASSED" | |
} | |
}, | |
"type": "object", | |
"required": [ | |
"injectionConfidenceScore", | |
"injectionThreshold", | |
"result" | |
], | |
"title": "promptInjectionCheck" | |
}, | |
"refusalCheck": { | |
"properties": { | |
"refusalSimilarityScore": { | |
"type": "string", | |
"title": "Refusalsimilarityscore", | |
"example": "0.82" | |
}, | |
"RefusalThreshold": { | |
"type": "string", | |
"title": "Refusalthreshold", | |
"example": "0.6" | |
}, | |
"result": { | |
"allOf": [ | |
{ | |
"$ref": "#/components/schemas/Result" | |
} | |
], | |
"example": "PASSED" | |
} | |
}, | |
"type": "object", | |
"required": [ | |
"refusalSimilarityScore", | |
"RefusalThreshold", | |
"result" | |
], | |
"title": "refusalCheck" | |
}, | |
"restrictedtopic": { | |
"properties": { | |
"topicScores": { | |
"items": {}, | |
"type": "array", | |
"title": "Topicscores", | |
"example": [ | |
{ | |
"Explosives": "0.85" | |
} | |
] | |
}, | |
"topicThreshold": { | |
"type": "string", | |
"title": "Topicthreshold", | |
"example": "0.65" | |
}, | |
"result": { | |
"allOf": [ | |
{ | |
"$ref": "#/components/schemas/Result" | |
} | |
], | |
"example": "PASSED" | |
} | |
}, | |
"type": "object", | |
"required": [ | |
"topicScores", | |
"topicThreshold", | |
"result" | |
], | |
"title": "restrictedtopic" | |
}, | |
"smoothLlmCheck": { | |
"properties": { | |
"smoothLlmScore": { | |
"type": "string", | |
"title": "Smoothllmscore", | |
"example": "0.0" | |
}, | |
"smoothLlmThreshold": { | |
"type": "string", | |
"title": "Smoothllmthreshold", | |
"example": "0.6" | |
}, | |
"result": { | |
"allOf": [ | |
{ | |
"$ref": "#/components/schemas/Result" | |
} | |
], | |
"example": "PASSED" | |
} | |
}, | |
"type": "object", | |
"required": [ | |
"smoothLlmScore", | |
"smoothLlmThreshold", | |
"result" | |
], | |
"title": "smoothLlmCheck" | |
}, | |
"summary": { | |
"properties": { | |
"status": { | |
"type": "string", | |
"title": "Status", | |
"example": "REJECTED" | |
}, | |
"reason": { | |
"items": {}, | |
"type": "array", | |
"title": "Reason", | |
"example": [ | |
"PROMPT-INJECTION", | |
"PRIVACY" | |
] | |
} | |
}, | |
"type": "object", | |
"required": [ | |
"status", | |
"reason" | |
], | |
"title": "summary" | |
}, | |
"textQuality": { | |
"properties": { | |
"readabilityScore": { | |
"type": "string", | |
"title": "Readabilityscore", | |
"example": "80" | |
}, | |
"textGrade": { | |
"type": "string", | |
"title": "Textgrade", | |
"example": "Grade 12-13" | |
} | |
}, | |
"type": "object", | |
"required": [ | |
"readabilityScore", | |
"textGrade" | |
], | |
"title": "textQuality" | |
}, | |
"textRelevanceCheck": { | |
"properties": { | |
"PromptResponseSimilarityScore": { | |
"type": "string", | |
"title": "Promptresponsesimilarityscore", | |
"example": "0.82" | |
} | |
}, | |
"type": "object", | |
"required": [ | |
"PromptResponseSimilarityScore" | |
], | |
"title": "textRelevanceCheck" | |
}, | |
"toxicityCheck": { | |
"properties": { | |
"toxicityScore": { | |
"items": {}, | |
"type": "array", | |
"title": "Toxicityscore", | |
"example": [ | |
{ | |
"toxicity": "0.85" | |
} | |
] | |
}, | |
"toxicitythreshold": { | |
"type": "string", | |
"title": "Toxicitythreshold", | |
"example": "0.55" | |
}, | |
"result": { | |
"allOf": [ | |
{ | |
"$ref": "#/components/schemas/Result" | |
} | |
], | |
"example": "PASSED" | |
} | |
}, | |
"type": "object", | |
"required": [ | |
"toxicityScore", | |
"toxicitythreshold", | |
"result" | |
], | |
"title": "toxicityCheck" | |
}, | |
"toxicityPopupRequest": { | |
"properties": { | |
"text": { | |
"type": "string", | |
"title": "Text", | |
"example": "Which is the biggest country in the world?" | |
}, | |
"ToxicityThreshold": { | |
"$ref": "#/components/schemas/TOXTHRESHOLDS" | |
} | |
}, | |
"type": "object", | |
"required": [ | |
"text", | |
"ToxicityThreshold" | |
], | |
"title": "toxicityPopupRequest" | |
}, | |
"evalLLMCheckRequest":{ | |
"properties": { | |
"AccountName": { | |
"anyOf": [ | |
{ | |
"type": "string" | |
}, | |
{ | |
"type": "null" | |
} | |
], | |
"title": "Accountname", | |
"example": "None" | |
}, | |
"PortfolioName": { | |
"anyOf": [ | |
{ | |
"type": "string" | |
}, | |
{ | |
"type": "null" | |
} | |
], | |
"title": "Portfolioname", | |
"example": "None" | |
}, | |
"userid": { | |
"anyOf": [ | |
{ | |
"type": "string" | |
}, | |
{ | |
"type": "null" | |
} | |
], | |
"title": "Userid", | |
"example": "None" | |
}, | |
"lotNumber": { | |
"anyOf": [ | |
{ | |
"type": "integer" | |
}, | |
{ | |
"type": "null" | |
} | |
], | |
"title": "Lotnumber", | |
"example": 1 | |
}, | |
"Prompt": { | |
"type": "string", | |
"title": "Prompt", | |
"example": "Which is the biggest country in the world?" | |
}, | |
"model_name": { | |
"anyOf": [ | |
{ | |
"type": "string" | |
}, | |
{ | |
"type": "null" | |
} | |
], | |
"title": "model_name", | |
"example": "gpt4" | |
}, | |
"temperature": { | |
"type": "string", | |
"title": "Temperature", | |
"example": "0" | |
}, | |
"PromptTemplate": { | |
"type": "string", | |
"title": "Prompttemplate", | |
"example": "GoalPriority" | |
}, | |
"template_name": { | |
"anyOf": [ | |
{ | |
"type": "string" | |
}, | |
{ | |
"type": "null" | |
} | |
], | |
"title": "template_name", | |
"example": "LANGUAGE_CRITIQUE_GRAMMAR" | |
} | |
}, | |
"type": "object", | |
"required": [ | |
"temperature", | |
"PromptTemplate", | |
"Prompt" | |
], | |
"title": "evalLLMCheckRequest" | |
}, | |
"multimodalRequest":{ | |
"properties": { | |
"AccountName": { | |
"anyOf": [ | |
{ | |
"type": "string" | |
}, | |
{ | |
"type": "null" | |
} | |
], | |
"title": "Accountname", | |
"example": "None" | |
}, | |
"PortfolioName": { | |
"anyOf": [ | |
{ | |
"type": "string" | |
}, | |
{ | |
"type": "null" | |
} | |
], | |
"title": "Portfolioname", | |
"example": "None" | |
}, | |
"userid": { | |
"anyOf": [ | |
{ | |
"type": "string" | |
}, | |
{ | |
"type": "null" | |
} | |
], | |
"title": "Userid", | |
"example": "None" | |
}, | |
"lotNumber": { | |
"anyOf": [ | |
{ | |
"type": "integer" | |
}, | |
{ | |
"type": "null" | |
} | |
], | |
"title": "Lotnumber", | |
"example": 1 | |
}, | |
"model_name": { | |
"anyOf": [ | |
{ | |
"type": "string" | |
}, | |
{ | |
"type": "null" | |
} | |
], | |
"title": "model_name", | |
"example": "gpt4O" | |
}, | |
"Prompt": { | |
"type": "string", | |
"title": "Prompt", | |
"example": "Which is the biggest country in the world?" | |
}, | |
"Image": { | |
"type": "file", | |
"title": "Image" | |
}, | |
"TemplateName": { | |
"anyOf": [ | |
{ | |
"type": "string" | |
}, | |
{ | |
"type": "null" | |
} | |
], | |
"title": "TemplateName", | |
"example": "None" | |
}, | |
"Restrictedtopics": { | |
"items": {}, | |
"type": "array", | |
"title": "Restrictedtopics", | |
"default": [ | |
"Terrorism", | |
"Explosives" | |
] | |
} | |
}, | |
"type": "object", | |
"required": [ | |
"Prompt", | |
"Image", | |
"TemplateName" | |
], | |
"title": "multimodalRequest" | |
} | |
}, | |
"securitySchemes": { | |
"BearerAuth":{ | |
"type": "http", | |
"scheme": "bearer", | |
"name": "Authorization", | |
"in": "header" | |
} | |
} | |
}, | |
"tags": [ | |
{ | |
"name": "LLM Moderation", | |
"description": "Operations required for LLM moderation proxy.", | |
"externalDocs": { | |
"description": "Find out more", | |
"url": "https://www.infosys.com/" | |
} | |
} | |
] | |
} |