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

Table 1: Command 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.
Status
Optional.
Syntax
--cpd-scope=<cpd-scope>
Input type
string
Default value
No default.
--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 /[a-zA-Z0-9-]*/.

--description (string)

An optional description for the prompt session.

The value must match the regular expression /^[\\s\\S]{0,250}/.

--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 /[a-zA-Z0-9-]{32}/.

--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 /[a-zA-Z0-9-]*/.

--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 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 /[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 JSON option 'lock'. It is mutually exclusive with that option.

Allowable values are edit, governance.

--name (string)

The name used to display the prompt session. Required.

The value must match the regular expression /^.{0,100}$/.

--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-]*/.

--prompts

 

The maximum length is 50 items. The minimum length is 0 items.

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 --prompts=@path/to/file.json.

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