create_prompt¶
Operation¶
create_prompt
async
¶
create_prompt(input: CreatePromptInput, plugins: list[Plugin] | None = None) -> CreatePromptOutput
Creates a prompt in your prompt library that you can add to a flow. For more information, see Prompt management in Amazon Bedrock, Create a prompt using Prompt management and Prompt flows in Amazon Bedrock in the Amazon Bedrock User Guide.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input
|
CreatePromptInput
|
An instance of |
required |
plugins
|
list[Plugin] | None
|
A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations. |
None
|
Returns:
| Type | Description |
|---|---|
CreatePromptOutput
|
An instance of |
Input¶
CreatePromptInput
dataclass
¶
Dataclass for CreatePromptInput structure.
Attributes¶
client_token
class-attribute
instance-attribute
¶
client_token: str | None = None
A unique, case-sensitive identifier to ensure that the API request completes no more than one time. If this token matches a previous request, Amazon Bedrock ignores the request, but does not return an error. For more information, see Ensuring idempotency.
customer_encryption_key_arn
class-attribute
instance-attribute
¶
customer_encryption_key_arn: str | None = None
The Amazon Resource Name (ARN) of the KMS key to encrypt the prompt.
default_variant
class-attribute
instance-attribute
¶
default_variant: str | None = None
The name of the default variant for the prompt. This value must match
the name field in the relevant
PromptVariant
object.
description
class-attribute
instance-attribute
¶
description: str | None = None
A description for the prompt.
tags
class-attribute
instance-attribute
¶
tags: dict[str, str] | None = None
Any tags that you want to attach to the prompt. For more information, see Tagging resources in Amazon Bedrock.
variants
class-attribute
instance-attribute
¶
variants: list[PromptVariant] | None = field(repr=False, default=None)
A list of objects, each containing details about a variant of the prompt.
Output¶
CreatePromptOutput
dataclass
¶
Dataclass for CreatePromptOutput structure.
Attributes¶
customer_encryption_key_arn
class-attribute
instance-attribute
¶
customer_encryption_key_arn: str | None = None
The Amazon Resource Name (ARN) of the KMS key that you encrypted the prompt with.
default_variant
class-attribute
instance-attribute
¶
default_variant: str | None = None
The name of the default variant for your prompt.
description
class-attribute
instance-attribute
¶
description: str | None = None
The description of the prompt.
variants
class-attribute
instance-attribute
¶
variants: list[PromptVariant] | None = field(repr=False, default=None)
A list of objects, each containing details about a variant of the prompt.
version
instance-attribute
¶
version: str
The version of the prompt. When you create a prompt, the version created
is the DRAFT version.