|
36 | 36 | "ChatRequest", |
37 | 37 | "DataAgentContext", |
38 | 38 | "ConversationReference", |
| 39 | + "ClientManagedResourceContext", |
39 | 40 | "Message", |
40 | 41 | "UserMessage", |
41 | 42 | "SystemMessage", |
@@ -184,6 +185,14 @@ class ChatRequest(proto.Message): |
184 | 185 | this to chat with an Agent statelessly, without |
185 | 186 | managed conversation persistence. |
186 | 187 |
|
| 188 | + This field is a member of `oneof`_ ``context_provider``. |
| 189 | + client_managed_resource_context (google.cloud.geminidataanalytics_v1alpha.types.ClientManagedResourceContext): |
| 190 | + Optional. Context with client managed |
| 191 | + resources. Some clients may not use GDA managed |
| 192 | + resources including conversations and agents, |
| 193 | + instead they create and manage their own |
| 194 | + conversations and agents resources. |
| 195 | +
|
187 | 196 | This field is a member of `oneof`_ ``context_provider``. |
188 | 197 | project (str): |
189 | 198 | Optional. The Google Cloud project to be used |
@@ -213,6 +222,12 @@ class ChatRequest(proto.Message): |
213 | 222 | oneof="context_provider", |
214 | 223 | message="DataAgentContext", |
215 | 224 | ) |
| 225 | + client_managed_resource_context: "ClientManagedResourceContext" = proto.Field( |
| 226 | + proto.MESSAGE, |
| 227 | + number=105, |
| 228 | + oneof="context_provider", |
| 229 | + message="ClientManagedResourceContext", |
| 230 | + ) |
216 | 231 | project: str = proto.Field( |
217 | 232 | proto.STRING, |
218 | 233 | number=1, |
@@ -305,6 +320,39 @@ class ConversationReference(proto.Message): |
305 | 320 | ) |
306 | 321 |
|
307 | 322 |
|
| 323 | +class ClientManagedResourceContext(proto.Message): |
| 324 | + r"""Context with client managed resources. |
| 325 | + Some clients may not use GDA managed resources including |
| 326 | + conversations and agents, instead they create and manage their |
| 327 | + own conversations and agents resources. |
| 328 | +
|
| 329 | + Attributes: |
| 330 | + inline_context (google.cloud.geminidataanalytics_v1alpha.types.Context): |
| 331 | + Required. Context for the chat request. Use |
| 332 | + this to chat without GDA API managed |
| 333 | + conversation and agent persistence by passing |
| 334 | + all context inline. |
| 335 | + conversation_id (str): |
| 336 | + Optional. The client managed conversation id. |
| 337 | + agent_id (str): |
| 338 | + Optional. The client managed agent id. |
| 339 | + """ |
| 340 | + |
| 341 | + inline_context: context.Context = proto.Field( |
| 342 | + proto.MESSAGE, |
| 343 | + number=1, |
| 344 | + message=context.Context, |
| 345 | + ) |
| 346 | + conversation_id: str = proto.Field( |
| 347 | + proto.STRING, |
| 348 | + number=2, |
| 349 | + ) |
| 350 | + agent_id: str = proto.Field( |
| 351 | + proto.STRING, |
| 352 | + number=3, |
| 353 | + ) |
| 354 | + |
| 355 | + |
308 | 356 | class Message(proto.Message): |
309 | 357 | r"""A message from an interaction between the user and the |
310 | 358 | system. |
@@ -502,10 +550,17 @@ class TextType(proto.Enum): |
502 | 550 | THOUGHT (2): |
503 | 551 | The text is a thinking plan generated by the |
504 | 552 | thinking tool. |
| 553 | + PROGRESS (3): |
| 554 | + The text is an informational message about the agent's |
| 555 | + progress, such as a tool being invoked. This is distinct |
| 556 | + from the agent's internal thought process (``THOUGHT``) and |
| 557 | + the final answer to the user (``FINAL_RESPONSE``). These |
| 558 | + messages provide insight into the agent's actions. |
505 | 559 | """ |
506 | 560 | TEXT_TYPE_UNSPECIFIED = 0 |
507 | 561 | FINAL_RESPONSE = 1 |
508 | 562 | THOUGHT = 2 |
| 563 | + PROGRESS = 3 |
509 | 564 |
|
510 | 565 | parts: MutableSequence[str] = proto.RepeatedField( |
511 | 566 | proto.STRING, |
@@ -1112,7 +1167,21 @@ class ChartResult(proto.Message): |
1112 | 1167 |
|
1113 | 1168 |
|
1114 | 1169 | class ErrorMessage(proto.Message): |
1115 | | - r"""An error message. |
| 1170 | + r"""An error message from a tool call. This message is used to represent |
| 1171 | + an error that occurred while an agent was trying to use a tool. It's |
| 1172 | + important to note that not all errors are terminal. Many are |
| 1173 | + recoverable, and the agent may use the information from this error |
| 1174 | + message to self-correct and retry the tool call or try a different |
| 1175 | + approach. |
| 1176 | +
|
| 1177 | + For example, if a data query fails, the agent might receive an |
| 1178 | + ``ErrorMessage``, analyze it, and then generate a corrected query. |
| 1179 | +
|
| 1180 | + Clients should be cautious about interpreting this message as a |
| 1181 | + definitive failure. It can be part of the agent's normal, iterative |
| 1182 | + process of completing a task. Surfacing these errors directly to |
| 1183 | + end-users without context (e.g., as a "hard failure") may be |
| 1184 | + misleading. |
1116 | 1185 |
|
1117 | 1186 | Attributes: |
1118 | 1187 | text (str): |
|
0 commit comments