|
2 | 2 |
|
3 | 3 | # Error Handling |
4 | 4 |
|
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 |
6 | 8 |
|
7 | 9 | ``` |
8 | | -curl --request POST $ORCH_DEPLOYMENT_URL/completion \ |
| 10 | +curl --request POST $ORCH_DEPLOYMENT_URL/v2/completion \ |
9 | 11 | --header 'content-type: application/json' \ |
10 | 12 | --header "Authorization: Bearer $TOKEN" \ |
11 | 13 | --header "AI-Resource-Group: $RESOURCE_GROUP" \ |
12 | 14 | --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>" |
20 | 28 | } |
21 | | - ] |
22 | | - }, |
23 | | - "llm_module_config": { |
24 | | - "model_name": "<ModelName>", |
25 | | - "model_params": { |
26 | | - "max_tokens": 300 |
27 | 29 | } |
28 | 30 | } |
29 | | - } |
30 | | - }, |
31 | | - "input_params": { |
32 | | - "number": "3" |
| 31 | + }, |
| 32 | + "placeholder_values": { } // no placeholder_values supplied |
33 | 33 | } |
34 | | - } |
35 | 34 | ``` |
36 | 35 |
|
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. |
38 | 37 |
|
39 | 38 | ``` |
40 | 39 | { |
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 | + } |
46 | 54 | } |
47 | 55 | ``` |
48 | | - |
|
0 commit comments