Skip to content

Create Prompt

bedrockagent_create_prompt R Documentation

Creates a prompt in your prompt library that you can add to a flow

Description

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.

Usage

bedrockagent_create_prompt(name, description, customerEncryptionKeyArn,
  defaultVariant, variants, clientToken, tags)

Arguments

name

[required] A name for the prompt.

description

A description for the prompt.

customerEncryptionKeyArn

The Amazon Resource Name (ARN) of the KMS key to encrypt the prompt.

defaultVariant

The name of the default variant for the prompt. This value must match the name field in the relevant PromptVariant object.

variants

A list of objects, each containing details about a variant of the prompt.

clientToken

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.

tags

Any tags that you want to attach to the prompt. For more information, see Tagging resources in Amazon Bedrock.

Value

A list with the following syntax:

list(
  name = "string",
  description = "string",
  customerEncryptionKeyArn = "string",
  defaultVariant = "string",
  variants = list(
    list(
      name = "string",
      templateType = "TEXT"|"CHAT",
      templateConfiguration = list(
        text = list(
          text = "string",
          cachePoint = list(
            type = "default"
          ),
          inputVariables = list(
            list(
              name = "string"
            )
          )
        ),
        chat = list(
          messages = list(
            list(
              role = "user"|"assistant",
              content = list(
                list(
                  text = "string",
                  cachePoint = list(
                    type = "default"
                  )
                )
              )
            )
          ),
          system = list(
            list(
              text = "string",
              cachePoint = list(
                type = "default"
              )
            )
          ),
          inputVariables = list(
            list(
              name = "string"
            )
          ),
          toolConfiguration = list(
            tools = list(
              list(
                toolSpec = list(
                  name = "string",
                  description = "string",
                  inputSchema = list(
                    json = list()
                  ),
                  strict = TRUE|FALSE
                ),
                cachePoint = list(
                  type = "default"
                )
              )
            ),
            toolChoice = list(
              auto = list(),
              any = list(),
              tool = list(
                name = "string"
              )
            )
          )
        )
      ),
      modelId = "string",
      inferenceConfiguration = list(
        text = list(
          temperature = 123.0,
          topP = 123.0,
          maxTokens = 123,
          stopSequences = list(
            "string"
          )
        )
      ),
      metadata = list(
        list(
          key = "string",
          value = "string"
        )
      ),
      additionalModelRequestFields = list(),
      genAiResource = list(
        agent = list(
          agentIdentifier = "string"
        )
      )
    )
  ),
  id = "string",
  arn = "string",
  version = "string",
  createdAt = as.POSIXct(
    "2015-01-01"
  ),
  updatedAt = as.POSIXct(
    "2015-01-01"
  )
)

Request syntax

svc$create_prompt(
  name = "string",
  description = "string",
  customerEncryptionKeyArn = "string",
  defaultVariant = "string",
  variants = list(
    list(
      name = "string",
      templateType = "TEXT"|"CHAT",
      templateConfiguration = list(
        text = list(
          text = "string",
          cachePoint = list(
            type = "default"
          ),
          inputVariables = list(
            list(
              name = "string"
            )
          )
        ),
        chat = list(
          messages = list(
            list(
              role = "user"|"assistant",
              content = list(
                list(
                  text = "string",
                  cachePoint = list(
                    type = "default"
                  )
                )
              )
            )
          ),
          system = list(
            list(
              text = "string",
              cachePoint = list(
                type = "default"
              )
            )
          ),
          inputVariables = list(
            list(
              name = "string"
            )
          ),
          toolConfiguration = list(
            tools = list(
              list(
                toolSpec = list(
                  name = "string",
                  description = "string",
                  inputSchema = list(
                    json = list()
                  ),
                  strict = TRUE|FALSE
                ),
                cachePoint = list(
                  type = "default"
                )
              )
            ),
            toolChoice = list(
              auto = list(),
              any = list(),
              tool = list(
                name = "string"
              )
            )
          )
        )
      ),
      modelId = "string",
      inferenceConfiguration = list(
        text = list(
          temperature = 123.0,
          topP = 123.0,
          maxTokens = 123,
          stopSequences = list(
            "string"
          )
        )
      ),
      metadata = list(
        list(
          key = "string",
          value = "string"
        )
      ),
      additionalModelRequestFields = list(),
      genAiResource = list(
        agent = list(
          agentIdentifier = "string"
        )
      )
    )
  ),
  clientToken = "string",
  tags = list(
    "string"
  )
)