Providing AI-generated content
A cognitive content service exposes an interface for providing artificial intelligence (“AI”)-generated content based on content templates that define when and how AI-generated content is to be generated. Requests made to the API for AI-generated content identify a content template. The cognitive content service determines, based on the identified content template, whether the requested AI-generated content is to be newly generated or whether previously generated AI-generated content is to be returned in response to the request. If the requested AI-generated content is to be newly generated, the cognitive content service transmits a request to a content generation service to generate the AI-generated content based on the content template. The content generation service generates the requested content based on the content template. The cognitive content service stores the AI-generated content and generates a response to the request for the AI-generated content.
1 . A computer-implemented method, comprising:
exposing a network services application programming interface (API);
receiving a request for artificial intelligence (AI)-generated content at the network services API, the request comprising an identifier for a content template generated prior to the request, wherein the content template comprises structured data indicating a cognition type and a refresh policy;
retrieving the content template identified by the request from a data store comprising multiple different content templates, wherein the multiple different content templates include at least one content template specifying cold cognition, at least one content template specifying warm cognition, and at least one content template specifying hot cognition;
determining, based on the cognition type indicated in the content template, whether new AI-generated content is to be generated or whether previously generated AI-generated content is to be returned in response to the request, wherein the cognition type is one of:
cold cognition specifying that the previously generated AI-generated content is to be returned,
warm cognition specifying that a determination of whether to generate the new AI-generated content is based upon the refresh policy, or
hot cognition indicating that the new AI-generated content is to be generated;
responsive to determining that the new AI-generated content is to be generated, causing a content generation service to generate the new AI-generated content based on the content template; and
returning a response to the request comprising an identifier for the new AI-generated content.
2 . The computer-implemented method of claim 1 , wherein the cognition type is hot cognition and new AI-generated content is to be generated.
3 . The computer-implemented method of claim 1 , wherein the cognition type is warm cognition, and the refresh policy specifies the amount of time after which the new AI-generated content is to be generated in response to a request.
4 . The computer-implemented method of claim 1 , wherein the content template includes one or more default parameters for use by the content generation service in generating the new AI-generated content, wherein the request for the AI-generated content comprises one or more parameters, and wherein the parameters in the request for the AI-generated content are used to generate the new AI-generated content instead of the one or more default parameters.
5 . The computer-implemented method of claim 1 , wherein the content template comprises structured data indicating the content generating service to be used to generate the new AI-generated content and further comprising:
responsive to determining that the new AI-generated content is to be generated, selecting the content generation service from a plurality of content generation services based on the content template.
6 . The computer-implemented method of claim 1 , wherein the response to the request further comprises data identifying one or more components utilized by the content generation service to generate the new AI-generated content.
7 . The computer-implemented method of claim 6 , wherein the data identifying the one or more components utilized by the content generation service to generate the new AI-generated content comprises one or more of data identifying a model utilized to generate the new AI-generated content, data identifying a version of the model, data describing a training history of the model, or data identifying infrastructure utilized to execute the model.
8 . A computer-readable storage medium having computer-executable instructions stored thereupon which, when executed by a processing system, cause the processing system to:
receive a request for artificial intelligence (AI)-generated content, the request identifying a content template generated prior to the request, wherein the content template comprises structured data indicating a cognition type and a refresh policy;
retrieve the content template identified by the request from a data store comprising multiple different content templates, wherein the multiple different content templates include at least one content template specifying cold cognition, at least one content template specifying warm cognition, and at least one content template specifying hot cognition;
determine, based on the cognition type indicated in the content template, whether new AI-generated content is to be generated or whether previously generated AI-generated content is to be returned in response to the request, wherein the cognition type is one of:
cold cognition specifying that the previously generated AI-generated content is to be returned,
warm cognition specifying that a determination of whether to generate the new AI-generated content is based upon the refresh policy, or
hot cognition indicating that the new AI-generated content is to be generated;
responsive to determining that the new AI-generated content is to be generated, cause a content generation service to generate the new AI-generated content based on the content template; and
return a response to the request, the response comprising an identifier for the new AI-generated content.
9 . The computer-readable storage medium of claim 8 , wherein the cognition type is warm cognition, the refresh policy specifies the amount of time after which the new AI-generated content is to be generated in response to a request.
10 . The computer-readable storage medium of claim 8 , wherein the content template includes one or more default parameters for use by the content generation service in generating the new AI-generated content, wherein the request for the AI-generated content comprises one or more parameters, and wherein the parameters in the request for the AI-generated content are used to generate the new AI-generated content instead of the one or more default parameters.
11 . The computer-readable storage medium of claim 8 , wherein the content template comprises structured data indicating the content generating service to be used to generate the new AI-generated content and having further computer-executable instructions stored thereupon to select the content generation service from a plurality of content generation services based on the content template.
12 . The computer-readable storage medium of claim 8 , wherein the response to the request further comprises data identifying one or more components utilized by the content generation service to generate the new AI-generated content.
13 . The computer-readable storage medium of claim 12 , wherein the data identifying the one or more components utilized by the content generation service to generate the new AI-generated content comprises one or more of data identifying a model utilized to generate the new AI-generated content, data identifying a version of the model, data describing a training history of the model, or data identifying infrastructure utilized to execute the model.
14 . The computer-readable storage medium of claim 8 , wherein the cognition type is warm cognition, the refresh policy specifying a number of requests for AI-generated content after which the new AI-generated content is to be generated in response to a request.
15 . A processing system, comprising:
a processor; and
a computer-readable storage medium having computer-executable instructions stored thereupon that, when executed by the processing system, cause the processing system to:
receive a request for artificial intelligence (AI)-generated content, the request identifying a content template generated prior to the request, wherein the content template comprises structured data indicating a cognition type and a refresh policy;
retrieve the content template identified by the request from a data store comprising multiple different content templates, wherein the multiple different content templates include at least one content template specifying cold cognition, at least one content template specifying warm cognition, and at least one content template specifying hot cognition;
determine, based on the cognition type indicated in the content template, whether new AI-generated content is to be generated or whether previously generated AI-generated content is to be returned in response to the request, wherein the cognition type is one of:
cold cognition specifying that the previously generated AI-generated content is to be returned,
warm cognition specifying that a determination of whether to generate the new AI-generated content is based upon the refresh policy, or
hot cognition indicating that the new AI-generated content is to be generated;
responsive to determining that the new AI-generated content is to be generated, cause a content generation service to generate the new AI-generated content based on the content template; and
return a response to the request, the response comprising an identifier for the new AI-generated content.
16 . The processing system of claim 15 , wherein the cognition type is warm cognition, the refresh policy specifies the amount of time after which the new AI-generated content is to be generated in response to a request.
17 . The processing system of claim 15 , wherein parameters defined by the request for the AI-generated content are used to generate the new AI-generated content in place of one or more default parameters in the content template.
18 . The processing system of claim 15 , wherein the content generation service is selected from a plurality of content generation services based on the content template.
19 . The processing system of claim 15 , wherein the response further comprises one or more of data identifying a model utilized to generate the new AI-generated content, data identifying a version of the model, data describing a training history of the model, and data identifying infrastructure components utilized to execute the model.
20 . The processing system of claim 15 , wherein the cognition type is warm cognition, the refresh policy specifying a number of requests for AI-generated content after which the new AI-generated content is to be generated in response to a request.