You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: openapi.yaml
+25Lines changed: 25 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1070,6 +1070,12 @@ paths:
1070
1070
1071
1071
put:
1072
1072
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.
1073
1079
operationId: updatePrompt
1074
1080
tags:
1075
1081
- Prompts
@@ -1088,35 +1094,49 @@ paths:
1088
1094
schema:
1089
1095
type: object
1090
1096
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.
1091
1101
name:
1092
1102
type: string
1093
1103
collection_id:
1094
1104
type: string
1095
1105
string:
1096
1106
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.
1097
1108
parameters:
1098
1109
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.
1099
1111
model:
1100
1112
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.
1101
1114
virtual_key:
1102
1115
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.
1103
1117
version_description:
1104
1118
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.
1105
1120
functions:
1106
1121
type: array
1107
1122
items:
1108
1123
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.
1109
1125
tools:
1110
1126
type: array
1111
1127
items:
1112
1128
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.
1113
1130
tool_choice:
1114
1131
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.
1115
1133
is_raw_template:
1116
1134
type: integer
1117
1135
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.
1118
1137
prompt_metadata:
1119
1138
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.
1120
1140
responses:
1121
1141
'200':
1122
1142
description: Prompt updated successfully
@@ -1252,6 +1272,10 @@ paths:
1252
1272
1253
1273
put:
1254
1274
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.
0 commit comments