|
120 | 120 | } |
121 | 121 | }, |
122 | 122 | "400": { |
123 | | - "description": "The request is invalid." |
| 123 | + "description": "The request is invalid or could not be processed.", |
| 124 | + "content": { |
| 125 | + "application/json": { |
| 126 | + "schema": { |
| 127 | + "$ref": "#/components/schemas/BadRequestResponse" |
| 128 | + } |
| 129 | + } |
| 130 | + } |
| 131 | + }, |
| 132 | + "422": { |
| 133 | + "description": "The tool call is valid, but the parameters are invalid (missing, incorrect type, etc).", |
| 134 | + "content": { |
| 135 | + "application/json": { |
| 136 | + "schema": { |
| 137 | + "$ref": "#/components/schemas/ValidationResponse" |
| 138 | + } |
| 139 | + } |
| 140 | + } |
124 | 141 | } |
125 | 142 | } |
126 | 143 | } |
|
403 | 420 | }, |
404 | 421 | "success": { |
405 | 422 | "type": "boolean", |
406 | | - "description": "Whether the tool call was successful." |
| 423 | + "description": "Whether the tool call was successful. If the `error` field is present, this field will be false." |
407 | 424 | }, |
408 | | - "output": { |
409 | | - "type": "object", |
| 425 | + "json": { |
| 426 | + "description": "The JSON object returned from the tool.", |
410 | 427 | "oneOf": [ |
411 | 428 | { |
412 | | - "properties": { |
413 | | - "value": { |
414 | | - "description": "The value returned from the tool.", |
415 | | - "oneOf": [ |
416 | | - { |
417 | | - "type": "object", |
418 | | - "additionalProperties": true |
419 | | - }, |
420 | | - { |
421 | | - "type": "number" |
422 | | - }, |
423 | | - { |
424 | | - "type": "string" |
425 | | - }, |
426 | | - { |
427 | | - "type": "boolean" |
428 | | - } |
429 | | - ] |
430 | | - } |
431 | | - }, |
432 | | - "required": ["value"], |
433 | | - "additionalProperties": false |
| 429 | + "type": "object", |
| 430 | + "additionalProperties": true |
434 | 431 | }, |
435 | 432 | { |
436 | | - "properties": { |
437 | | - "error": { |
438 | | - "type": "object", |
439 | | - "properties": { |
440 | | - "message": { |
441 | | - "type": "string", |
442 | | - "description": "An error message that can be shown to the user or the AI model." |
443 | | - }, |
444 | | - "developer_message": { |
445 | | - "type": "string", |
446 | | - "description": "An internal message that will be logged but will not be shown to the user or the AI model" |
447 | | - }, |
448 | | - "can_retry": { |
449 | | - "type": "boolean", |
450 | | - "description": "Whether the tool call can be retried by the client.", |
451 | | - "default": false |
452 | | - }, |
453 | | - "additional_prompt_content": { |
454 | | - "type": "string", |
455 | | - "description": "Additional content to be included in the retry prompt." |
456 | | - }, |
457 | | - "retry_after_ms": { |
458 | | - "type": "integer", |
459 | | - "description": "The number of milliseconds (if any) to wait before retrying the tool call." |
460 | | - } |
461 | | - }, |
462 | | - "required": ["message"], |
463 | | - "additionalProperties": false |
464 | | - } |
465 | | - }, |
466 | | - "required": ["error"], |
467 | | - "additionalProperties": false |
| 433 | + "type": "number" |
| 434 | + }, |
| 435 | + { |
| 436 | + "type": "string" |
| 437 | + }, |
| 438 | + { |
| 439 | + "type": "boolean" |
468 | 440 | } |
469 | 441 | ] |
| 442 | + }, |
| 443 | + "error": { |
| 444 | + "type": "object", |
| 445 | + "description": "An error that occurred inside the tool function.", |
| 446 | + "properties": { |
| 447 | + "message": { |
| 448 | + "type": "string", |
| 449 | + "description": "An error message that can be shown to the user or the AI model." |
| 450 | + }, |
| 451 | + "developer_message": { |
| 452 | + "type": "string", |
| 453 | + "description": "An internal message that will be logged but will not be shown to the user or the AI model" |
| 454 | + }, |
| 455 | + "can_retry": { |
| 456 | + "type": "boolean", |
| 457 | + "description": "Whether the tool call can be retried by the client.", |
| 458 | + "default": false |
| 459 | + }, |
| 460 | + "additional_prompt_content": { |
| 461 | + "type": "string", |
| 462 | + "description": "Additional content to be included in the retry prompt." |
| 463 | + }, |
| 464 | + "retry_after_ms": { |
| 465 | + "type": "integer", |
| 466 | + "description": "The number of milliseconds (if any) to wait before retrying the tool call." |
| 467 | + } |
| 468 | + }, |
| 469 | + "required": ["message"], |
| 470 | + "additionalProperties": false |
470 | 471 | } |
471 | 472 | }, |
472 | 473 | "required": ["call_id", "success"], |
473 | 474 | "additionalProperties": false |
| 475 | + }, |
| 476 | + "BadRequestResponse": { |
| 477 | + "type": "object", |
| 478 | + "properties": { |
| 479 | + "message": { |
| 480 | + "type": "string", |
| 481 | + "description": "The error message." |
| 482 | + } |
| 483 | + }, |
| 484 | + "required": ["message"], |
| 485 | + "additionalProperties": false |
| 486 | + }, |
| 487 | + "ValidationResponse": { |
| 488 | + "type": "object", |
| 489 | + "properties": { |
| 490 | + "message": { |
| 491 | + "type": "string", |
| 492 | + "description": "The error message." |
| 493 | + }, |
| 494 | + "parameter_errors": { |
| 495 | + "type": "object", |
| 496 | + "description": "A map of parameter names to error messages, if parameter-level errors are present." |
| 497 | + } |
| 498 | + }, |
| 499 | + "required": ["message"], |
| 500 | + "additionalProperties": false |
474 | 501 | } |
475 | 502 | } |
476 | 503 | } |
|
0 commit comments