|
148 | 148 | "content": { |
149 | 149 | "application/json": { |
150 | 150 | "schema": { |
151 | | - "$ref": "#/components/schemas/ValidationFailedResponse" |
| 151 | + "$ref": "#/components/schemas/ValidationErrorResponse" |
152 | 152 | } |
153 | 153 | } |
154 | 154 | } |
|
354 | 354 | }, |
355 | 355 | "user_id": { |
356 | 356 | "type": "string", |
357 | | - "description": "A unique ID that identifies the user, if present." |
| 357 | + "description": "A unique ID that identifies the user, if required by the tool." |
358 | 358 | } |
359 | 359 | }, |
360 | 360 | "additionalProperties": true |
|
385 | 385 | "properties": { |
386 | 386 | "success": { "enum": [true] }, |
387 | 387 | "value": { |
388 | | - "description": "The value returned from the tool.", |
389 | | - "oneOf": [ |
390 | | - { |
391 | | - "type": "object", |
392 | | - "additionalProperties": true |
393 | | - }, |
394 | | - { |
395 | | - "type": "number" |
396 | | - }, |
397 | | - { |
398 | | - "type": "string" |
399 | | - }, |
400 | | - { |
401 | | - "type": "boolean" |
402 | | - } |
403 | | - ] |
| 388 | + "type": [ |
| 389 | + "object", |
| 390 | + "array", |
| 391 | + "string", |
| 392 | + "number", |
| 393 | + "boolean", |
| 394 | + "null" |
| 395 | + ], |
| 396 | + "additionalProperties": true, |
| 397 | + "description": "The value returned from the tool." |
404 | 398 | } |
405 | 399 | }, |
406 | 400 | "not": { "required": ["error"] } |
|
409 | 403 | "properties": { |
410 | 404 | "success": { "enum": [false] }, |
411 | 405 | "error": { |
412 | | - "type": "object", |
413 | | - "description": "An error that occurred inside the tool function.", |
414 | | - "properties": { |
415 | | - "message": { |
416 | | - "type": "string", |
417 | | - "description": "An error message that can be shown to the user or the AI model." |
418 | | - }, |
419 | | - "developer_message": { |
420 | | - "type": "string", |
421 | | - "description": "An internal message that will be logged but will not be shown to the user or the AI model" |
422 | | - }, |
423 | | - "can_retry": { |
424 | | - "type": "boolean", |
425 | | - "description": "Whether the tool call can be retried by the client.", |
426 | | - "default": false |
427 | | - }, |
428 | | - "additional_prompt_content": { |
429 | | - "type": "string", |
430 | | - "description": "Additional content to be included in the retry prompt." |
431 | | - }, |
432 | | - "retry_after_ms": { |
433 | | - "type": "integer", |
434 | | - "description": "The number of milliseconds (if any) to wait before retrying the tool call." |
435 | | - } |
436 | | - }, |
437 | | - "required": ["message"], |
438 | | - "additionalProperties": false |
| 406 | + "$ref": "#/components/schemas/ToolError" |
439 | 407 | } |
440 | 408 | }, |
441 | 409 | "required": ["error"], |
|
463 | 431 | "required": ["message"], |
464 | 432 | "additionalProperties": false |
465 | 433 | }, |
466 | | - "ValidationFailedResponse": { |
| 434 | + "ValidationErrorResponse": { |
467 | 435 | "type": "object", |
468 | 436 | "properties": { |
469 | 437 | "$schema": { |
|
481 | 449 | }, |
482 | 450 | "required": ["message"], |
483 | 451 | "additionalProperties": false |
| 452 | + }, |
| 453 | + "ToolError": { |
| 454 | + "type": "object", |
| 455 | + "description": "An error that occurred inside the tool function.", |
| 456 | + "properties": { |
| 457 | + "message": { |
| 458 | + "type": "string", |
| 459 | + "description": "An error message that can be shown to the user or the AI model." |
| 460 | + }, |
| 461 | + "developer_message": { |
| 462 | + "type": "string", |
| 463 | + "description": "An internal message that will be logged but will not be shown to the user or the AI model" |
| 464 | + }, |
| 465 | + "can_retry": { |
| 466 | + "type": "boolean", |
| 467 | + "description": "Whether the tool call can be retried by the client.", |
| 468 | + "default": false |
| 469 | + }, |
| 470 | + "additional_prompt_content": { |
| 471 | + "type": "string", |
| 472 | + "description": "Additional content to be included in the retry prompt." |
| 473 | + }, |
| 474 | + "retry_after_ms": { |
| 475 | + "type": "integer", |
| 476 | + "description": "The number of milliseconds (if any) to wait before retrying the tool call." |
| 477 | + } |
| 478 | + }, |
| 479 | + "required": ["message"], |
| 480 | + "additionalProperties": false |
484 | 481 | } |
485 | 482 | } |
486 | 483 | } |
|
0 commit comments