Cortex Click makes it easy to create high quality blog posts, tutorials, developer documentation, and SEO-optimized landing pages.
With the SDK you can do all of this programmatically.
Content created programmatically can be viewed and refined from the app. Working with an SEO
firm usually involves getting a spreadsheet of keywords or blog post titles every month.
The SDK can speed up the process of turning these monthly goals into drafts, which can be further refined and manually edited prior to publishing.
Generate content
The Cortex class exposes convenient methods for starting a streaming or synchornous content generation:
Streaming
To stream content generation responses, set the stream parameter to true:
Synchronous
Refine content
Content can also be refined programmatically. This can be useful for making bulk edits across your entire content base,
for example rebranding campaigns or refreshing blog post links after a major product release.
Streaming
To stream content refinement responses, set the stream parameter to true:
Synchronous
Edit content
Programmatically edit the title or contents of a piece of content:
Get content
Retrieve a piece of content by id:
Versioning
All content is versioned. Each generation, refinement, and edit creates a new content version.
Get by version
The getContent method returns the latest version by default.
Retrieve a specific version by setting the optional version parameter:
Revert to a previous version
Content can be reverted to a previous version.
Mechanically, this is done by creating a new version and rolling forward so that the entire content version history is maintained:
List content
Basic usage
Filter by user
Filter content by the user that created it. The userEmail field corresponds to the email address associated with the user's Cortex Click account:
Filter by review status
Filtering content by review status is useful for automated publication workflows, such as rendering markdown files to a directory as a part of a build step.
Filter by cortex
Filter all content created by a particular cortex:
[Status & publishing]
Content has a status field to keep track of stages of the review workflow: DRAFT, IN_REVIEW, APPROVED, PUBLISHED.
Content is automatically created in DRAFT status, and the status can be edited via the app or the SDK:
The publication guide has more details about programmatic publishing workflows with the SDK.