wx-ai prompt-session create
Creates a prompt session.
Syntax
cpdctl wx-ai prompt-session create \
--lock-lock-type LOCK-LOCK-TYPE \
--name NAME \
[--cpd-scope CPD-SCOPE] \
[--created-at CREATED-AT] \
[--created-by CREATED-BY] \
[--description DESCRIPTION] \
[--id ID] \
[--last-updated-at LAST-UPDATED-AT] \
[--last-updated-by LAST-UPDATED-BY] \
[--lock LOCK | --lock-locked LOCK-LOCKED] \
[--lock-locked-by LOCK-LOCKED-BY] \
[--project-id PROJECT-ID] \
[--prompts PROMPTS]
Options
| Option | Description |
|---|---|
--cpd-scope (string) |
The IBM Software Hub space,
project, or catalog scope. For example,
cpd://default-context/spaces/7bccdda4-9752-4f37-868e-891de6c48135.
|
--created-at (int64) |
The time that the session was created. |
--created-by (string) |
The ID of the original session creator. The value must match the regular expression |
--description (string) |
An optional description for the prompt session. The value must match the regular expression |
--id (string) |
The prompt session's ID. This value cannot be set. It is returned in responses only. The value must match the regular expression |
--last-updated-at (int64) |
The time that the session was updated. |
--last-updated-by (string) |
The ID of the last user that modifed the session. The value must match the regular expression |
--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 JSON option 'lock'. 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 JSON option 'lock'. It is mutually exclusive with that option. The value must match the regular expression |
--lock-lock-type (string) |
Lock type. Use edit' for working on prompts or templates or 'governance'. This option can be
supplied only in Allowable values are |
--name (string) |
The name used to display the prompt session. 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 |
--prompts |
The maximum length is Provide a JSON string option or specify a JSON file to read from by providing a file path option
that begins with a |
Examples
cpdctl wx-ai prompt-session create \
--name 'Session 1' \
--id 1c29d9a1-9ba6-422d-aa39-517b26adc147 \
--description 'My First Prompt Session' \
--created-at 1711504485261 \
--created-by IBMid-000000YYY0 \
--last-updated-at 1711504485261 \
--last-updated-by IBMid-000000YYY0 \
--lock '{"locked": true, "lock_type": "edit", "locked_by": "IBMid-000000YYY0"}' \
--prompts '[{"id": "1c29d9a1-9ba6-422d-aa39-517b26adc147", "name": "My Prompt", "description": "My First Prompt", "prompt_variables": {}, "is_template": true, "created_at": 1711504485261, "input_mode": "structured", "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}]}}]' \
--project-id exampleString
Alternatively, granular options are available for the sub-fields of JSON string options:
cpdctl wx-ai prompt-session create \
--name 'Session 1' \
--id 1c29d9a1-9ba6-422d-aa39-517b26adc147 \
--description 'My First Prompt Session' \
--created-at 1711504485261 \
--created-by IBMid-000000YYY0 \
--last-updated-at 1711504485261 \
--last-updated-by IBMid-000000YYY0 \
--prompts '[wxPromptSessionEntry]' \
--project-id exampleString \
--lock-locked true \
--lock-lock-type edit \
--lock-locked-by IBMid-000000YYY0