|
47 | 47 |
|
48 | 48 |
|
49 | 49 | class TaskMetadata(BaseModel): |
| 50 | + """ |
| 51 | + Metadata for augmenting a request with task execution. |
| 52 | + Include this in the `task` field of the request parameters. |
| 53 | + """ |
| 54 | + |
50 | 55 | model_config = ConfigDict(extra="allow") |
51 | 56 |
|
52 | 57 | ttl: Annotated[int, Field(strict=True)] | None = None |
| 58 | + """Requested duration in milliseconds to retain task from creation.""" |
53 | 59 |
|
54 | 60 |
|
55 | 61 | class RequestParams(BaseModel): |
@@ -536,6 +542,7 @@ class RelatedTaskMetadata(BaseModel): |
536 | 542 |
|
537 | 543 | model_config = ConfigDict(extra="allow") |
538 | 544 | taskId: str |
| 545 | + """The task identifier this message is associated with.""" |
539 | 546 |
|
540 | 547 |
|
541 | 548 | class Task(BaseModel): |
@@ -568,6 +575,7 @@ class Task(BaseModel): |
568 | 575 | """Actual retention duration from creation in milliseconds, null for unlimited.""" |
569 | 576 |
|
570 | 577 | pollInterval: Annotated[int, Field(strict=True)] | None = None |
| 578 | + """Suggested polling interval in milliseconds.""" |
571 | 579 |
|
572 | 580 |
|
573 | 581 | class CreateTaskResult(Result): |
@@ -1709,13 +1717,16 @@ class CancelledNotificationParams(NotificationParams): |
1709 | 1717 | """Parameters for cancellation notifications.""" |
1710 | 1718 |
|
1711 | 1719 | requestId: RequestId | None = None |
1712 | | - """The ID of the request to cancel.""" |
| 1720 | + """ |
| 1721 | + The ID of the request to cancel. |
| 1722 | +
|
| 1723 | + This MUST correspond to the ID of a request previously issued in the same direction. |
| 1724 | + This MUST be provided for cancelling non-task requests. |
| 1725 | + This MUST NOT be used for cancelling tasks (use the `tasks/cancel` request instead). |
| 1726 | + """ |
1713 | 1727 | reason: str | None = None |
1714 | 1728 | """An optional string describing the reason for the cancellation.""" |
1715 | 1729 |
|
1716 | | - taskId: str | None = None |
1717 | | - """Deprecated: Use the `tasks/cancel` request instead of this notification for task cancellation.""" |
1718 | | - |
1719 | 1730 | model_config = ConfigDict(extra="allow") |
1720 | 1731 |
|
1721 | 1732 |
|
|
0 commit comments