Skip to content

Commit 07be739

Browse files
Update error-handling-7597e89.md
1 parent 2b7e5f2 commit 07be739

File tree

1 file changed

+34
-27
lines changed

1 file changed

+34
-27
lines changed

docs/sap-ai-core/error-handling-7597e89.md

Lines changed: 34 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,47 +2,54 @@
22

33
# Error Handling
44

5-
If an error occurs, the response will contain an error code and message. The following example shows a request that is missing a parameter in the templating module configuration.
5+
If an error occurs, the response will contain an error code and message. The following example shows a request that is missing placeholder values in the `prompt_templating` module.
6+
7+
> Note: This request payload uses the v2 endpoint
68
79
```
8-
curl --request POST $ORCH_DEPLOYMENT_URL/completion \
10+
curl --request POST $ORCH_DEPLOYMENT_URL/v2/completion \
911
--header 'content-type: application/json' \
1012
--header "Authorization: Bearer $TOKEN" \
1113
--header "AI-Resource-Group: $RESOURCE_GROUP" \
1214
--data-raw '{
13-
"orchestration_config": {
14-
"module_configurations": {
15-
"templating_module_config": {
16-
"template": [
17-
{
18-
"role": "user",
19-
"content": "Create {{?number}} paraphrases of {{?phrase}}"
15+
"config": {
16+
"modules": {
17+
"prompt_templating": {
18+
"prompt": {
19+
"template": [
20+
{
21+
"role": "user",
22+
"content": "Create {{?number}} paraphrases of {{?phrase}}"
23+
}
24+
]
25+
},
26+
"model": {
27+
"name": "<model-name>"
2028
}
21-
]
22-
},
23-
"llm_module_config": {
24-
"model_name": "<ModelName>",
25-
"model_params": {
26-
"max_tokens": 300
2729
}
2830
}
29-
}
30-
},
31-
"input_params": {
32-
"number": "3"
31+
},
32+
"placeholder_values": { } // no placeholder_values supplied
3333
}
34-
}
3534
```
3635

37-
In this case, the response from the service contains an error code in the `code` field, a `message`, and a `location` indicating which orchestration module encountered the error. In all error cases, the `module_results` field only contains results for modules that successfully finished. In this example, the `module_results` are empty because the first module in the pipeline encountered the error.
36+
In this case, the response from the Orchestration service contains an error code in the `code` field, a `message`, and a `location` indicating which orchestration module encountered the error.
3837

3938
```
4039
{
41-
"request_id": "3e988846-1360-4a4a-a7ad-e77b85057321",
42-
"code": 400,
43-
"message": "Missing required parameters: ['phrase']",
44-
"location": "Module: Templating",
45-
"module_results": {}
40+
"error": {
41+
"request_id": "3e988846-1360-4a4a-a7ad-e77b85057321",
42+
"code": 400,
43+
"message": "400 - Input Parameters: Error validating parameters. Unused parameters: ['number', 'phrase'].",
44+
"location": "Input Parameters",
45+
"intermediate_results": {
46+
"templating": [
47+
{
48+
"content": "Create {{?number}} paraphrases of {{?phrase}}",
49+
"role": "user"
50+
}
51+
]
52+
}
53+
}
4654
}
4755
```
48-

0 commit comments

Comments
 (0)