AION init (#3577)
This commit is contained in:
Родитель
c681eb50f5
Коммит
fe0f17eaf0
|
@ -0,0 +1,251 @@
|
|||
{
|
||||
"swagger": "2.0",
|
||||
"info": {
|
||||
"title": "AI or Not",
|
||||
"contact": {
|
||||
"name": "Fördős András",
|
||||
"email": "fordosa90+ipc_aion@gmail.com"
|
||||
},
|
||||
"description": "Detect AI-generated images & audio for your business - and yourself - with AI or Not.",
|
||||
"version": "1.0"
|
||||
},
|
||||
"host": "api.aiornot.com",
|
||||
"basePath": "/",
|
||||
"schemes": [
|
||||
"https"
|
||||
],
|
||||
"consumes": [],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"paths": {
|
||||
"/v1/system/live": {
|
||||
"get": {
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"is_live": {
|
||||
"type": "boolean",
|
||||
"description": "True or false indicating, whether the system is alive.",
|
||||
"title": "Is Live"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"summary": "Is Live",
|
||||
"description": "Check if system is alive and ready to serve requests.",
|
||||
"operationId": "IsLive",
|
||||
"parameters": []
|
||||
}
|
||||
},
|
||||
"/v1/reports/image": {
|
||||
"post": {
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"description": "id"
|
||||
},
|
||||
"created_at": {
|
||||
"type": "string",
|
||||
"description": "The date and time when the report was created.",
|
||||
"title": "Created at"
|
||||
},
|
||||
"report": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"verdict": {
|
||||
"type": "string",
|
||||
"description": "The verdict of the report. The verdict can be 'ai' or 'human'.",
|
||||
"title": "Verdict"
|
||||
},
|
||||
"ai": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"confidence": {
|
||||
"type": "number",
|
||||
"format": "double",
|
||||
"description": "The confidence of the AI analysis.",
|
||||
"title": "Confidence"
|
||||
},
|
||||
"is_detected": {
|
||||
"type": "boolean",
|
||||
"description": "The detection status of the AI analysis.",
|
||||
"title": "Is detected"
|
||||
}
|
||||
},
|
||||
"description": "The results of the AI analysis. The results contain the confidence and the detection status.",
|
||||
"title": "AI"
|
||||
},
|
||||
"human": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"confidence": {
|
||||
"type": "number",
|
||||
"format": "double",
|
||||
"description": "The confidence of the human analysis.",
|
||||
"title": "Confidence"
|
||||
},
|
||||
"is_detected": {
|
||||
"type": "boolean",
|
||||
"description": "The detection status of the human analysis.",
|
||||
"title": "Is detected"
|
||||
}
|
||||
},
|
||||
"description": "The results of the human analysis. The results contain the confidence and the detection status.",
|
||||
"title": "Human"
|
||||
},
|
||||
"generator": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"midjourney": {
|
||||
"$ref": "#/definitions/AiGenerator"
|
||||
},
|
||||
"dall_e": {
|
||||
"$ref": "#/definitions/AiGenerator"
|
||||
},
|
||||
"stable_diffusion": {
|
||||
"$ref": "#/definitions/AiGenerator"
|
||||
},
|
||||
"this_person_does_not_exist": {
|
||||
"$ref": "#/definitions/AiGenerator"
|
||||
}
|
||||
},
|
||||
"description": "The results of the AI generators. The results contain the confidence and the detection status.",
|
||||
"title": "Generator"
|
||||
}
|
||||
},
|
||||
"description": "The report itself. The report contains the verdict, the results of the AI and human analysis, and the results of the AI generators.",
|
||||
"title": "Report"
|
||||
},
|
||||
"facets": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"quality": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"version": {
|
||||
"type": "string",
|
||||
"description": "Version of the detection module.",
|
||||
"title": "Version"
|
||||
},
|
||||
"is_detected": {
|
||||
"type": "boolean",
|
||||
"description": "The detection status of the image quality check.",
|
||||
"title": "Is detected"
|
||||
}
|
||||
},
|
||||
"description": "The results of the image quality check. The results contain the detection status.",
|
||||
"title": "Quality"
|
||||
},
|
||||
"nsfw": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"version": {
|
||||
"type": "string",
|
||||
"description": "Version of the detection module.",
|
||||
"title": "Version"
|
||||
},
|
||||
"is_detected": {
|
||||
"type": "boolean",
|
||||
"description": "The detection status of the NSFW analysis.",
|
||||
"title": "Is detected"
|
||||
}
|
||||
},
|
||||
"description": "The results of the NSFW analysis. The results contain the detection status.",
|
||||
"title": "NSFW"
|
||||
}
|
||||
},
|
||||
"description": "The results of the image quality check and NSFW.",
|
||||
"title": "Facets"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"summary": "Image reports",
|
||||
"description": "The response model containing the result of the image report processing, which includes the results of the image quality check, NSFW, and the image analysis itself.",
|
||||
"operationId": "ImageReport",
|
||||
"parameters": [
|
||||
{
|
||||
"name": "body",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"object": {
|
||||
"type": "string",
|
||||
"description": "The image URL that needs to be verified.",
|
||||
"title": "Object"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"object"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"responses": {},
|
||||
"parameters": {},
|
||||
"definitions": {
|
||||
"AiGenerator": {
|
||||
"type": "object",
|
||||
"description": "The results of the generator. The results contain the confidence and the detection status.",
|
||||
"properties": {
|
||||
"confidence": {
|
||||
"type": "number",
|
||||
"format": "double",
|
||||
"description": "The confidence of the analysis.",
|
||||
"title": "Confidence"
|
||||
},
|
||||
"is_detected": {
|
||||
"type": "boolean",
|
||||
"description": "The detection status of the analysis.",
|
||||
"title": "Is detected"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"securityDefinitions": {
|
||||
"API Key": {
|
||||
"type": "apiKey",
|
||||
"in": "header",
|
||||
"name": "api_key"
|
||||
}
|
||||
},
|
||||
"security": [
|
||||
{
|
||||
"API Key": []
|
||||
}
|
||||
],
|
||||
"tags": [],
|
||||
"x-ms-connector-metadata": [
|
||||
{
|
||||
"propertyName": "Website",
|
||||
"propertyValue": "https://www.aiornot.com/"
|
||||
},
|
||||
{
|
||||
"propertyName": "Privacy policy",
|
||||
"propertyValue": "https://www.aiornot.com/privacy-policy"
|
||||
},
|
||||
{
|
||||
"propertyName": "Categories",
|
||||
"propertyValue": "AI;Productivity"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
{
|
||||
"properties": {
|
||||
"connectionParameters": {
|
||||
"api_key": {
|
||||
"type": "securestring",
|
||||
"uiDefinition": {
|
||||
"displayName": "API Key",
|
||||
"description": "The API Key for this api",
|
||||
"tooltip": "Provide your API Key",
|
||||
"constraints": {
|
||||
"tabIndex": 2,
|
||||
"clearText": false,
|
||||
"required": "true"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"iconBrandColor": "#da3b01",
|
||||
"capabilities": [],
|
||||
"publisher": "Fördős András",
|
||||
"stackOwner": "AIorNot INC"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
# AI or Not
|
||||
In today's digital world, distinguishing real from digitally altered images is more critical than ever. AI or Not is here to help! Empower your applications, protect your business and your users with the ability to differentiate between genuine and AI-generated images. Let's lead the charge in maintaining the authenticity of visual content.
|
||||
|
||||
## Publisher: Fördős András
|
||||
|
||||
## Prerequisites
|
||||
An AI or Not account is required. You can sign up for a free plan or select from the paid memberships: [https://www.aiornot.com/](https://www.aiornot.com/)
|
||||
|
||||
## Obtaining Credentials
|
||||
This connector uses API-Key as a bearer token for autehentication. Once signed up, visit your profile home page to get your API-Key: [https://www.aiornot.com/dashboard/api](https://www.aiornot.com/dashboard/api)
|
||||
|
||||
## Supported Operations
|
||||
|
||||
### Is Live
|
||||
Check if system is alive and ready to serve requests.
|
||||
|
||||
### Image reports
|
||||
The response model containing the result of the image report processing, which includes the results of the image quality check, NSFW, and the image analysis itself.
|
||||
|
||||
## Known Issues and Limitations
|
||||
|
||||
The current version of the connector is an initial one, meaning it does not provide access to all the service endpoints and response data provided by AI or Not, especially around the paid services.
|
||||
|
||||
Please reach out and connect me when you see the need for any additional extension and let us collaborate!
|
||||
|
||||
Important note, that the underlying service has various limitations applied (rates and data) based on your membership plan.
|
|
@ -0,0 +1,22 @@
|
|||
public class Script : ScriptBase
|
||||
{
|
||||
public override async Task<HttpResponseMessage> ExecuteAsync()
|
||||
{
|
||||
addBearerPrefix();
|
||||
|
||||
var response = await Context.SendAsync(Context.Request, CancellationToken)
|
||||
.ConfigureAwait(continueOnCapturedContext: false);
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
private void addBearerPrefix() {
|
||||
var headerValuesToken = Context.Request.Headers.GetValues("api_key");
|
||||
var accessToken = headerValuesToken.FirstOrDefault<string>();
|
||||
|
||||
Context.Request.Headers.Remove("api_key");
|
||||
Context.Request.Headers.Remove("Authorization");
|
||||
|
||||
Context.Request.Headers.TryAddWithoutValidation("Authorization", "Bearer " + accessToken);
|
||||
}
|
||||
}
|
Загрузка…
Ссылка в новой задаче