{ "swagger": "2.0", "info": { "title": "AutoSuggest", "version": "v1" }, "tags": [ { "name": "Jester" }, { "name": "DataService" } ], "schemes": [ "https" ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "paths": { "/v1/{type}/{name}:append": { "post": { "operationId": "DataService_AppendData", "responses": { "200": { "description": "A successful response.", "schema": { "type": "object", "properties": {} } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/rpcStatus" } } }, "parameters": [ { "name": "type", "in": "path", "required": true, "type": "string" }, { "name": "name", "in": "path", "required": true, "type": "string" }, { "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/DataServiceAppendDataBody" } } ], "tags": [ "DataService" ] } }, "/v1/{type}/{name}:info": { "get": { "operationId": "DataService_GetInfo", "responses": { "200": { "description": "A successful response.", "schema": { "$ref": "#/definitions/v1GetInfoResponse" } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/rpcStatus" } } }, "parameters": [ { "name": "type", "in": "path", "required": true, "type": "string" }, { "name": "name", "in": "path", "required": true, "type": "string" } ], "tags": [ "DataService" ] } }, "/v1/{type}/{name}:suggest": { "post": { "operationId": "Jester_Suggest", "responses": { "200": { "description": "A successful response.", "schema": { "$ref": "#/definitions/v1SuggestionResponse" } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/rpcStatus" } } }, "parameters": [ { "name": "type", "in": "path", "required": true, "type": "string" }, { "name": "name", "in": "path", "required": true, "type": "string" }, { "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/JesterSuggestBody" } } ], "tags": [ "Jester" ] } }, "/v1/{type}/{name}:update": { "put": { "operationId": "DataService_UpdateDataset", "responses": { "200": { "description": "A successful response.", "schema": { "type": "object", "properties": {} } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/rpcStatus" } } }, "parameters": [ { "name": "type", "in": "path", "required": true, "type": "string" }, { "name": "name", "in": "path", "required": true, "type": "string" }, { "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/DataServiceUpdateDatasetBody" } } ], "tags": [ "DataService" ] } }, "/v1/{type}:create": { "post": { "operationId": "DataService_CreateDataset", "responses": { "200": { "description": "A successful response.", "schema": { "type": "object", "properties": {} } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/rpcStatus" } } }, "parameters": [ { "name": "type", "in": "path", "required": true, "type": "string" }, { "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/DataServiceCreateDatasetBody" } } ], "tags": [ "DataService" ] } }, "/v1/{type}:delete": { "post": { "operationId": "DataService_DeleteData", "responses": { "200": { "description": "A successful response.", "schema": { "type": "object", "properties": {} } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/rpcStatus" } } }, "parameters": [ { "name": "type", "in": "path", "required": true, "type": "string" }, { "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/DataServiceDeleteDataBody" } } ], "tags": [ "DataService" ] } } }, "definitions": { "CalculateMetricsResponseMetricRow": { "type": "object", "properties": { "target": { "type": "string" }, "confidence": { "type": "number", "format": "float" }, "correct": { "type": "integer", "format": "int32" }, "incorrect": { "type": "integer", "format": "int32" }, "confidenceLevel": { "$ref": "#/definitions/asgttypeConfidence" } } }, "DataServiceAppendDataBody": { "type": "object", "properties": { "samples": { "type": "array", "items": { "type": "object", "$ref": "#/definitions/typeSample" } } } }, "DataServiceCreateDatasetBody": { "type": "object", "properties": { "name": { "type": "string" }, "tags": { "type": "array", "items": { "type": "string" } }, "targets": { "type": "array", "items": { "type": "string" } }, "samples": { "type": "array", "items": { "type": "object", "$ref": "#/definitions/typeSample" } }, "retentionPolicy": { "$ref": "#/definitions/typeRetentionPolicy" } } }, "DataServiceDeleteDataBody": { "type": "object", "properties": { "name": { "type": "string" }, "tag": { "type": "string" } } }, "DataServiceUpdateDatasetBody": { "type": "object", "properties": { "retentionPolicy": { "$ref": "#/definitions/typeRetentionPolicy" } } }, "JesterSuggestBody": { "type": "object", "properties": { "inputs": { "type": "array", "items": { "type": "object", "$ref": "#/definitions/typeData" } }, "options": { "$ref": "#/definitions/v1SuggestionOptions" }, "tags": { "type": "array", "items": { "type": "string" } } } }, "ModelInputType": { "type": "string", "enum": [ "FEATURE_TENSORS", "EXAMPLE_TENSOR" ], "default": "FEATURE_TENSORS" }, "PredictionTarget": { "type": "object", "properties": { "name": { "type": "string" }, "candidates": { "type": "array", "items": { "type": "object", "$ref": "#/definitions/PredictionTargetCandidate" } }, "unknownTargetClass": { "type": "boolean" } } }, "PredictionTargetCandidate": { "type": "object", "properties": { "value": { "type": "string" }, "confidence": { "$ref": "#/definitions/asgttypeConfidence" } } }, "TargetMetricsMetric": { "type": "object", "properties": { "precision": { "type": "number", "format": "float" }, "confidence": { "type": "number", "format": "float" }, "answerRate": { "type": "number", "format": "float" }, "truePositive": { "type": "integer", "format": "int32" }, "trueNegative": { "type": "integer", "format": "int32" }, "falsePositive": { "type": "integer", "format": "int32" }, "falseNegative": { "type": "integer", "format": "int32" }, "mcc": { "type": "number", "format": "float", "title": "Matthews correlation coefficient" }, "accuracy": { "type": "number", "format": "float" }, "balancedAccuracy": { "type": "number", "format": "float" }, "precisionBoundEpsilon": { "type": "number", "format": "float", "title": "precision bound epsilon values" } } }, "asgttypeConfidence": { "type": "object", "properties": { "level": { "$ref": "#/definitions/asgttypeConfidenceLevel", "description": "A bucketized representation of confidence, which is intended to give clients\nhighly stable results across model upgrades." }, "value": { "type": "number", "format": "float", "title": "The confidence value" } }, "title": "Common types" }, "asgttypeConfidenceLevel": { "type": "string", "enum": [ "UNKNOWN", "VERY_LOW", "LOW", "MID", "HIGH", "VERY_HIGH" ], "default": "UNKNOWN" }, "protobufAny": { "type": "object", "properties": { "@type": { "type": "string" } }, "additionalProperties": {} }, "rpcStatus": { "type": "object", "properties": { "code": { "type": "integer", "format": "int32" }, "message": { "type": "string" }, "details": { "type": "array", "items": { "type": "object", "$ref": "#/definitions/protobufAny" } } } }, "typeConfidenceThresholds": { "type": "object", "properties": { "confidenceThresholds": { "type": "array", "items": { "type": "object", "$ref": "#/definitions/asgttypeConfidence" } } } }, "typeData": { "type": "object", "properties": { "transaction": { "$ref": "#/definitions/typeTransaction", "title": "Transaction-level information; at this time used only with bank transactions" }, "invoice": { "$ref": "#/definitions/typeInvoice", "title": "Invoice-level information for e-invoices and scanned invoices and receipts" }, "invoiceLine": { "$ref": "#/definitions/typeInvoiceLine", "title": "Line-level information for e-invoices; use one sample per invoice line" } } }, "typeDataset": { "type": "object", "properties": { "consumer": { "type": "string" }, "name": { "type": "string" }, "type": { "type": "string" }, "tags": { "type": "array", "items": { "type": "string" } }, "targets": { "type": "array", "items": { "type": "string" } }, "retentionPolicy": { "$ref": "#/definitions/typeRetentionPolicy" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "size": { "type": "string", "format": "int64", "title": "Number of samples in the dataset reflecting added entries that meet the retention policy" }, "truncatedAt": { "type": "string", "format": "date-time" } } }, "typeInvoice": { "type": "object", "properties": { "issueDate": { "type": "string", "format": "date-time" }, "supplier": { "$ref": "#/definitions/typeSupplier", "description": "supplier of the invoice. Used in electronic-invoice-line requests." }, "customerRef": { "type": "string", "description": "reference to the customer. Used in electronic-invoice-line requests." }, "text": { "type": "string", "description": "invoice text from the SmartScan product. Used in scanned-invoice requests." }, "currency": { "type": "string", "description": "name of the currency as a string. Used in electronic-invoice-line requests." }, "total": { "type": "number", "format": "float", "description": "total of the invoice. Used in electronic-invoice-line requests." } } }, "typeInvoiceLine": { "type": "object", "properties": { "text": { "type": "string", "description": "text of the invoice line. Used in electronic-invoice-line requests." }, "itemId": { "type": "string", "description": "id of the product (item). Used in electronic-invoice-line requests." } } }, "typeModel": { "type": "object", "properties": { "version": { "type": "string", "format": "int64" }, "createdAt": { "type": "string", "format": "date-time" }, "datasetSize": { "type": "integer", "format": "int32" }, "trainingSize": { "type": "integer", "format": "int32" }, "confidenceScores": { "type": "array", "items": { "type": "object", "$ref": "#/definitions/typeTargetMetrics" } }, "inputType": { "$ref": "#/definitions/ModelInputType" }, "datasetType": { "type": "string" }, "modelFiles": { "type": "array", "items": { "type": "object", "$ref": "#/definitions/typeModelFile" } }, "targetToConfidenceThresholds": { "type": "object", "additionalProperties": { "$ref": "#/definitions/typeConfidenceThresholds" } } } }, "typeModelFile": { "type": "object", "properties": { "name": { "type": "string" }, "data": { "type": "string", "format": "byte" } } }, "typeModelType": { "type": "string", "enum": [ "DEFAULT", "TENSORFLOW", "ONNX" ], "default": "DEFAULT" }, "typePrediction": { "type": "object", "properties": { "targets": { "type": "array", "items": { "type": "object", "$ref": "#/definitions/PredictionTarget" } }, "unknownTokenPercentage": { "type": "number", "format": "float" } } }, "typeRetentionPolicy": { "type": "object", "properties": { "maxDays": { "type": "string", "format": "int64" } } }, "typeSample": { "type": "object", "properties": { "data": { "$ref": "#/definitions/typeData" }, "targetValues": { "type": "array", "items": { "type": "object", "$ref": "#/definitions/typeTargetValue" } } } }, "typeSupplier": { "type": "object", "properties": { "id": { "type": "string", "title": "id of the supplier; not nullable" }, "name": { "type": "string", "title": "name of the supplier" }, "globalId": { "type": "string", "title": "global id of the supplier" } } }, "typeTargetMetrics": { "type": "object", "properties": { "target": { "type": "string" }, "metrics": { "type": "array", "items": { "type": "object", "$ref": "#/definitions/TargetMetricsMetric" } }, "entropy": { "type": "number", "format": "float", "title": "entropy of the dataset" }, "numberOfClasses": { "type": "integer", "format": "int32", "title": "number of classes in the dataset" }, "avgSamplePerClass": { "type": "number", "format": "float", "title": "average samples per class" }, "inconsistentLabelRatio": { "type": "number", "format": "float", "title": "ratio of inconsistent labels" }, "avgLabelsPerInconsistentSample": { "type": "number", "format": "float", "title": "average labels per inconsistent sample" }, "percentSamplesNotInTargetVocab": { "type": "number", "format": "float", "title": "percentage of samples not in target vocabulary" }, "jsDivergenceClasses": { "type": "number", "format": "float", "title": "Jensen-Shannon divergence for classes" } } }, "typeTargetValue": { "type": "object", "properties": { "name": { "type": "string" }, "value": { "type": "string" } }, "title": "Record mapping a target name to a value" }, "typeTransaction": { "type": "object", "properties": { "text": { "type": "string", "description": "text of the bank transaction. Used in bank requests." }, "amount": { "type": "number", "format": "float", "description": "amount of the transaction. Used in bank requests." } } }, "v1CalculateMetricsResponse": { "type": "object", "properties": { "metrics": { "type": "array", "items": { "type": "object", "$ref": "#/definitions/CalculateMetricsResponseMetricRow" } } } }, "v1CallsPerMonth": { "type": "object", "properties": { "calls": { "type": "string", "format": "int64" }, "monthName": { "type": "string" }, "totalBatchSize": { "type": "string", "format": "int64" } } }, "v1CallsPerMonthResponse": { "type": "object", "properties": { "callsPerMonth": { "type": "array", "items": { "type": "object", "$ref": "#/definitions/v1CallsPerMonth" } } } }, "v1GetInfoResponse": { "type": "object", "properties": { "dataset": { "$ref": "#/definitions/typeDataset" }, "model": { "$ref": "#/definitions/typeModel", "title": "The most recently trained model; empty if no model has been trained" } } }, "v1InternalSuggestSamplesResponse": { "type": "object", "properties": { "suggestionResponse": { "$ref": "#/definitions/v1SuggestionResponse" } } }, "v1SuggestionOptions": { "type": "object", "properties": { "suggestionLimit": { "type": "integer", "format": "int32" }, "minConfidence": { "$ref": "#/definitions/asgttypeConfidenceLevel" }, "modelType": { "$ref": "#/definitions/typeModelType" } } }, "v1SuggestionRequest": { "type": "object", "properties": { "name": { "type": "string" }, "type": { "type": "string" }, "inputs": { "type": "array", "items": { "type": "object", "$ref": "#/definitions/typeData" } }, "options": { "$ref": "#/definitions/v1SuggestionOptions" }, "tags": { "type": "array", "items": { "type": "string" } } } }, "v1SuggestionResponse": { "type": "object", "properties": { "predictions": { "type": "array", "items": { "type": "object", "$ref": "#/definitions/typePrediction" } }, "model": { "$ref": "#/definitions/typeModel" } }, "title": "AutoSuggest" } } }