Skip to content

Commit 2275bda

Browse files
authored
Merge pull request #125 from Portkey-AI/chore/prompt-patch-flag
chore: document behvaiour of prompt patch and updates
2 parents 1618f6b + 1cf8541 commit 2275bda

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

openapi.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1070,6 +1070,12 @@ paths:
10701070

10711071
put:
10721072
summary: Update a prompt
1073+
description: |
1074+
Update a prompt's metadata and/or create a new version with updated template content.
1075+
1076+
**Partial version updates:** Set `patch: true` to perform a partial update of version fields (`string`, `parameters`, `model`, `virtual_key`, `version_description`, `functions`, `tools`, `tool_choice`, `is_raw_template`, `prompt_metadata`). When enabled, any version fields omitted from the request are backfilled from the current latest version, allowing you to update only the fields you need. When `patch` is omitted or `false`, all version fields must be provided together (original strict validation).
1077+
1078+
**Metadata-only updates:** Fields like `name`, `collection_id`, `version_description`, and `virtual_key` can always be updated independently without affecting versioning.
10731079
operationId: updatePrompt
10741080
tags:
10751081
- Prompts
@@ -1088,35 +1094,49 @@ paths:
10881094
schema:
10891095
type: object
10901096
properties:
1097+
patch:
1098+
type: boolean
1099+
description: |
1100+
When `true`, enables partial version updates. Missing version fields (`string`, `parameters`, `model`) are backfilled from the current latest version, so you only need to provide the fields you want to change. When `false` or omitted, the original strict validation is preserved for backward compatibility.
10911101
name:
10921102
type: string
10931103
collection_id:
10941104
type: string
10951105
string:
10961106
type: string
1107+
description: The prompt template string. When `patch` is `true`, this field is optional and will be inherited from the current latest version if omitted.
10971108
parameters:
10981109
type: object
1110+
description: Model parameters (e.g. temperature, max_tokens). When `patch` is `true`, this field is optional and will be inherited from the current latest version if omitted.
10991111
model:
11001112
type: string
1113+
description: The model identifier. When `patch` is `true`, this field is optional and will be inherited from the current latest version if omitted.
11011114
virtual_key:
11021115
type: string
1116+
description: The virtual key to associate with this version. When `patch` is `true`, this field is optional and will be inherited from the current latest version if omitted.
11031117
version_description:
11041118
type: string
1119+
description: A human-readable description for this version. When `patch` is `true`, this field is optional and will be inherited from the current latest version if omitted.
11051120
functions:
11061121
type: array
11071122
items:
11081123
type: object
1124+
description: Function definitions available to the model. When `patch` is `true`, this field is optional and will be inherited from the current latest version if omitted.
11091125
tools:
11101126
type: array
11111127
items:
11121128
type: object
1129+
description: Tool definitions available to the model. When `patch` is `true`, this field is optional and will be inherited from the current latest version if omitted.
11131130
tool_choice:
11141131
type: object
1132+
description: Controls which tool the model uses. When `patch` is `true`, this field is optional and will be inherited from the current latest version if omitted.
11151133
is_raw_template:
11161134
type: integer
11171135
enum: [0, 1]
1136+
description: Whether the template string is raw (1) or processed (0). When `patch` is `true`, this field is optional and will be inherited from the current latest version if omitted.
11181137
prompt_metadata:
11191138
type: object
1139+
description: Additional metadata for the prompt version. When `patch` is `true`, this field is optional and will be inherited from the current latest version if omitted.
11201140
responses:
11211141
'200':
11221142
description: Prompt updated successfully
@@ -1252,6 +1272,10 @@ paths:
12521272

12531273
put:
12541274
summary: Update a specific version of a prompt
1275+
description: |
1276+
Updates metadata for a specific prompt version. **This endpoint only supports updating the `label_id` field.**
1277+
1278+
Prompt versions are immutable — their `string`, `parameters`, and `model` content cannot be changed after creation. To update prompt content, use `PUT /prompts/{promptId}` which creates a new version with the updated content.
12551279
operationId: updatePromptVersion
12561280
tags:
12571281
- Prompts
@@ -1279,6 +1303,7 @@ paths:
12791303
label_id:
12801304
type: string
12811305
format: uuid
1306+
description: The label to assign to this version.
12821307
responses:
12831308
'200':
12841309
description: Prompt version updated successfully

0 commit comments

Comments
 (0)