|
| 1 | +# -*- coding: utf-8 -*- |
| 2 | +# Copyright 2026 Google LLC |
| 3 | +# |
| 4 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | +# you may not use this file except in compliance with the License. |
| 6 | +# You may obtain a copy of the License at |
| 7 | +# |
| 8 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | +# |
| 10 | +# Unless required by applicable law or agreed to in writing, software |
| 11 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | +# See the License for the specific language governing permissions and |
| 14 | +# limitations under the License. |
| 15 | +# |
| 16 | +from __future__ import annotations |
| 17 | + |
| 18 | +from typing import MutableMapping, MutableSequence |
| 19 | + |
| 20 | +import proto # type: ignore |
| 21 | + |
| 22 | +__protobuf__ = proto.module( |
| 23 | + package="google.cloud.ces.v1", |
| 24 | + manifest={ |
| 25 | + "AgentCard", |
| 26 | + "AgentInterface", |
| 27 | + "AgentSkill", |
| 28 | + "RemoteAgentTool", |
| 29 | + }, |
| 30 | +) |
| 31 | + |
| 32 | + |
| 33 | +class AgentCard(proto.Message): |
| 34 | + r"""AgentCard conveys key information about a remote agent. |
| 35 | + It is a trimmed version of the AgentCard defined in the A2A |
| 36 | + protocol |
| 37 | + https://a2a-protocol.org/dev/specification/#441-agentcard |
| 38 | +
|
| 39 | + Attributes: |
| 40 | + name (str): |
| 41 | + Required. A human-readable name for the |
| 42 | + agent. |
| 43 | + description (str): |
| 44 | + Required. A description of the agent's domain |
| 45 | + of action/solution space. |
| 46 | + supported_interfaces (MutableSequence[google.cloud.ces_v1.types.AgentInterface]): |
| 47 | + Required. Ordered list of supported |
| 48 | + interfaces. The first entry is preferred. |
| 49 | + version (str): |
| 50 | + Required. The version of the agent. |
| 51 | + skills (MutableSequence[google.cloud.ces_v1.types.AgentSkill]): |
| 52 | + Required. Skills represent a unit of ability |
| 53 | + an agent can perform. This may somewhat abstract |
| 54 | + but represents a more focused set of actions |
| 55 | + that the agent is highly likely to succeed at. |
| 56 | + """ |
| 57 | + |
| 58 | + name: str = proto.Field( |
| 59 | + proto.STRING, |
| 60 | + number=1, |
| 61 | + ) |
| 62 | + description: str = proto.Field( |
| 63 | + proto.STRING, |
| 64 | + number=2, |
| 65 | + ) |
| 66 | + supported_interfaces: MutableSequence["AgentInterface"] = proto.RepeatedField( |
| 67 | + proto.MESSAGE, |
| 68 | + number=3, |
| 69 | + message="AgentInterface", |
| 70 | + ) |
| 71 | + version: str = proto.Field( |
| 72 | + proto.STRING, |
| 73 | + number=5, |
| 74 | + ) |
| 75 | + skills: MutableSequence["AgentSkill"] = proto.RepeatedField( |
| 76 | + proto.MESSAGE, |
| 77 | + number=6, |
| 78 | + message="AgentSkill", |
| 79 | + ) |
| 80 | + |
| 81 | + |
| 82 | +class AgentInterface(proto.Message): |
| 83 | + r"""Declares a combination of a target URL, transport and |
| 84 | + protocol version for interacting with the agent. This allows |
| 85 | + agents to expose the same functionality over multiple protocol |
| 86 | + binding mechanisms. |
| 87 | +
|
| 88 | + Attributes: |
| 89 | + url (str): |
| 90 | + Required. The URL where this interface is |
| 91 | + available. Must be a valid absolute HTTPS URL in |
| 92 | + production. Example: |
| 93 | +
|
| 94 | + "https://api.example.com/a2a/v1", |
| 95 | + "https://grpc.example.com/a2a". |
| 96 | + protocol_binding (str): |
| 97 | + Required. The protocol binding supported at this URL. This |
| 98 | + is an open form string, to be easily extended for other |
| 99 | + protocol bindings. The core ones officially supported are |
| 100 | + ``JSONRPC``, ``GRPC`` and ``HTTP+JSON``. |
| 101 | + tenant (str): |
| 102 | + Tenant ID to be used in the request when |
| 103 | + calling the agent. |
| 104 | + protocol_version (str): |
| 105 | + Required. The version of the A2A protocol |
| 106 | + this interface exposes. Use the latest supported |
| 107 | + minor version per major version. Examples: |
| 108 | + "0.3", "1.0". |
| 109 | + """ |
| 110 | + |
| 111 | + url: str = proto.Field( |
| 112 | + proto.STRING, |
| 113 | + number=1, |
| 114 | + ) |
| 115 | + protocol_binding: str = proto.Field( |
| 116 | + proto.STRING, |
| 117 | + number=2, |
| 118 | + ) |
| 119 | + tenant: str = proto.Field( |
| 120 | + proto.STRING, |
| 121 | + number=3, |
| 122 | + ) |
| 123 | + protocol_version: str = proto.Field( |
| 124 | + proto.STRING, |
| 125 | + number=4, |
| 126 | + ) |
| 127 | + |
| 128 | + |
| 129 | +class AgentSkill(proto.Message): |
| 130 | + r"""Represents a distinct capability or function that an agent |
| 131 | + can perform. |
| 132 | +
|
| 133 | + Attributes: |
| 134 | + id (str): |
| 135 | + Required. A unique identifier for the agent's |
| 136 | + skill. |
| 137 | + name (str): |
| 138 | + Required. A human-readable name for the |
| 139 | + skill. |
| 140 | + description (str): |
| 141 | + Required. A detailed description of the |
| 142 | + skill. |
| 143 | + tags (MutableSequence[str]): |
| 144 | + Required. A set of keywords describing the |
| 145 | + skill's capabilities. |
| 146 | + examples (MutableSequence[str]): |
| 147 | + Example prompts or scenarios that this skill |
| 148 | + can handle. |
| 149 | + input_modes (MutableSequence[str]): |
| 150 | + The set of supported input media types for |
| 151 | + this skill, overriding the agent's defaults. |
| 152 | + output_modes (MutableSequence[str]): |
| 153 | + The set of supported output media types for |
| 154 | + this skill, overriding the agent's defaults. |
| 155 | + """ |
| 156 | + |
| 157 | + id: str = proto.Field( |
| 158 | + proto.STRING, |
| 159 | + number=1, |
| 160 | + ) |
| 161 | + name: str = proto.Field( |
| 162 | + proto.STRING, |
| 163 | + number=2, |
| 164 | + ) |
| 165 | + description: str = proto.Field( |
| 166 | + proto.STRING, |
| 167 | + number=3, |
| 168 | + ) |
| 169 | + tags: MutableSequence[str] = proto.RepeatedField( |
| 170 | + proto.STRING, |
| 171 | + number=4, |
| 172 | + ) |
| 173 | + examples: MutableSequence[str] = proto.RepeatedField( |
| 174 | + proto.STRING, |
| 175 | + number=5, |
| 176 | + ) |
| 177 | + input_modes: MutableSequence[str] = proto.RepeatedField( |
| 178 | + proto.STRING, |
| 179 | + number=6, |
| 180 | + ) |
| 181 | + output_modes: MutableSequence[str] = proto.RepeatedField( |
| 182 | + proto.STRING, |
| 183 | + number=7, |
| 184 | + ) |
| 185 | + |
| 186 | + |
| 187 | +class RemoteAgentTool(proto.Message): |
| 188 | + r"""Represents a tool that allows the agent to call another |
| 189 | + remote agent. |
| 190 | +
|
| 191 | + Attributes: |
| 192 | + name (str): |
| 193 | + Required. The name of the tool. |
| 194 | + description (str): |
| 195 | + Required. The description of the tool. |
| 196 | + agent_card (google.cloud.ces_v1.types.AgentCard): |
| 197 | + Required. The agent card of the remote agent |
| 198 | + that this tool invokes. |
| 199 | + """ |
| 200 | + |
| 201 | + name: str = proto.Field( |
| 202 | + proto.STRING, |
| 203 | + number=1, |
| 204 | + ) |
| 205 | + description: str = proto.Field( |
| 206 | + proto.STRING, |
| 207 | + number=2, |
| 208 | + ) |
| 209 | + agent_card: "AgentCard" = proto.Field( |
| 210 | + proto.MESSAGE, |
| 211 | + number=3, |
| 212 | + message="AgentCard", |
| 213 | + ) |
| 214 | + |
| 215 | + |
| 216 | +__all__ = tuple(sorted(__protobuf__.manifest)) |
0 commit comments