From 478eb179ec96d64602bd609b4f9b31fac5181fb9 Mon Sep 17 00:00:00 2001 From: Eashan Thakuria Date: Thu, 17 Oct 2024 18:26:33 -0400 Subject: [PATCH] added OpenAPI specs --- .../Scripts/examplescript.txt | 0 .../Scripts/examplescript.txt | 0 .../Scripts/examplescript.txt | 0 .../IBM Verify/ibmVerify_openapi_spec.json | 743 ++++++++++++++++++ .../otherBot/assistantBot_openapi_spec.json | 216 +++++ .../wxD_wml_openapi_spec.json | 191 +++++ .../governance_openapi_spec.json | 131 +++ 7 files changed, 1281 insertions(+) delete mode 100644 assets/ExampleSolution1/Scripts/examplescript.txt delete mode 100644 assets/ExampleSolution2/Scripts/examplescript.txt delete mode 100644 assets/ExampleSolution3/Scripts/examplescript.txt create mode 100644 assets/openAPI_specs/IBM Verify/ibmVerify_openapi_spec.json create mode 100644 assets/openAPI_specs/otherBot/assistantBot_openapi_spec.json create mode 100644 assets/openAPI_specs/watsonx_Discovery/wxD_wml_openapi_spec.json create mode 100644 assets/openAPI_specs/watsonx_governance/governance_openapi_spec.json diff --git a/assets/ExampleSolution1/Scripts/examplescript.txt b/assets/ExampleSolution1/Scripts/examplescript.txt deleted file mode 100644 index e69de29..0000000 diff --git a/assets/ExampleSolution2/Scripts/examplescript.txt b/assets/ExampleSolution2/Scripts/examplescript.txt deleted file mode 100644 index e69de29..0000000 diff --git a/assets/ExampleSolution3/Scripts/examplescript.txt b/assets/ExampleSolution3/Scripts/examplescript.txt deleted file mode 100644 index e69de29..0000000 diff --git a/assets/openAPI_specs/IBM Verify/ibmVerify_openapi_spec.json b/assets/openAPI_specs/IBM Verify/ibmVerify_openapi_spec.json new file mode 100644 index 0000000..5efb5dc --- /dev/null +++ b/assets/openAPI_specs/IBM Verify/ibmVerify_openapi_spec.json @@ -0,0 +1,743 @@ +{ + "openapi": "3.0.3", + "info": { + "title": "UVA-Verify", + "version": "1.0.0", + "contact": {} + }, + "servers": [ + { + "url": "[INSERT_INSTANCE_URL]" + } + ], + "paths": { + "/v2.0/Users": { + "get": { + "summary": "Get all users info", + "operationId": "getUsers", + "parameters": [ + { + "name": "Accept", + "in": "header", + "required": true, + "schema": { + "type": "string" + } + } + ], + "security": [ + { + "secretAuth": [] + } + ], + "responses": { + "200": { + "description": "Users found", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "totalResults": { + "type": "integer" + }, + "schema": { + "type": "array", + "items": { + "type": "string" + } + }, + "Resources": { + "type": "array", + "items": { + "type": "object", + "properties": { + "emails": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "value": { + "type": "string" + } + } + } + }, + "meta": { + "type": "object", + "properties": { + "created": { + "type": "string", + "format": "date-time" + }, + "lastModified": { + "type": "string", + "format": "date-time" + } + } + }, + "schemas": { + "type": "array", + "items": { + "type": "string" + } + }, + "name": { + "type": "object", + "properties": { + "formatted": { + "type": "string" + }, + "givenName": { + "type": "string" + } + } + }, + "urn:ietf:params:scim:schemas:extension:ibm:2.0:User": { + "type": "object", + "properties": { + "lastLogin": { + "type": "string", + "format": "date-time" + }, + "lastLoginRealm": { + "type": "string" + }, + "userCategory": { + "type": "string" + }, + "twoFactorAuthentication": { + "type": "boolean" + }, + "realm": { + "type": "string" + }, + "pwdChangedTime": { + "type": "string", + "format": "date-time" + }, + "lastLoginType": { + "type": "string" + } + } + }, + "groups": { + "type": "array", + "items": { + "type": "object", + "properties": { + "displayName": { + "type": "string" + }, + "id": { + "type": "string" + } + } + } + }, + "active": { + "type": "boolean" + }, + "id": { + "type": "string" + }, + "userName": { + "type": "string" + }, + "title": { + "type": "string" + }, + "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User": { + "type": "object", + "properties": { + "employeeNumber": { + "type": "string" + } + } + } + } + } + } + } + } + } + } + } + } + } + }, + "/v2.0/Users/authentication": { + "post": { + "summary": "verify user and pass", + "operationId": "verifyUserPass", + "parameters": [ + { + "name": "returnUserRecord", + "in": "query", + "required": true, + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "Accept", + "in": "header", + "required": true, + "schema": { + "type": "string" + } + } + ], + "security": [ + { + "secretAuth": [] + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "userName": { + "type": "string" + }, + "password": { + "type": "string" + }, + "schemas": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } + }, + "responses": { + "200": { + "description": "ok", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "emails": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "value": { + "type": "string" + } + } + } + }, + "meta": { + "type": "object", + "properties": { + "created": { + "type": "string", + "format": "date-time" + }, + "lastModified": { + "type": "string", + "format": "date-time" + } + } + }, + "schemas": { + "type": "array", + "items": { + "type": "string" + } + }, + "name": { + "type": "object", + "properties": { + "formatted": { + "type": "string" + }, + "givenName": { + "type": "string" + } + } + }, + "urn:ietf:params:scim:schemas:extension:ibm:2.0:User": { + "type": "object", + "properties": { + "lastLogin": { + "type": "string", + "format": "date-time" + }, + "lastLoginRealm": { + "type": "string" + }, + "userCategory": { + "type": "string" + }, + "twoFactorAuthentication": { + "type": "boolean" + }, + "realm": { + "type": "string" + }, + "pwdChangedTime": { + "type": "string", + "format": "date-time" + }, + "lastLoginType": { + "type": "string" + } + } + }, + "groups": { + "type": "array", + "items": { + "type": "object", + "properties": { + "displayName": { + "type": "string" + }, + "id": { + "type": "string" + } + } + } + }, + "active": { + "type": "boolean" + }, + "id": { + "type": "string" + }, + "userName": { + "type": "string" + }, + "title": { + "type": "string" + }, + "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User": { + "type": "object", + "properties": { + "employeeNumber": { + "type": "string" + } + } + } + } + } + } + } + } + } + } + }, + "/v2.0/Users/{userid}/passwordResetter": { + "patch": { + "summary": "Change user's password", + "operationId": "changeUserPass", + "parameters": [ + { + "name": "userid", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "content-type", + "in": "header", + "required": true, + "schema": { + "type": "string", + "default": "application/scim+json" + } + }, + { + "name": "Accept", + "in": "header", + "required": true, + "schema": { + "type": "string" + } + } + ], + "security": [ + { + "secretAuth": [] + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "operations": { + "type": "array", + "items": { + "type": "object", + "properties": { + "op": { + "type": "string", + "default": "replace" + }, + "value": { + "type": "object", + "properties": { + "password": { + "type": "string" + } + } + } + } + } + }, + "schemas": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Password changed successfully!" + }, + "400": { + "description": "Password change failed!", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "schemas": { + "type": "array", + "items": { + "type": "string" + } + }, + "status": { + "type": "integer" + }, + "detail": { + "type": "string" + }, + "scimType": { + "type": "string" + } + } + } + } + } + } + } + } + }, + "/v2.0/factors/emailotp/transient/verifications": { + "post": { + "summary": "Create an email otp transaction", + "operationId": "CreateEmailOTP", + "security": [ + { + "secretAuth": [] + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "correlation": { + "type": "integer" + }, + "emailAddress": { + "type": "string" + } + } + } + } + } + }, + "responses": { + "201": { + "description": "Email OTP created successfully", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "type": { + "type": "string" + }, + "created": { + "type": "string", + "format": "date-time" + }, + "updated": { + "type": "string", + "format": "date-time" + }, + "expiry": { + "type": "string", + "format": "date-time" + }, + "state": { + "type": "string" + }, + "updatedBy": { + "type": "string" + }, + "correlation": { + "type": "string" + }, + "emailAddress": { + "type": "string" + }, + "attempts": { + "type": "integer" + }, + "retries": { + "type": "integer" + } + } + } + } + } + } + } + } + }, + "/v2.0/factors/emailotp/transient/verifications/{trxnId}": { + "post": { + "summary": "Attempt email OTP verification", + "operationId": "AttemptEmailOTP", + "security": [ + { + "secretAuth": [] + } + ], + "parameters": [ + { + "name": "trxnId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "otp": { + "type": "string" + } + } + } + } + } + }, + "responses": { + "204": { + "description": "Email OTP verification success!" + } + } + } + } + }, + "tags": [], + "components": { + "securitySchemes": { + "bearerAuth": { + "type": "http", + "scheme": "bearer" + }, + "secretAuth": { + "type": "oauth2", + "flows": { + "clientCredentials": { + "tokenUrl": "[INSERT_INSTANCE_URL]/v1.0/endpoint/default/token", + "scopes": {} + } + } + } + }, + "schemas": { + "User": { + "type": "object", + "properties": { + "emails": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "value": { + "type": "string" + } + } + } + }, + "meta": { + "type": "object", + "properties": { + "created": { + "type": "string", + "format": "date-time" + }, + "lastModified": { + "type": "string", + "format": "date-time" + } + } + }, + "schemas": { + "type": "array", + "items": { + "type": "string" + } + }, + "name": { + "type": "object", + "properties": { + "formatted": { + "type": "string" + }, + "givenName": { + "type": "string" + } + } + }, + "urn:ietf:params:scim:schemas:extension:ibm:2.0:User": { + "type": "object", + "properties": { + "lastLogin": { + "type": "string", + "format": "date-time" + }, + "lastLoginRealm": { + "type": "string" + }, + "userCategory": { + "type": "string" + }, + "twoFactorAuthentication": { + "type": "boolean" + }, + "realm": { + "type": "string" + }, + "pwdChangedTime": { + "type": "string", + "format": "date-time" + }, + "lastLoginType": { + "type": "string" + } + } + }, + "groups": { + "type": "array", + "items": { + "type": "object", + "properties": { + "displayName": { + "type": "string" + }, + "id": { + "type": "string" + } + } + } + }, + "active": { + "type": "boolean" + }, + "id": { + "type": "string" + }, + "userName": { + "type": "string" + }, + "title": { + "type": "string" + }, + "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User": { + "type": "object", + "properties": { + "employeeNumber": { + "type": "string" + } + } + } + } + }, + "CreateEmailOtp": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "type": { + "type": "string" + }, + "created": { + "type": "string", + "format": "date-time" + }, + "updated": { + "type": "string", + "format": "date-time" + }, + "expiry": { + "type": "string", + "format": "date-time" + }, + "state": { + "type": "string" + }, + "updatedBy": { + "type": "string" + }, + "correlation": { + "type": "string" + }, + "emailAddress": { + "type": "string" + }, + "attempts": { + "type": "integer" + }, + "retries": { + "type": "integer" + } + } + } + } + } +} \ No newline at end of file diff --git a/assets/openAPI_specs/otherBot/assistantBot_openapi_spec.json b/assets/openAPI_specs/otherBot/assistantBot_openapi_spec.json new file mode 100644 index 0000000..ce2384a --- /dev/null +++ b/assets/openAPI_specs/otherBot/assistantBot_openapi_spec.json @@ -0,0 +1,216 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "Other assistant API", + "version": "1.0.0", + "description": "An API for ingesting and generating chat responses" + }, + "servers": [ + { + "url": "https://api.us-east-1.aws.watsonassistant.ibm.com/instances/[INSERT_INSTANCE_ID]" + } + ], + "components": { + "securitySchemes": { + "basicAuth": { + "type": "http", + "scheme": "basic" + } + } + }, + "security": [ + { + "basicAuth": [] + } + ], + "paths": { + "/v2/assistants/{environment_id}/sessions?version=2023-06-15": { + "post": { + "parameters": [ + { + "name": "environment_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "summary": "Create Session", + "description": "Creates assistant session", + "operationId": "makeAssistantSession", + "responses": { + "201": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "session_id": { + "type": "string" + } + } + } + } + } + }, + "400": { + "description": "Failure" + } + } + } + }, + "/v2/assistants/{environment_id}/sessions/{session_id}/message?version=2023-06-15": { + "post": { + "parameters": [ + { + "name": "session_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "environment_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "summary": "Make dialog request", + "description": "Creates assistant message request", + "operationId": "makeMessageRequest", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "input": { + "type": "object", + "properties": { + "message_type": { + "type": "string" + }, + "text": { + "type": "string" + } + } + }, + "context": { + "type": "object", + "properties": { + "skills": { + "type": "object", + "properties": { + "actions skill": { + "type": "object", + "properties": { + "skill_variables": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + } + } + } + } + } + }, + "required": [ + "input" + ] + } + } + } + }, + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "output": { + "type": "object", + "properties": { + "generic": { + "type": "array", + "items": { + "type": "object", + "properties": { + "response_type": { + "type": "string" + }, + "text": { + "type": "string" + }, + "current_access": { + "type": "string" + } + }, + "required": [ + "response_type", + "text", + "current_access" + ] + } + }, + "intents": { + "type": "array", + "items": { + "type": "object", + "properties": { + "intent": { + "type": "string" + }, + "confidence": { + "type": "number" + } + }, + "required": [ + "intent", + "confidence" + ] + } + }, + "entities": { + "type": "array", + "items": { + "type": "object" + } + } + }, + "required": [ + "generic", + "intents", + "entities" + ] + }, + "user_id": { + "type": "string" + } + }, + "required": [ + "output" + ] + } + } + } + }, + "400": { + "description": "Failure" + } + } + } + } + } +} \ No newline at end of file diff --git a/assets/openAPI_specs/watsonx_Discovery/wxD_wml_openapi_spec.json b/assets/openAPI_specs/watsonx_Discovery/wxD_wml_openapi_spec.json new file mode 100644 index 0000000..29cd572 --- /dev/null +++ b/assets/openAPI_specs/watsonx_Discovery/wxD_wml_openapi_spec.json @@ -0,0 +1,191 @@ +{ + "openapi": "3.0.3", + "info": { + "title": "RAG Endpoint on Watson Machine Learning", + "description": "Using OpenAPI v3.0.3 for integration.", + "version": "1.0.0" + }, + "servers": [ + { + "description": "Watson Machine Learning deployment URL", + "url": "https://us-south.ml.cloud.ibm.com" + } + ], + "security": [ + { + "oAuth2": [] + } + ], + "paths": { + "/ml/v4/deployments/{wml_deployment_id}/predictions": { + "post": { + "summary": "Get the predictions", + "operationId": "predictions_post", + "parameters": [ + { + "in": "path", + "name": "wml_deployment_id", + "schema": { + "type": "string", + "default": "" + }, + "required": true, + "description": "The ID of the Watson Machine Learning deployment" + }, + { + "in": "query", + "name": "version", + "schema": { + "type": "string", + "default": "2021-05-01" + }, + "required": true, + "description": "Version number as a string" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Predictions_post_request" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Predictions_post_response" + } + } + } + } + } + } + } + }, + "components": { + "securitySchemes": { + "oAuth2": { + "type": "oauth2", + "description": "See https://cloud.ibm.com/docs/account?topic=account-iamoverview", + "flows": { + "x-apikey": { + "tokenUrl": "https://iam.cloud.ibm.com/identity/token", + "grantType": "urn:ibm:params:oauth:grant-type:apikey", + "secretKeys": [ + "apikey" + ], + "paramKeys": [], + "scopes": {} + } + } + } + }, + "schemas": { + "Predictions_post_request": { + "type": "object", + "required": [ + "input_data" + ], + "properties": { + "input_data": { + "type": "array", + "required": [ + "fields", + "values" + ], + "items": { + "type": "object", + "properties": { + "fields": { + "type": "array", + "items": { + "type": "string" + } + }, + "values": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } + } + }, + "Predictions_post_response": { + "type": "object", + "properties": { + "status": { + "type": "integer" + }, + "body": { + "type": "object", + "properties": { + "evaluations": { + "type": "object" + }, + "predictions": { + "type": "array", + "items": { + "type": "object", + "properties": { + "llm_response": { + "type": "string" + } + } + } + }, + "references": { + "type": "array", + "items": { + "type": "object", + "properties": { + "class_name": { + "type": "string" + }, + "end_char_idx": { + "type": "integer" + }, + "metadata": { + "type": "object", + "properties": { + "file_name": { + "type": "string" + }, + "filename": { + "type": "string" + }, + "page_label": { + "type": "string" + } + } + }, + "score": { + "type": "number" + }, + "start_char_idx": { + "type": "integer" + }, + "text": { + "type": "string" + } + } + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/assets/openAPI_specs/watsonx_governance/governance_openapi_spec.json b/assets/openAPI_specs/watsonx_governance/governance_openapi_spec.json new file mode 100644 index 0000000..e57edb0 --- /dev/null +++ b/assets/openAPI_specs/watsonx_governance/governance_openapi_spec.json @@ -0,0 +1,131 @@ +{ + "openapi": "3.0.3", + "info": { + "title": "RAG Endpoint on Watson Machine Learning", + "description": "Using OpenAPI v3.0.3 for integration.", + "version": "1.0.0" + }, + "servers": [ + { + "description": "Watson Machine Learning deployment URL", + "url": "https://us-south.ml.cloud.ibm.com" + } + ], + "security": [ + { + "oAuth2": [] + } + ], + "paths": { + "/ml/v1/deployments/{wml_deployment_id}/text/generation?version=2021-05-01": { + "post": { + "summary": "Get the predictions", + "operationId": "predictions_post", + "parameters": [ + { + "in": "path", + "name": "wml_deployment_id", + "schema": { + "type": "string", + "default": "" + }, + "required": true, + "description": "The ID of the Watson Machine Learning deployment" + }, + { + "in": "query", + "name": "version", + "schema": { + "type": "string", + "default": "2021-05-01" + }, + "required": true, + "description": "Version number as a string" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Predictions_post_request" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Predictions_post_response" + } + } + } + } + } + } + } + }, + "components": { + "securitySchemes": { + "oAuth2": { + "type": "oauth2", + "description": "See https://cloud.ibm.com/docs/account?topic=account-iamoverview", + "flows": { + "x-apikey": { + "tokenUrl": "https://iam.cloud.ibm.com/identity/token", + "grantType": "urn:ibm:params:oauth:grant-type:apikey", + "secretKeys": [ + "apikey" + ], + "paramKeys": [], + "scopes": {} + } + } + } + }, + "schemas": { + "Predictions_post_request": { + "type": "object", + "required": ["parameters"], + "properties": { + "parameters": { + "type": "object", + "required": ["prompt_variables"], + "properties": { + "prompt_variables": { + "type": "object", + "required": ["query_text"], + "properties": { + "query_text": { + "type": "string" + } + } + } + } + } + } + }, + "Predictions_post_response": { + "type": "object", + "required": ["generated_text", "generated_token_count", "input_token_count", "stop_reason"], + "properties": { + "generated_text": { + "type": "string" + }, + "generated_token_count": { + "type": "integer" + }, + "input_token_count": { + "type": "integer" + }, + "stop_reason": { + "type": "string" + } + } + } + } + } + } \ No newline at end of file