Skip to main content

Overview

The create() and acreate() methods allow you to create a new prompt in Keywords AI. A prompt serves as a container for multiple versions with different configurations. Use create() for synchronous operations and acreate() for asynchronous operations.

Usage example

Parameters

The create() and acreate() methods do not require any parameters. They create a new prompt with default values that can be updated later using the update() method.

Returns

Returns a PromptCreateResponse object containing the created prompt information:

Examples

Basic Synchronous Example

Asynchronous Example

Creating and Updating a Prompt

Creating Multiple Prompts

Convenience Functions

You can also use the convenience function to create a PromptAPI client:

Next Steps

After creating a prompt, you’ll typically want to:
  1. Update the prompt with a meaningful name and description using the update() method
  2. Create prompt versions with specific configurations using the create_version() method
  3. Deploy versions to make them available for use in your applications