diff --git a/specification/cognitiveservices/data-plane/Personalizer/preview/v1.0/Personalizer.json b/specification/cognitiveservices/data-plane/Personalizer/preview/v1.0/Personalizer.json new file mode 100644 index 000000000000..88a3a5f1320b --- /dev/null +++ b/specification/cognitiveservices/data-plane/Personalizer/preview/v1.0/Personalizer.json @@ -0,0 +1,1052 @@ +{ + "swagger": "2.0", + "info": { + "version": "v1.0", + "title": "Personalizer Client", + "description": "Personalizer Service is an Azure Cognitive Service that makes it easy to target content and experiences without complex pre-analysis or cleanup of past data. Given a context and featurized content, the Personalizer Service returns your content in a ranked list. As rewards are sent in response to the ranked list, the reinforcement learning algorithm will improve the model and improve performance of future rank calls." + }, + "basePath": "/personalizer/v1.0", + "paths": { + "/configurations/service": { + "get": { + "tags": [ + "Configurations" + ], + "summary": "Get the service configuration.", + "operationId": "ServiceConfiguration_Get", + "consumes": [ + + ], + "produces": [ + "application/json" + ], + "parameters": [ + + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/ServiceConfiguration" + } + } + }, + "x-ms-examples": { + "Successful ServiceConfiguration_Get request": { + "$ref": "./examples/ServiceConfiguration_Get.json" + } + } + }, + "patch": { + "tags": [ + "Configurations" + ], + "summary": "Update the service configuration.", + "operationId": "ServiceConfiguration_Update", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "parameters": [ + { + "name": "config", + "in": "body", + "description": "The personalizer service configuration.", + "required": true, + "schema": { + "$ref": "#/definitions/ServiceConfiguration" + } + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/ServiceConfiguration" + } + }, + "default": { + "description": "*** Error Responses: ***\\n\\n * 400 Invalid arguments.\\n\\n * 404 ResourceNotFound." + } + }, + "x-ms-examples": { + "Successful ServiceConfiguration_Update request": { + "$ref": "./examples/ServiceConfiguration_Update.json" + } + } + } + }, + "/configurations/policy": { + "get": { + "tags": [ + "Configurations" + ], + "summary": "Get the policy configuration.", + "operationId": "Policy_Get", + "consumes": [ + + ], + "produces": [ + "application/json" + ], + "parameters": [ + + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/PolicyContract" + } + } + }, + "x-ms-examples": { + "Successful Policy_Get request": { + "$ref": "./examples/Policy_Get.json" + } + } + }, + "delete": { + "tags": [ + "Configurations" + ], + "summary": "Delete the current policy.", + "operationId": "Policy_Delete", + "consumes": [ + + ], + "produces": [ + "application/json" + ], + "parameters": [ + + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/PolicyContract" + } + } + }, + "x-ms-examples": { + "Successful Policy_Delete request": { + "$ref": "./examples/Policy_Delete.json" + } + } + }, + "patch": { + "tags": [ + "Configurations" + ], + "summary": "Update the policy configuration.", + "operationId": "Policy_Update", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "parameters": [ + { + "name": "policy", + "in": "body", + "description": "The policy configuration.", + "required": true, + "schema": { + "$ref": "#/definitions/PolicyContract" + } + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/PolicyContract" + } + }, + "default": { + "description": "*** Error Responses: ***\\n\\n * 400 Invalid arguments.\\n\\n * 404 ResourceNotFound." + } + }, + "x-ms-examples": { + "Successful Policy_Update request": { + "$ref": "./examples/Policy_Update.json" + } + } + } + }, + "/evaluations": { + "get": { + "tags": [ + "Evaluations" + ], + "summary": "List all submitted evaluations.", + "operationId": "Evaluations_List", + "consumes": [ + + ], + "produces": [ + "application/json" + ], + "parameters": [ + + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/Evaluation" + } + } + } + }, + "x-ms-examples": { + "Successful Evaluations_List request": { + "$ref": "./examples/Evaluations_List.json" + } + } + }, + "post": { + "tags": [ + "Evaluations" + ], + "summary": "Submit a new evaluation.", + "operationId": "Evaluations_Create", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "parameters": [ + { + "name": "evaluation", + "in": "body", + "description": "The evaluation job definition.", + "required": true, + "schema": { + "$ref": "#/definitions/EvaluationContract" + } + } + ], + "responses": { + "201": { + "description": "Success", + "schema": { + "$ref": "#/definitions/Evaluation" + } + }, + "default": { + "description": "*** Error Responses: ***\\n\\n * 400 Invalid arguments.\\n\\n * 404 ResourceNotFound." + } + }, + "x-ms-examples": { + "Successful Evaluations_Create request": { + "$ref": "./examples/Evaluations_Create.json" + } + } + } + }, + "/evaluations/{evaluationId}": { + "get": { + "tags": [ + "Evaluations" + ], + "summary": "Get the evaluation associated with the ID.", + "operationId": "Evaluations_Get", + "consumes": [ + + ], + "produces": [ + "application/json" + ], + "parameters": [ + { + "name": "evaluationId", + "in": "path", + "description": "ID of the evaluation in question.", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/Evaluation" + } + }, + "default": { + "description": "*** Error Responses: ***\\n\\n * 400 Invalid arguments.\\n\\n * 404 ResourceNotFound." + } + }, + "x-ms-examples": { + "Successful Evaluations_Get request": { + "$ref": "./examples/Evaluations_Get.json" + } + } + }, + "delete": { + "tags": [ + "Evaluations" + ], + "summary": "Delete the evaluation associated with the ID.", + "operationId": "Evaluations_Delete", + "consumes": [ + + ], + "produces": [ + + ], + "parameters": [ + { + "name": "evaluationId", + "in": "path", + "description": "ID of the evaluation to delete.", + "required": true, + "type": "string" + } + ], + "responses": { + "204": { + "description": "Success" + } + }, + "x-ms-examples": { + "Successful Evaluations_Delete request": { + "$ref": "./examples/Evaluations_Delete.json" + } + } + } + }, + "/events/{eventId}/reward": { + "post": { + "tags": [ + "Events" + ], + "summary": "Report reward to allocate to the top ranked action for the specified event.", + "operationId": "Events_Reward", + "consumes": [ + "application/json" + ], + "produces": [ + + ], + "parameters": [ + { + "name": "eventId", + "in": "path", + "description": "The event id this reward applies to.", + "required": true, + "type": "string" + }, + { + "name": "reward", + "in": "body", + "description": "The reward should be a floating point number.", + "required": true, + "schema": { + "$ref": "#/definitions/RewardRequest" + } + } + ], + "responses": { + "204": { + "description": "Success" + }, + "default": { + "description": "*** Error Responses: ***\\n\\n * 400 Invalid arguments.\\n\\n * 404 ResourceNotFound." + } + }, + "x-ms-examples": { + "Successful Events_Reward request": { + "$ref": "./examples/Events_Reward.json" + } + } + } + }, + "/events/{eventId}/activate": { + "post": { + "tags": [ + "Events" + ], + "summary": "Report that the specified event was actually displayed to the user and a reward should be expected for it.", + "operationId": "Events_Activate", + "consumes": [ + + ], + "produces": [ + + ], + "parameters": [ + { + "name": "eventId", + "in": "path", + "description": "The event ID this activation applies to.", + "required": true, + "type": "string" + } + ], + "responses": { + "204": { + "description": "Success" + }, + "default": { + "description": "*** Error Responses: ***\\n\\n * 400 Invalid arguments.\\n\\n * 404 ResourceNotFound." + } + }, + "x-ms-examples": { + "Successful Events_Activate request": { + "$ref": "./examples/Events_Activate.json" + } + } + } + }, + "/logs": { + "delete": { + "tags": [ + "Logs" + ], + "summary": "Deletes all the logs.", + "operationId": "Log_Delete", + "consumes": [ + + ], + "produces": [ + + ], + "parameters": [ + + ], + "responses": { + "204": { + "description": "Success" + } + }, + "x-ms-examples": { + "Successful Log_Delete request": { + "$ref": "./examples/Log_Delete.json" + } + } + } + }, + "/logs/properties": { + "get": { + "tags": [ + "Logs" + ], + "summary": "Gets logs properties.", + "operationId": "Log_GetProperties", + "consumes": [ + + ], + "produces": [ + "application/json" + ], + "parameters": [ + + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/LogsProperties" + } + }, + "default": { + "description": "*** Error Responses: ***\\n\\n * 400 Invalid arguments.\\n\\n * 404 ResourceNotFound." + } + }, + "x-ms-examples": { + "Successful Log_GetProperties request": { + "$ref": "./examples/Log_GetProperties.json" + } + } + } + }, + "/model": { + "get": { + "tags": [ + "Model" + ], + "summary": "Get current model.", + "operationId": "Model_Get", + "consumes": [ + + ], + "produces": [ + "application/octet-stream" + ], + "parameters": [ + + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "type": "file" + } + } + }, + "x-ms-examples": { + "Successful Model_Get request": { + "$ref": "./examples/Model_Get.json" + } + } + }, + "delete": { + "tags": [ + "Model" + ], + "summary": "Resets the model.", + "operationId": "Model_Delete", + "consumes": [ + + ], + "produces": [ + + ], + "parameters": [ + + ], + "responses": { + "204": { + "description": "Success" + }, + "default": { + "description": "*** Error Responses: ***\\n\\n * 400 Invalid arguments.\\n\\n * 404 ResourceNotFound." + } + }, + "x-ms-examples": { + "Successful Model_Delete request": { + "$ref": "./examples/Model_Delete.json" + } + } + } + }, + "/model/properties": { + "get": { + "tags": [ + "Model" + ], + "summary": "Get model properties.", + "operationId": "Model_GetProperties", + "consumes": [ + + ], + "produces": [ + "application/json" + ], + "parameters": [ + + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/ModelProperties" + } + } + }, + "x-ms-examples": { + "Successful Model_GetProperties request": { + "$ref": "./examples/Model_GetProperties.json" + } + } + } + }, + "/rank": { + "post": { + "tags": [ + "Ranking" + ], + "summary": "A Personalizer rank request.", + "operationId": "Events_Rank", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "parameters": [ + { + "name": "rankRequest", + "in": "body", + "description": "A Personalizer request.", + "required": true, + "schema": { + "$ref": "#/definitions/RankRequest" + } + } + ], + "responses": { + "201": { + "description": "Success", + "schema": { + "$ref": "#/definitions/RankResponse" + } + }, + "default": { + "description": "*** Error Responses: ***\\n\\n * 400 Invalid arguments.\\n\\n * 404 ResourceNotFound." + } + }, + "x-ms-examples": { + "Successful Events_Rank request": { + "$ref": "./examples/Events_Rank.json" + } + } + } + } + }, + "definitions": { + "ServiceConfiguration": { + "description": "The configuration of the service.", + "required": [ + "rewardWaitTime", + "defaultReward", + "rewardAggregation", + "explorationPercentage", + "modelExportFrequency", + "logRetentionDays" + ], + "type": "object", + "properties": { + "rewardWaitTime": { + "description": "The time span waited until a request is marked with the default reward.", + "type": "string" + }, + "defaultReward": { + "format": "float", + "description": "The reward given if a reward is not received within the specified wait time.", + "maximum": 1, + "minimum": -1, + "type": "number" + }, + "rewardAggregation": { + "description": "The function used to process rewards.", + "type": "string" + }, + "explorationPercentage": { + "format": "float", + "description": "The percentage of rank responses that will use exploration.", + "type": "number" + }, + "modelExportFrequency": { + "description": "The time delay between exporting trained models.", + "type": "string" + }, + "logRetentionDays": { + "format": "int32", + "description": "Number of days historical logs are to be maintained.", + "type": "integer" + } + } + }, + "PolicyContract": { + "description": "Policy specifying how to train the model.", + "required": [ + "name", + "arguments" + ], + "type": "object", + "properties": { + "name": { + "description": "Name of the Policy.", + "type": "string" + }, + "arguments": { + "description": "Arguments of the Policy.", + "type": "string" + } + } + }, + "EvaluationContract": { + "description": "A counterfactual evaluation.", + "required": [ + "name", + "startTime", + "endTime", + "policies" + ], + "type": "object", + "properties": { + "enableOfflineExperimentation": { + "description": "True if the evaluation should explore for a more optimal policy.", + "type": "boolean" + }, + "name": { + "description": "The name of the evaluation.", + "type": "string" + }, + "startTime": { + "format": "date-time", + "description": "The start time of the evaluation.", + "type": "string" + }, + "endTime": { + "format": "date-time", + "type": "string" + }, + "policies": { + "description": "Additional policies to evaluate.", + "type": "array", + "items": { + "$ref": "#/definitions/PolicyContract" + } + } + } + }, + "Evaluation": { + "type": "object", + "properties": { + "id": { + "type": "string", + "readOnly": true + }, + "name": { + "type": "string", + "readOnly": true + }, + "startTime": { + "format": "date-time", + "type": "string", + "readOnly": true + }, + "endTime": { + "format": "date-time", + "type": "string", + "readOnly": true + }, + "jobId": { + "type": "string", + "readOnly": true + }, + "status": { + "enum": [ + "completed", + "pending", + "failed", + "notSubmitted" + ], + "type": "string", + "readOnly": true, + "x-ms-enum": { + "name": "EvaluationJobStatus", + "modelAsString": true + } + }, + "policyResults": { + "type": "array", + "items": { + "$ref": "#/definitions/PolicyResult" + } + } + } + }, + "PolicyResult": { + "type": "object", + "properties": { + "name": { + "type": "string", + "readOnly": true + }, + "arguments": { + "type": "string", + "readOnly": true + }, + "summary": { + "type": "array", + "items": { + "$ref": "#/definitions/PolicyResultSummary" + }, + "readOnly": true + }, + "totalSummary": { + "allOf": [ + { + "$ref": "#/definitions/PolicyResultSummary" + } + ], + "readOnly": true + } + } + }, + "PolicyResultSummary": { + "type": "object", + "properties": { + "timeStamp": { + "format": "date-time", + "type": "string", + "readOnly": true + }, + "ipsEstimatorNumerator": { + "format": "float", + "type": "number", + "readOnly": true + }, + "ipsEstimatorDenominator": { + "format": "float", + "type": "number", + "readOnly": true + }, + "snipsEstimatorDenominator": { + "format": "float", + "type": "number", + "readOnly": true + }, + "aggregateTimeWindow": { + "type": "string", + "readOnly": true + }, + "nonZeroProbability": { + "format": "float", + "type": "number" + }, + "confidenceInterval": { + "format": "float", + "type": "number", + "readOnly": true + }, + "sumOfSquares": { + "format": "float", + "type": "number", + "readOnly": true + } + } + }, + "RewardRequest": { + "description": "Reward given to a rank response.", + "type": "object", + "properties": { + "value": { + "format": "float", + "description": "Reward to be assigned to an action. Value must be between -1 and 1 inclusive.", + "type": "number" + } + } + }, + "LogsProperties": { + "type": "object", + "properties": { + "dateRange": { + "allOf": [ + { + "$ref": "#/definitions/DateRange" + } + ], + "readOnly": true + } + } + }, + "DateRange": { + "type": "object", + "properties": { + "from": { + "format": "date-time", + "type": "string", + "readOnly": true + }, + "to": { + "format": "date-time", + "type": "string", + "readOnly": true + } + } + }, + "ModelProperties": { + "type": "object", + "properties": { + "creationTime": { + "format": "date-time", + "type": "string", + "readOnly": true + }, + "lastModifiedTime": { + "format": "date-time", + "type": "string", + "readOnly": true + } + } + }, + "RankRequest": { + "description": "Request a set of actions to be ranked by the Personalizer service.", + "required": [ + "actions" + ], + "type": "object", + "properties": { + "contextFeatures": { + "description": "Features of the context used for Personalizer as a\r\ndictionary of dictionaries. This depends on the application, and\r\ntypically includes features about the current user, their\r\ndevice, profile information, data about time and date, etc.", + "type": "array", + "items": { + "type": "object" + } + }, + "actions": { + "description": "The set of actions the Personalizer service can pick from.\r\nThe set should not contain more than 50 actions.\r\nThe order of the actions does not affect the rank result but the order\r\nshould match the sequence your application would have used to display them.", + "type": "array", + "items": { + "$ref": "#/definitions/RankableAction" + } + }, + "excludedActions": { + "description": "The set of action ids to exclude from ranking.", + "type": "array", + "items": { + "type": "string" + } + }, + "eventId": { + "description": "Optionally pass an eventId that uniquely identifies this Rank event. \r\nIf null, the service generates a unique eventId. The eventId will be used for\r\nassociating this request with its reward, as well as seeding the pseudo-random\r\ngenerator when making a Personalizer call.", + "type": "string" + }, + "deferActivation": { + "description": "Send false if the user will see the rank results, therefore\r\nPersonalizer will expect a Reward call, otherwise it will assign the default\r\nReward to the event. Send true if it is possible the user will not see the\r\nrank results, because the page is rendering later, or the Rank results may be\r\noverridden by code further downstream.", + "default": false, + "type": "boolean" + } + } + }, + "RankableAction": { + "description": "An action with it\u0027s associated features used for ranking.", + "required": [ + "id", + "features" + ], + "type": "object", + "properties": { + "id": { + "description": "Id of the action.", + "type": "string" + }, + "features": { + "description": "List of dictionaries containing features.", + "type": "array", + "items": { + "type": "object" + } + } + } + }, + "RankResponse": { + "description": "A resulting ordered list of actions that result from a rank request.", + "type": "object", + "properties": { + "ranking": { + "description": "The calculated ranking for the current request.", + "type": "array", + "items": { + "$ref": "#/definitions/RankedAction" + }, + "readOnly": true + }, + "eventId": { + "description": "The eventId for the round trip from request to response.", + "type": "string", + "readOnly": true + }, + "rewardActionId": { + "description": "The action chosen by the Personalizer service. This is the action for which to report the reward. This might not be the \r\nfirst found in \u0027ranking\u0027 if an action in the request in first position was part of the excluded ids.", + "type": "string", + "readOnly": true + } + } + }, + "RankedAction": { + "description": "A ranked action with its resulting probability.", + "type": "object", + "properties": { + "id": { + "description": "Id of the action", + "type": "string", + "readOnly": true + }, + "probability": { + "format": "float", + "description": "Probability of the action", + "type": "number", + "readOnly": true + } + } + }, + "ContainerStatus": { + "type": "object", + "properties": { + "service": { + "type": "string" + }, + "apiStatus": { + "type": "string" + }, + "apiStatusMessage": { + "type": "string" + } + } + } + }, + "parameters": { + "Endpoint": { + "name": "Endpoint", + "in": "path", + "description": "Supported Cognitive Services endpoint.", + "required": true, + "type": "string", + "x-ms-parameter-location": "client", + "x-ms-skip-url-encoding": true + } + }, + "securityDefinitions": { + "apim_key": { + "name": "Ocp-Apim-Subscription-Key", + "in": "header", + "type": "apiKey" + } + }, + "security": [ + { + "apim_key": [ + + ] + } + ], + "tags": [ + { + "name": "Evaluations", + "description": "Manages counterfactual evaluation operations." + }, + { + "name": "Model", + "description": "Manages reinforcement learning configuration operations." + }, + { + "name": "Configurations", + "description": "Manages configuration operations." + }, + { + "name": "Events", + "description": "Manages event operations." + }, + { + "name": "Logs", + "description": "Manages reinforcement learning logs." + }, + { + "name": "Ranking", + "description": "Manages ranking operations." + } + ], + "x-ms-parameterized-host": { + "hostTemplate": "{Endpoint}", + "useSchemePrefix": false, + "parameters": [ + { + "$ref": "#/parameters/Endpoint" + } + ] + } +} diff --git a/specification/cognitiveservices/data-plane/Personalizer/preview/v1.0/examples/Evaluations_Create.json b/specification/cognitiveservices/data-plane/Personalizer/preview/v1.0/examples/Evaluations_Create.json new file mode 100644 index 000000000000..cc9d74df7750 --- /dev/null +++ b/specification/cognitiveservices/data-plane/Personalizer/preview/v1.0/examples/Evaluations_Create.json @@ -0,0 +1,38 @@ +{ + "parameters": { + "Endpoint": "{Endpoint}", + "evaluation": { + "enableOfflineExperimentation": true, + "name": "myFirstEvaluation", + "startTime": "2018-12-19T00:00:00Z", + "endTime": "2019-01-19T00:00:00Z", + "policies": [ + { + "name": "Custom Policy 1", + "arguments": "--cb_explore_adf --epsilon 0.2 --dsjson --cb_type ips -l 0.5 --l1 1E-07 --power_t 0.5" + } + ] + }, + "Ocp-Apim-Subscription-Key": "{API key}" + }, + "responses": { + "201": { + "body": { + "id": "b58c6d92-b727-48c1-9487-4be2782c9e0a", + "name": "myFirstEvaluation", + "startTime": "2018-12-19T00:00:00Z", + "endTime": "2019-01-19T00:00:00Z", + "status": "completed", + "policyResults": [ + { + "name": "Custom Policy 1", + "arguments": "--cb_explore_adf --epsilon 0.2 --dsjson --cb_type ips -l 0.5 --l1 1E-07 --power_t 0.5" + } + ] + }, + "header": { + + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/Personalizer/preview/v1.0/examples/Evaluations_Delete.json b/specification/cognitiveservices/data-plane/Personalizer/preview/v1.0/examples/Evaluations_Delete.json new file mode 100644 index 000000000000..d46ae8afecca --- /dev/null +++ b/specification/cognitiveservices/data-plane/Personalizer/preview/v1.0/examples/Evaluations_Delete.json @@ -0,0 +1,15 @@ +{ + "parameters": { + "Endpoint": "{Endpoint}", + "evaluationId": "id", + "Ocp-Apim-Subscription-Key": "{API key}" + }, + "responses": { + "204": { + "body": "", + "header": { + + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/Personalizer/preview/v1.0/examples/Evaluations_Get.json b/specification/cognitiveservices/data-plane/Personalizer/preview/v1.0/examples/Evaluations_Get.json new file mode 100644 index 000000000000..e50b89b1e871 --- /dev/null +++ b/specification/cognitiveservices/data-plane/Personalizer/preview/v1.0/examples/Evaluations_Get.json @@ -0,0 +1,59 @@ +{ + "parameters": { + "Endpoint": "{Endpoint}", + "evaluationId": "id", + "Ocp-Apim-Subscription-Key": "{API key}" + }, + "responses": { + "200": { + "body": { + "id": "b58c6d92-b727-48c1-9487-4be2782c9e0a", + "name": "myFirstEvaluation", + "startTime": "2018-12-19T00:00:00Z", + "endTime": "2019-01-19T00:00:00Z", + "status": "completed", + "policyResults": [ + { + "name": "Custom Policy 1", + "arguments": "--cb_explore_adf --epsilon 0.2 --dsjson --cb_type ips -l 0.5 --l1 1E-07 --power_t 0.5", + "summary": [ + { + "timeStamp": "2018-12-19T00:00:00Z", + "ipsEstimatorNumerator": 0.0, + "ipsEstimatorDenominator": 170.0, + "snipsEstimatorDenominator": 308.25, + "aggregateTimeWindow": "00:00:00", + "nonZeroProbability": 64.0, + "confidenceInterval": 0.0, + "sumOfSquares": 0.0 + }, + { + "timeStamp": "2018-12-19T00:05:00Z", + "ipsEstimatorNumerator": 2.2, + "ipsEstimatorDenominator": 196.0, + "snipsEstimatorDenominator": 193.761, + "aggregateTimeWindow": "00:00:00", + "nonZeroProbability": 68.0, + "confidenceInterval": 1.1009, + "sumOfSquares": 2.424 + } + ], + "totalSummary": { + "timeStamp": "2019-01-19T00:00:00Z", + "ipsEstimatorNumerator": 22.2, + "ipsEstimatorDenominator": 1906.0, + "snipsEstimatorDenominator": 1993.761, + "aggregateTimeWindow": "00:00:00", + "nonZeroProbability": 68.0, + "confidenceInterval": 1.1209, + "sumOfSquares": 2.484 + } + } + ] + }, + "header": { + + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/Personalizer/preview/v1.0/examples/Evaluations_List.json b/specification/cognitiveservices/data-plane/Personalizer/preview/v1.0/examples/Evaluations_List.json new file mode 100644 index 000000000000..b339945de9c7 --- /dev/null +++ b/specification/cognitiveservices/data-plane/Personalizer/preview/v1.0/examples/Evaluations_List.json @@ -0,0 +1,38 @@ +{ + "parameters": { + "Ocp-Apim-Subscription-Key": "{API key}", + "Endpoint": "{Endpoint}" + }, + "responses": { + "200": { + "body": [ + { + "id": "b58c6d92-b727-48c1-9487-4be2782c9e0a", + "name": "myFirstEvaluation", + "startTime": "2018-11-19T00:00:00Z", + "endTime": "2018-12-19T00:00:00Z", + "status": "pending", + "policyResults": [ + { + "name": "Custom Policy 1", + "arguments": "--cb_explore_adf --epsilon 0.2 --dsjson --cb_type ips -l 0.5 --l1 1E-07 --power_t 0.5" + } + ] + }, + { + "id": "21d03972-9130-4be9-8c8b-8ac3ec9b9dd1", + "name": "mySecondEvaluation", + "startTime": "2018-12-19T00:00:00Z", + "endTime": "2019-01-19T00:00:00Z", + "status": "pending", + "policyResults": [ + + ] + } + ], + "header": { + + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/Personalizer/preview/v1.0/examples/Events_Activate.json b/specification/cognitiveservices/data-plane/Personalizer/preview/v1.0/examples/Events_Activate.json new file mode 100644 index 000000000000..2274850daf88 --- /dev/null +++ b/specification/cognitiveservices/data-plane/Personalizer/preview/v1.0/examples/Events_Activate.json @@ -0,0 +1,15 @@ +{ + "parameters": { + "eventId": "id", + "Endpoint": "{Endpoint}", + "Ocp-Apim-Subscription-Key": "{API key}" + }, + "responses": { + "204": { + "body": "", + "header": { + + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/Personalizer/preview/v1.0/examples/Events_Rank.json b/specification/cognitiveservices/data-plane/Personalizer/preview/v1.0/examples/Events_Rank.json new file mode 100644 index 000000000000..725c02fe7bc3 --- /dev/null +++ b/specification/cognitiveservices/data-plane/Personalizer/preview/v1.0/examples/Events_Rank.json @@ -0,0 +1,69 @@ +{ + "parameters": { + "Endpoint": "{Endpoint}", + "Ocp-Apim-Subscription-Key": "{API key}", + "rankRequest": { + "contextFeatures": [ + { + "timeOfDay": "Morning" + } + ], + "actions": [ + { + "id": "NewsArticle", + "features": [ + { + "type": "News" + } + ] + }, + { + "id": "SportsArticle", + "features": [ + { + "type": "Sports" + } + ] + }, + { + "id": "EntertainmentArticle", + "features": [ + { + "type": "Entertainment" + } + ] + } + ], + "excludedActions": [ + "SportsArticle" + ], + "eventId": "75269AD0-BFEE-4598-8196-C57383D38E10", + "deferActivation": false + } + }, + "responses": { + "201": { + "body": { + "ranking": [ + { + "id": "EntertainmentArticle", + "probability": 0.8 + }, + { + "id": "SportsArticle", + "probability": 0.0 + }, + { + "id": "NewsArticle", + "probability": 0.2 + } + ], + "eventId": "75269AD0-BFEE-4598-8196-C57383D38E10", + "rewardActionId": "EntertainmentArticle" + }, + "header": { + + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/Personalizer/preview/v1.0/examples/Events_Reward.json b/specification/cognitiveservices/data-plane/Personalizer/preview/v1.0/examples/Events_Reward.json new file mode 100644 index 000000000000..8b6db659b300 --- /dev/null +++ b/specification/cognitiveservices/data-plane/Personalizer/preview/v1.0/examples/Events_Reward.json @@ -0,0 +1,18 @@ +{ + "parameters": { + "eventId": "id", + "Endpoint": "{Endpoint}", + "Ocp-Apim-Subscription-Key": "{API key}", + "reward": { + "value": 1.0 + } + }, + "responses": { + "204": { + "body": "", + "header": { + + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/Personalizer/preview/v1.0/examples/Log_Delete.json b/specification/cognitiveservices/data-plane/Personalizer/preview/v1.0/examples/Log_Delete.json new file mode 100644 index 000000000000..62e3f0e62214 --- /dev/null +++ b/specification/cognitiveservices/data-plane/Personalizer/preview/v1.0/examples/Log_Delete.json @@ -0,0 +1,14 @@ +{ + "parameters": { + "Ocp-Apim-Subscription-Key": "{API key}", + "Endpoint": "{Endpoint}" + }, + "responses": { + "204": { + "body": "", + "header": { + + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/Personalizer/preview/v1.0/examples/Log_GetProperties.json b/specification/cognitiveservices/data-plane/Personalizer/preview/v1.0/examples/Log_GetProperties.json new file mode 100644 index 000000000000..ea88ec0bdea4 --- /dev/null +++ b/specification/cognitiveservices/data-plane/Personalizer/preview/v1.0/examples/Log_GetProperties.json @@ -0,0 +1,19 @@ +{ + "parameters": { + "Ocp-Apim-Subscription-Key": "{API key}", + "Endpoint": "{Endpoint}" + }, + "responses": { + "200": { + "body": { + "dateRange": { + "from": "2019-01-18T16:00:00-08:00", + "to": "2019-02-18T16:00:00-08:00" + } + }, + "header": { + + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/Personalizer/preview/v1.0/examples/Model_Delete.json b/specification/cognitiveservices/data-plane/Personalizer/preview/v1.0/examples/Model_Delete.json new file mode 100644 index 000000000000..62e3f0e62214 --- /dev/null +++ b/specification/cognitiveservices/data-plane/Personalizer/preview/v1.0/examples/Model_Delete.json @@ -0,0 +1,14 @@ +{ + "parameters": { + "Ocp-Apim-Subscription-Key": "{API key}", + "Endpoint": "{Endpoint}" + }, + "responses": { + "204": { + "body": "", + "header": { + + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/Personalizer/preview/v1.0/examples/Model_Get.json b/specification/cognitiveservices/data-plane/Personalizer/preview/v1.0/examples/Model_Get.json new file mode 100644 index 000000000000..532fffa97f3a --- /dev/null +++ b/specification/cognitiveservices/data-plane/Personalizer/preview/v1.0/examples/Model_Get.json @@ -0,0 +1,14 @@ +{ + "parameters": { + "Ocp-Apim-Subscription-Key": "{API key}", + "Endpoint": "{Endpoint}" + }, + "responses": { + "200": { + "body": "", + "header": { + + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/Personalizer/preview/v1.0/examples/Model_GetProperties.json b/specification/cognitiveservices/data-plane/Personalizer/preview/v1.0/examples/Model_GetProperties.json new file mode 100644 index 000000000000..a8057f27beaa --- /dev/null +++ b/specification/cognitiveservices/data-plane/Personalizer/preview/v1.0/examples/Model_GetProperties.json @@ -0,0 +1,17 @@ +{ + "parameters": { + "Ocp-Apim-Subscription-Key": "{API key}", + "Endpoint": "{Endpoint}" + }, + "responses": { + "200": { + "body": { + "creationTime": "2019-01-18T16:00:00-08:00", + "lastModifiedTime": "2019-01-18T16:00:00-08:00" + }, + "header": { + + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/Personalizer/preview/v1.0/examples/Policy_Delete.json b/specification/cognitiveservices/data-plane/Personalizer/preview/v1.0/examples/Policy_Delete.json new file mode 100644 index 000000000000..ea4545bf012a --- /dev/null +++ b/specification/cognitiveservices/data-plane/Personalizer/preview/v1.0/examples/Policy_Delete.json @@ -0,0 +1,17 @@ +{ + "parameters": { + "Ocp-Apim-Subscription-Key": "{API key}", + "Endpoint": "{Endpoint}" + }, + "responses": { + "200": { + "body": { + "name": "myPersonalizer", + "arguments": "--cb_explore_adf --epsilon 0.2 --dsjson --cb_type ips -l 0.5 --l1 1E-07 --power_t 0.5" + }, + "header": { + + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/Personalizer/preview/v1.0/examples/Policy_Get.json b/specification/cognitiveservices/data-plane/Personalizer/preview/v1.0/examples/Policy_Get.json new file mode 100644 index 000000000000..ea4545bf012a --- /dev/null +++ b/specification/cognitiveservices/data-plane/Personalizer/preview/v1.0/examples/Policy_Get.json @@ -0,0 +1,17 @@ +{ + "parameters": { + "Ocp-Apim-Subscription-Key": "{API key}", + "Endpoint": "{Endpoint}" + }, + "responses": { + "200": { + "body": { + "name": "myPersonalizer", + "arguments": "--cb_explore_adf --epsilon 0.2 --dsjson --cb_type ips -l 0.5 --l1 1E-07 --power_t 0.5" + }, + "header": { + + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/Personalizer/preview/v1.0/examples/Policy_Update.json b/specification/cognitiveservices/data-plane/Personalizer/preview/v1.0/examples/Policy_Update.json new file mode 100644 index 000000000000..75f8f8e37779 --- /dev/null +++ b/specification/cognitiveservices/data-plane/Personalizer/preview/v1.0/examples/Policy_Update.json @@ -0,0 +1,21 @@ +{ + "parameters": { + "Endpoint": "{Endpoint}", + "policy": { + "name": "myPersonalizer", + "arguments": "--cb_explore_adf --epsilon 0.2 --dsjson --cb_type ips -l 0.5 --l1 1E-07 --power_t 0.5" + }, + "Ocp-Apim-Subscription-Key": "{API key}" + }, + "responses": { + "200": { + "body": { + "name": "myPersonalizer", + "arguments": "--cb_explore_adf --epsilon 0.2 --dsjson --cb_type ips -l 0.5 --l1 1E-07 --power_t 0.5" + }, + "header": { + + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/Personalizer/preview/v1.0/examples/ServiceConfiguration_Get.json b/specification/cognitiveservices/data-plane/Personalizer/preview/v1.0/examples/ServiceConfiguration_Get.json new file mode 100644 index 000000000000..d0ebdc317b91 --- /dev/null +++ b/specification/cognitiveservices/data-plane/Personalizer/preview/v1.0/examples/ServiceConfiguration_Get.json @@ -0,0 +1,21 @@ +{ + "parameters": { + "Ocp-Apim-Subscription-Key": "{API key}", + "Endpoint": "{Endpoint}" + }, + "responses": { + "200": { + "body": { + "rewardWaitTime": "00:10:00", + "defaultReward": 0.0, + "rewardAggregation": "earliest", + "explorationPercentage": 0.2, + "modelExportFrequency": "00:05:00", + "logRetentionDays": 7 + }, + "header": { + + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/Personalizer/preview/v1.0/examples/ServiceConfiguration_Update.json b/specification/cognitiveservices/data-plane/Personalizer/preview/v1.0/examples/ServiceConfiguration_Update.json new file mode 100644 index 000000000000..2208aeaa7269 --- /dev/null +++ b/specification/cognitiveservices/data-plane/Personalizer/preview/v1.0/examples/ServiceConfiguration_Update.json @@ -0,0 +1,29 @@ +{ + "parameters": { + "config": { + "rewardWaitTime": "00:10:00", + "defaultReward": 0.0, + "rewardAggregation": "earliest", + "explorationPercentage": 0.2, + "modelExportFrequency": "00:05:00", + "logRetentionDays": 7 + }, + "Endpoint": "{Endpoint}", + "Ocp-Apim-Subscription-Key": "{API key}" + }, + "responses": { + "200": { + "body": { + "rewardWaitTime": "00:10:00", + "defaultReward": 0.0, + "rewardAggregation": "earliest", + "explorationPercentage": 0.2, + "modelExportFrequency": "00:05:00", + "logRetentionDays": 7 + }, + "header": { + + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/Personalizer/readme.md b/specification/cognitiveservices/data-plane/Personalizer/readme.md new file mode 100644 index 000000000000..b8ebd0947eca --- /dev/null +++ b/specification/cognitiveservices/data-plane/Personalizer/readme.md @@ -0,0 +1,52 @@ +# Cognitive Services Personalizer SDK + +> see https://aka.ms/autorest + +Configuration for generating Personalizer SDK. + +The current release is `release_1_0`. + +``` yaml +tag: release_1_0 +add-credentials: true +openapi-type: data-plane +``` +# Releases + +### Release 1.0 +These settings apply only when `--tag=release_1_0` is specified on the command line. + +``` yaml $(tag) == 'release_1_0' +input-file: + - preview/v1.0/Personalizer.json +``` + +## Swagger to SDK + +This section describes what SDK should be generated by the automatic system. +This is not used by Autorest itself. + +``` yaml $(swagger-to-sdk) +swagger-to-sdk: + - repo: azure-sdk-for-python + - repo: azure-sdk-for-java + - repo: azure-sdk-for-go + - repo: azure-sdk-for-js + - repo: azure-sdk-for-node + - repo: azure-sdk-for-ruby + after_scripts: + - bundle install && rake arm:regen_all_profiles['azure_cognitiveservices_personalizer'] +``` + + +## CSharp Settings +These settings apply only when `--csharp` is specified on the command line. +``` yaml $(csharp) +csharp: + sync-methods: None + license-header: MICROSOFT_MIT_NO_VERSION + azure-arm: false + namespace: Microsoft.Azure.CognitiveServices.Personalizer + output-folder: $(csharp-sdks-folder)/CognitiveServices/dataPlane/Personalizer/Generated + clear-output-folder: true +``` \ No newline at end of file