Skip to content

Commit 6b0ff45

Browse files
authored
Update prompt-registry based on use_additional_property (#374)
1 parent 248b049 commit 6b0ff45

File tree

2 files changed

+21
-14
lines changed

2 files changed

+21
-14
lines changed

prompt-registry/src/main/java/com/sap/ai/sdk/prompt/registry/model/PromptTemplateSpec.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ public void setDefaults(@Nullable final Object defaults) {
134134
* Set the additionalFields of this {@link PromptTemplateSpec} instance and return the same
135135
* instance.
136136
*
137-
* @param additionalFields The additionalFields of this {@link PromptTemplateSpec}
137+
* @param additionalFields DEPRECATED. Please use additional_fields instead.
138138
* @return The same instance of this {@link PromptTemplateSpec} class
139139
*/
140140
@Nonnull
@@ -144,10 +144,12 @@ public PromptTemplateSpec additionalFields(@Nullable final Object additionalFiel
144144
}
145145

146146
/**
147-
* Get additionalFields
147+
* DEPRECATED. Please use additional_fields instead.
148148
*
149149
* @return additionalFields The additionalFields of this {@link PromptTemplateSpec} instance.
150+
* @deprecated
150151
*/
152+
@Deprecated
151153
@Nonnull
152154
public Object getAdditionalFields() {
153155
return additionalFields;
@@ -156,7 +158,7 @@ public Object getAdditionalFields() {
156158
/**
157159
* Set the additionalFields of this {@link PromptTemplateSpec} instance.
158160
*
159-
* @param additionalFields The additionalFields of this {@link PromptTemplateSpec}
161+
* @param additionalFields DEPRECATED. Please use additional_fields instead.
160162
*/
161163
public void setAdditionalFields(@Nullable final Object additionalFields) {
162164
this.additionalFields = additionalFields;

prompt-registry/src/main/resources/spec/prompt-registry.yaml

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ paths:
2929
example: "Service Unavailable"
3030
/internal/promptTemplates/provisioning:
3131
parameters:
32-
- in: header
33-
name: AI-Main-Tenant
34-
required: true
35-
schema:
36-
type: string
37-
description: The main tenant name
32+
- in: header
33+
name: AI-Main-Tenant
34+
required: true
35+
schema:
36+
type: string
37+
description: The main tenant name
3838
post:
3939
operationId: registry.controller.prompt_controller.onboard_tenant
4040
responses:
@@ -369,7 +369,7 @@ components:
369369
properties:
370370
type:
371371
type: string
372-
enum: [ "text" ]
372+
enum: ["text"]
373373
text:
374374
type: string
375375
ImageContent:
@@ -380,7 +380,7 @@ components:
380380
properties:
381381
type:
382382
type: string
383-
enum: [ "image_url" ]
383+
enum: ["image_url"]
384384
image_url:
385385
type: object
386386
required:
@@ -396,6 +396,8 @@ components:
396396
type: object
397397
required:
398398
- template
399+
additionalProperties:
400+
type: object
399401
properties:
400402
template:
401403
type: array
@@ -405,6 +407,9 @@ components:
405407
type: object
406408
additionalFields:
407409
type: object
410+
description: >
411+
DEPRECATED. Please use additional_fields instead.
412+
deprecated: true
408413
response_format:
409414
description: >
410415
Response format that the model output should adhere to.
@@ -422,7 +427,7 @@ components:
422427
This is the same as the OpenAI definition.
423428
items:
424429
$ref: "#/components/schemas/ChatCompletionTool"
425-
430+
426431
# below ReponseFormats are copied from openapi spec: https://github.com/openai/openai-openapi/blob/e0cb2d721753e13e69e918465795d6e9f87ab15a/openapi.yaml#L12286
427432
ResponseFormatText:
428433
type: object
@@ -549,7 +554,7 @@ components:
549554
documentation about the format.
550555
Omitting `parameters` defines a function with an empty parameter list.
551556
additionalProperties: true
552-
557+
553558
PromptTemplatePostRequest:
554559
type: object
555560
required:
@@ -695,4 +700,4 @@ components:
695700
content:
696701
application/json:
697702
schema:
698-
$ref: "#/components/schemas/ErrorResponse"
703+
$ref: "#/components/schemas/ErrorResponse"

0 commit comments

Comments
 (0)