Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 34 additions & 27 deletions docs/sap-ai-core/error-handling-7597e89.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,47 +2,54 @@

# Error Handling

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.
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.

> Note: This request payload uses the v2 endpoint

```
curl --request POST $ORCH_DEPLOYMENT_URL/completion \
curl --request POST $ORCH_DEPLOYMENT_URL/v2/completion \
--header 'content-type: application/json' \
--header "Authorization: Bearer $TOKEN" \
--header "AI-Resource-Group: $RESOURCE_GROUP" \
--data-raw '{
"orchestration_config": {
"module_configurations": {
"templating_module_config": {
"template": [
{
"role": "user",
"content": "Create {{?number}} paraphrases of {{?phrase}}"
"config": {
"modules": {
"prompt_templating": {
"prompt": {
"template": [
{
"role": "user",
"content": "Create {{?number}} paraphrases of {{?phrase}}"
}
]
},
"model": {
"name": "<model-name>"
}
]
},
"llm_module_config": {
"model_name": "<ModelName>",
"model_params": {
"max_tokens": 300
}
}
}
},
"input_params": {
"number": "3"
},
"placeholder_values": { } // no placeholder_values supplied
}
}
```

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.
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.

```
{
"request_id": "3e988846-1360-4a4a-a7ad-e77b85057321",
"code": 400,
"message": "Missing required parameters: ['phrase']",
"location": "Module: Templating",
"module_results": {}
"error": {
"request_id": "3e988846-1360-4a4a-a7ad-e77b85057321",
"code": 400,
"message": "400 - Input Parameters: Error validating parameters. Unused parameters: ['number', 'phrase'].",
"location": "Input Parameters",
"intermediate_results": {
"templating": [
{
"content": "Create {{?number}} paraphrases of {{?phrase}}",
"role": "user"
}
]
}
}
}
```

Loading