wx-ai prompt create

Creates a prompt with the provided parameters.

Syntax

cpdctl wx-ai prompt create \
[--cpd-scope CPD-SCOPE] \
[--created-at CREATED-AT] \
[--description DESCRIPTION] \
[--input-mode INPUT-MODE] \
[--lock LOCK | --lock-locked LOCK-LOCKED] \
[--lock-locked-by LOCK-LOCKED-BY] \
--lock-lock-type LOCK-LOCK-TYPE \
[--model-version MODEL-VERSION | --model-version-number MODEL-VERSION-NUMBER] \
[--model-version-description MODEL-VERSION-DESCRIPTION] \
--model-version-tag MODEL-VERSION-TAG \
--name NAME \
[--project-id PROJECT-ID] \
[--prompt PROMPT | --prompt-input PROMPT-INPUT] \
--prompt-chat-items PROMPT-CHAT-ITEMS \
--prompt-data PROMPT-DATA \
[--prompt-external-information PROMPT-EXTERNAL-INFORMATION] \
--prompt-model-id PROMPT-MODEL-ID \
--prompt-model-parameters PROMPT-MODEL-PARAMETERS \
--prompt-system-prompt PROMPT-SYSTEM-PROMPT \
[--prompt-variables PROMPT-VARIABLES] \
[--space-id SPACE-ID] \
[--task-ids TASK-IDS]

Options

Table 1: Command options
Option Description
--cpd-scope (string)

The Cloud Pak for Data space or project scope,. For example, cpd://default-profile/spaces/7bccdda4-9752-4f37-868e-891de6c48135.

--created-at (int64)

The time that the prompt was created.

--description (string)

An optional description for the prompt.

The value must match the regular expression /[a-zA-Z0-9-]*/.

--input-mode (string)

Input mode in use for the prompt.

Allowable values are structured, freeform, chat, detached.

--lock

This JSON option can instead be provided by setting individual fields with other options. It is mutually exclusive with those options.

Provide a JSON string option or specify a JSON file to read from by providing a file path option that begins with a @. For example, --lock=@path/to/file.json.

--lock-locked (Boolean)

True if the prompt is locked. This option provides a value for a sub-field of the lock JSON option. It is mutually exclusive with that option.

--lock-locked-by (string)

Locked by is computed by the server and must not be passed in. This option provides a value for a sub-field of the lock JSON option. It is mutually exclusive with that option.

The value must match the regular expression /[a-zA-Z0-9-]*/.

--lock-lock-type (string)

Lock type. Use edit for working on prompts or templates or governance. This option can be supplied only in PUT /lock requests. This option provides a value for a sub-field of the lock JSON option. It is mutually exclusive with the lock option.

Allowable values are edit, governance.

--model-version

This JSON option can instead be provided by setting individual fields with other options. It is mutually exclusive with those options.

Provide a JSON string option or specify a JSON file to read from by providing a file path option that begins with a @, for example --model-version=@path/to/file.json.

--model-version-description (string)

Description of the version. This option provides a value for a sub-field of the model-version JSON option. It is mutually exclusive with the model-version option.

The value must match the regular expression /.*/.

--model-version-number (string)

User provided version for tracking in AI Factsheets. This option provides a value for a sub-field of the model-version JSON option. It is mutually exclusive with the model-version option.

The value must match the regular expression /^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$/.

--model-version-tag (string)

User provided tag. This option provides a value for a sub-field of the model-version JSON option. It is mutually exclusive with the model-version option.

The value must match the regular expression /.*/.

--name (string)

Name used to display the prompt. Required.

The value must match the regular expression /[a-zA-Z0-9-]*/.

--project-id (string)

Required. Specifies the project ID as the target. One target must be supplied per request.

The value must match the regular expression /[a-zA-Z0-9-]*/.

--prompt

This JSON option can instead be provided by setting individual fields with other options. It is mutually exclusive with those options.

Provide a JSON string option or specify a JSON file to read from by providing a file path option that begins with a @. For example, --prompt=@path/to/file.json.

--prompt-chat-items

This option provides a value for a sub-field of the prompt JSON option. It is mutually exclusive with the prompt option.

Provide a JSON string option or specify a JSON file to read from by providing a file path option that begins with a @, for example --prompt-chat-items=@path/to/file.json.

The following example shows the format of the ChatItem object.

[ {
  "type" : "question",
  "content" : "Some text",
  "status" : "ready",
  "timestamp" : 1711504485261
} ]
--prompt-data

This option provides a value for a sub-field of the prompt JSON option. It is mutually exclusive with the prompt option.

Provide a JSON string option or specify a JSON file to read from by providing a file path option that begins with a @, for example --prompt-data=@path/to/file.json.

--prompt-external-information

This option provides a value for a sub-field of the prompt JSON option. It is mutually exclusive with the prompt option.

Provide a JSON string option or specify a JSON file to read from by providing a file path option that begins with a @, for example --prompt-external-information=@path/to/file.json.

--prompt-input (string)

This option provides a value for a sub-field of the prompt JSON option. It is mutually exclusive with that option.

The default value is [].

Provide a JSON string option or specify a JSON file to read from by providing a file path option that begins with a @, for example --prompt-input=@path/to/file.json.

--prompt-model-id (string)

This option provides a value for a sub-field of the prompt JSON option. It is mutually exclusive with that option.

The value must match the regular expression /[a-zA-Z0-9-\/\/]*/.

--prompt-model-parameters

This option provides a value for a sub-field of the prompt JSON option. It is mutually exclusive with that option.

Provide a JSON string option or specify a JSON file to read from by providing a file path option that begins with a @, for example --prompt-model-parameters=@path/to/file.json.

--prompt-system-prompt (string)

This option provides a value for a sub-field of the prompt JSON option. It is mutually exclusive with that option.

The value must match the regular expression /[a-zA-Z0-9-]*/.

--prompt-variables (string)

 

Provide a JSON string option or specify a JSON file to read from by providing a file path option that begins with a @, for example --prompt-variables=@path/to/file.json.

--space-id (string)

Required. Specifies the space ID as the target. One target must be supplied per request.

The value must match the regular expression /[a-zA-Z0-9-]*/.

--task-ids (string)

The list items must match the regular expression /[a-zA-Z0-9-]*/. The maximum length is 1 item. The minimum length is 1 item.

Examples

cpdctl wx-ai prompt create \
    --name 'My Prompt' \
    --prompt '{"input": [[],exampleString,anotherTestString],[exampleString,anotherTestString, []], "model_id": "ibm/granite-13b-chat-v2", "model_parameters": {"decoding_method": "exampleString", "max_new_tokens": 38, "min_new_tokens": 38, "random_seed": 38, "stop_sequences": ["exampleString","anotherTestString"], "temperature": 72.5, "top_k": 72.5, "top_p": 72.5, "repetition_penalty": 72.5}, "data": {"instruction": "exampleString", "input_prefix": "exampleString", "output_prefix": "exampleString", "examples": [[],exampleString,anotherTestString],[exampleString,anotherTestString, []]}, "system_prompt": "exampleString", "chat_items": [{"type": "question", "content": "Some text", "status": "ready", "timestamp": 1711504485261}], "external_information": {"external_prompt_id": "exampleString", "external_model_id": "exampleString", "external_model_provider": "exampleString", "external_prompt": {"url": "exampleString", "additional_information": [[{"key": "exampleString"}]]}, "external_model": {"name": "exampleString", "url": "exampleString"}}}' \
    --description 'My First Prompt' \
    --created-at 1711504485261 \
    --task-ids exampleString,anotherTestString \
    --lock '{"locked": true, "lock_type": "edit", "locked_by": "IBMid-000000YYY0"}' \
    --model-version '{"number": "2.0.0-rc.7", "tag": "tag", "description": "Description of the model version."}' \
    --prompt-variables '{}' \
    --input-mode structured \
    --project-id exampleString \
    --space-id exampleString

Alternatively, granular options are available for the sub-fields of JSON string options:

cpdctl wx-ai prompt create \
    --name 'My Prompt' \
    --description 'My First Prompt' \
    --created-at 1711504485261 \
    --task-ids exampleString,anotherTestString \
    --prompt-variables '{}' \
    --input-mode structured \
    --project-id exampleString \
    --space-id exampleString \
    --prompt-input '[[],exampleString,anotherTestString],[exampleString,anotherTestString, []]' \
    --prompt-model-id ibm/granite-13b-chat-v2 \
    --prompt-model-parameters promptWithExternalModelParameters \
    --prompt-data promptData \
    --prompt-system-prompt exampleString \
    --prompt-chat-items '[chatItem]' \
    --prompt-external-information externalInformation \
    --lock-locked true \
    --lock-lock-type edit \
    --lock-locked-by IBMid-000000YYY0 \
    --model-version-number 2.0.0-rc.7 \
    --model-version-tag tag \
    --model-version-description 'Description of the model version.'