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
Option | Description |
---|---|
--cpd-scope (string) |
The Cloud Pak for Data space or project scope,. For
example, |
--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 |
--input-mode (string) |
Input mode in use for the prompt. Allowable values are |
--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 |
--lock-locked (Boolean) |
True if the prompt is locked. This option provides a value for a sub-field of the
|
--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 The value must match the regular expression |
--lock-lock-type (string) |
Lock type. Use Allowable values are |
--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 |
--model-version-description (string) |
Description of the version. This option provides a value for a sub-field of the
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 The value must match the regular expression
|
--model-version-tag (string) |
User provided tag. This option provides a value for a sub-field of the
The value must match the regular expression |
--name (string) |
Name used to display the prompt. Required. The value must match the regular expression |
--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 |
--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 |
--prompt-chat-items |
This option provides a value for a sub-field of the Provide a JSON string option or specify a JSON file to read from by providing a file path option
that begins with a The following example shows the format of the
ChatItem
object.
|
--prompt-data
|
This option provides a value for a sub-field of the Provide a JSON string option or specify a JSON file to read from by providing a file path option
that begins with a |
--prompt-external-information |
This option provides a value for a sub-field of the Provide a JSON string option or specify a JSON file to read from by providing a file path option
that begins with a |
--prompt-input (string) |
This option provides a value for a sub-field of the 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 |
--prompt-model-id (string) |
This option provides a value for a sub-field of the The value must match the regular expression |
--prompt-model-parameters
|
This option provides a value for a sub-field of the Provide a JSON string option or specify a JSON file to read from by providing a file path option
that begins with a |
--prompt-system-prompt (string) |
This option provides a value for a sub-field of the The value must match the regular expression |
--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 |
--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 |
--task-ids (string) |
The list items must match the regular expression |
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.'