|
1 | 1 | # generated by datamodel-codegen: |
2 | | -# filename: https://raw.githubusercontent.com/google/A2A/refs/heads/main/specification/json/a2a.json |
| 2 | +# filename: https://raw.githubusercontent.com/ognis1205/A2A/refs/heads/poc/agent-catalog/specification/json/a2a.json |
3 | 3 |
|
4 | 4 | from __future__ import annotations |
5 | 5 |
|
@@ -62,6 +62,26 @@ class AgentCapabilities(BaseModel): |
62 | 62 | """ |
63 | 63 |
|
64 | 64 |
|
| 65 | +class AgentLinkTarget(BaseModel): |
| 66 | + """ |
| 67 | + Represents a Link Target Object that specifically points to an agent card |
| 68 | + in JSON format. This is a specialization of the generic LinkTarget, |
| 69 | + with a fixed media type of "application/json" as required for agent metadata. |
| 70 | + """ |
| 71 | + |
| 72 | + href: str |
| 73 | + """ |
| 74 | + The target URI of the link. |
| 75 | + MUST be a valid URI reference (RFC 3986). |
| 76 | + SHOULD NOT be a relative reference. |
| 77 | + """ |
| 78 | + type: Literal['application/json'] = 'application/json' |
| 79 | + """ |
| 80 | + The media type of the target resource. |
| 81 | + MUST be "application/json" to indicate the agent card is in JSON format. |
| 82 | + """ |
| 83 | + |
| 84 | + |
65 | 85 | class AgentProvider(BaseModel): |
66 | 86 | """ |
67 | 87 | Represents the service provider of an agent. |
@@ -484,6 +504,51 @@ class JSONRPCResult(BaseModel): |
484 | 504 | """ |
485 | 505 |
|
486 | 506 |
|
| 507 | +class LinkContext(BaseModel): |
| 508 | + """ |
| 509 | + Represents a Link Context Object as defined in RFC 9264 Section 4.2.2. |
| 510 | + See: https://www.rfc-editor.org/rfc/rfc9264#section-4.2.2 |
| 511 | + """ |
| 512 | + |
| 513 | + anchor: str | None = None |
| 514 | + """ |
| 515 | + The URI reference representing the link context. |
| 516 | + MUST be a valid URI reference (RFC 3986). |
| 517 | + SHOULD NOT be a relative reference. |
| 518 | + """ |
| 519 | + |
| 520 | + |
| 521 | +class LinkTarget(BaseModel): |
| 522 | + """ |
| 523 | + Represents a Link Target Object as defined in RFC 9264 Section 4.2.3. |
| 524 | + See: https://www.rfc-editor.org/rfc/rfc9264#section-4.2.3 |
| 525 | +
|
| 526 | + While not a complete implementation of all target attributes defined in |
| 527 | + RFC 8288, this interface captures the minimal structure required for the |
| 528 | + current use case and leaves room for extension. |
| 529 | + """ |
| 530 | + |
| 531 | + href: str |
| 532 | + """ |
| 533 | + The target URI of the link. |
| 534 | + MUST be a valid URI reference (RFC 3986). |
| 535 | + SHOULD NOT be a relative reference. |
| 536 | + """ |
| 537 | + |
| 538 | + |
| 539 | +class Linkset(BaseModel): |
| 540 | + """ |
| 541 | + Represents a Linkset document as defined in RFC 9264. |
| 542 | + See: https://www.rfc-editor.org/rfc/rfc9264 |
| 543 | + """ |
| 544 | + |
| 545 | + linkset: list[LinkContext] |
| 546 | + """ |
| 547 | + An array of Link Context Objects. |
| 548 | + Each object defines a set of related links for a given anchor (context URI). |
| 549 | + """ |
| 550 | + |
| 551 | + |
487 | 552 | class Role(Enum): |
488 | 553 | """ |
489 | 554 | Message sender's role |
@@ -816,6 +881,25 @@ class A2AError( |
816 | 881 | ) |
817 | 882 |
|
818 | 883 |
|
| 884 | +class AgentLinkContext(BaseModel): |
| 885 | + """ |
| 886 | + Represents a Link Context object specifically for agents. |
| 887 | + Extends the general LinkContext structure by requiring an `anchor` field |
| 888 | + and including a `describedby` relation to link to the agent's card endpoint. |
| 889 | + """ |
| 890 | + |
| 891 | + anchor: str |
| 892 | + """ |
| 893 | + A URI reference identifying the agent's endpoint. |
| 894 | + MUST be a valid URI reference (RFC 3986). |
| 895 | + SHOULD NOT be a relative reference. |
| 896 | + """ |
| 897 | + describedby: list[AgentLinkTarget] |
| 898 | + """ |
| 899 | + A list of links that describe the agent's metadata (agent card). |
| 900 | + """ |
| 901 | + |
| 902 | + |
819 | 903 | class CancelTaskRequest(BaseModel): |
820 | 904 | """ |
821 | 905 | JSON-RPC request model for the 'tasks/cancel' method. |
@@ -1058,6 +1142,21 @@ class SetTaskPushNotificationConfigSuccessResponse(BaseModel): |
1058 | 1142 | """ |
1059 | 1143 |
|
1060 | 1144 |
|
| 1145 | +class AgentCatalog(BaseModel): |
| 1146 | + """ |
| 1147 | + Represents an API Catalog document, extending the Linkset structure defined in RFC 9264. |
| 1148 | + This specialized catalog uses AgentLinkContext objects to describe agent-specific metadata. |
| 1149 | + See: https://www.ietf.org/archive/id/draft-ietf-httpapi-api-catalog-08.html |
| 1150 | + """ |
| 1151 | + |
| 1152 | + linkset: list[AgentLinkContext] |
| 1153 | + """ |
| 1154 | + An array of AgentLinkContext objects. |
| 1155 | + Each object uses the `anchor` to specify the agent’s endpoint and the `describedby` link to |
| 1156 | + indicate the endpoint of its agent card. |
| 1157 | + """ |
| 1158 | + |
| 1159 | + |
1061 | 1160 | class Artifact(BaseModel): |
1062 | 1161 | """ |
1063 | 1162 | Represents an artifact generated for a task. |
|
0 commit comments