1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751
|
<html><body>
<style>
body, h1, h2, h3, div, span, p, pre, a {
margin: 0;
padding: 0;
border: 0;
font-weight: inherit;
font-style: inherit;
font-size: 100%;
font-family: inherit;
vertical-align: baseline;
}
body {
font-size: 13px;
padding: 1em;
}
h1 {
font-size: 26px;
margin-bottom: 1em;
}
h2 {
font-size: 24px;
margin-bottom: 1em;
}
h3 {
font-size: 20px;
margin-bottom: 1em;
margin-top: 1em;
}
pre, code {
line-height: 1.5;
font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
}
pre {
margin-top: 0.5em;
}
h1, h2, h3, p {
font-family: Arial, sans serif;
}
h1, h2, h3 {
border-bottom: solid #CCC 1px;
}
.toc_element {
margin-top: 0.5em;
}
.firstline {
margin-left: 2 em;
}
.method {
margin-top: 1em;
border: solid 1px #CCC;
padding: 1em;
background: #EEE;
}
.details {
font-weight: bold;
font-size: 14px;
}
</style>
<h1><a href="discoveryengine_v1alpha.html">Discovery Engine API</a> . <a href="discoveryengine_v1alpha.projects.html">projects</a> . <a href="discoveryengine_v1alpha.projects.locations.html">locations</a> . <a href="discoveryengine_v1alpha.projects.locations.collections.html">collections</a> . <a href="discoveryengine_v1alpha.projects.locations.collections.engines.html">engines</a> . <a href="discoveryengine_v1alpha.projects.locations.collections.engines.assistants.html">assistants</a></h1>
<h2>Instance Methods</h2>
<p class="toc_element">
<code><a href="discoveryengine_v1alpha.projects.locations.collections.engines.assistants.agents.html">agents()</a></code>
</p>
<p class="firstline">Returns the agents Resource.</p>
<p class="toc_element">
<code><a href="discoveryengine_v1alpha.projects.locations.collections.engines.assistants.cannedQueries.html">cannedQueries()</a></code>
</p>
<p class="firstline">Returns the cannedQueries Resource.</p>
<p class="toc_element">
<code><a href="#close">close()</a></code></p>
<p class="firstline">Close httplib2 connections.</p>
<p class="toc_element">
<code><a href="#create">create(parent, assistantId=None, body=None, x__xgafv=None)</a></code></p>
<p class="firstline">Creates an Assistant.</p>
<p class="toc_element">
<code><a href="#delete">delete(name, x__xgafv=None)</a></code></p>
<p class="firstline">Deletes an Assistant.</p>
<p class="toc_element">
<code><a href="#get">get(name, x__xgafv=None)</a></code></p>
<p class="firstline">Gets an Assistant.</p>
<p class="toc_element">
<code><a href="#list">list(parent, pageSize=None, pageToken=None, x__xgafv=None)</a></code></p>
<p class="firstline">Lists all Assistants under an Engine.</p>
<p class="toc_element">
<code><a href="#listAvailableAgentViews">listAvailableAgentViews(parent, adminView=None, agentOrigin=None, filter=None, languageCode=None, maxSuggestedPrompts=None, pageSize=None, pageToken=None, sortBy=None, x__xgafv=None)</a></code></p>
<p class="firstline">Lists the data for displaying the Agents under an Assistant which are available to the caller.</p>
<p class="toc_element">
<code><a href="#listAvailableAgentViews_next">listAvailableAgentViews_next()</a></code></p>
<p class="firstline">Retrieves the next page of results.</p>
<p class="toc_element">
<code><a href="#list_next">list_next()</a></code></p>
<p class="firstline">Retrieves the next page of results.</p>
<p class="toc_element">
<code><a href="#patch">patch(name, body=None, updateMask=None, x__xgafv=None)</a></code></p>
<p class="firstline">Updates an Assistant</p>
<p class="toc_element">
<code><a href="#streamAssist">streamAssist(name, body=None, x__xgafv=None)</a></code></p>
<p class="firstline">Assists the user with a query in a streaming fashion.</p>
<h3>Method Details</h3>
<div class="method">
<code class="details" id="close">close()</code>
<pre>Close httplib2 connections.</pre>
</div>
<div class="method">
<code class="details" id="create">create(parent, assistantId=None, body=None, x__xgafv=None)</code>
<pre>Creates an Assistant.
Args:
parent: string, Required. The parent resource name. Format: `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}` (required)
body: object, The request body.
The object takes the form of:
{ # Discovery Engine Assistant resource.
"customerPolicy": { # Customer-defined policy for the assistant. # Optional. Customer policy for the assistant.
"bannedPhrases": [ # Optional. List of banned phrases.
{ # Definition of a customer-defined banned phrase. A banned phrase is not allowed to appear in the user query or the LLM response, or else the answer will be refused.
"ignoreDiacritics": True or False, # Optional. If true, diacritical marks (e.g., accents, umlauts) are ignored when matching banned phrases. For example, "cafe" would match "café".
"matchType": "A String", # Optional. Match type for the banned phrase.
"phrase": "A String", # Required. The raw string content to be banned.
},
],
"modelArmorConfig": { # Configuration for customer defined Model Armor templates to be used for sanitizing user prompts and assistant responses. # Optional. Model Armor configuration to be used for sanitizing user prompts and assistant responses.
"failureMode": "A String", # Optional. Defines the failure mode for Model Armor sanitization.
"responseTemplate": "A String", # Optional. The resource name of the Model Armor template for sanitizing assistant responses. Format: `projects/{project}/locations/{location}/templates/{template_id}` If not specified, no sanitization will be applied to the assistant response.
"userPromptTemplate": "A String", # Optional. The resource name of the Model Armor template for sanitizing user prompts. Format: `projects/{project}/locations/{location}/templates/{template_id}` If not specified, no sanitization will be applied to the user prompt.
},
},
"defaultWebGroundingToggleOff": True or False, # Optional. This field controls the default web grounding toggle for end users if `web_grounding_type` is set to `WEB_GROUNDING_TYPE_GOOGLE_SEARCH` or `WEB_GROUNDING_TYPE_ENTERPRISE_WEB_SEARCH`. By default, this field is set to false. If `web_grounding_type` is `WEB_GROUNDING_TYPE_GOOGLE_SEARCH` or `WEB_GROUNDING_TYPE_ENTERPRISE_WEB_SEARCH`, end users will have web grounding enabled by default on UI. If true, grounding toggle will be disabled by default on UI. End users can still enable web grounding in the UI if web grounding is enabled.
"description": "A String", # Optional. Description for additional information. Expected to be shown on the configuration UI, not to the users of the assistant.
"disableLocationContext": True or False, # Optional. Indicates whether to disable user location context. By default, user location context is enabled.
"displayName": "A String", # Required. The assistant display name. It must be a UTF-8 encoded string with a length limit of 128 characters.
"enabledTools": { # Optional. Note: not implemented yet. Use enabled_actions instead. The enabled tools on this assistant. The keys are connector name, for example "projects/{projectId}/locations/{locationId}/collections/{collectionId}/dataconnector The values consist of admin enabled tools towards the connector instance. Admin can selectively enable multiple tools on any of the connector instances that they created in the project. For example {"jira1ConnectorName": [(toolId1, "createTicket"), (toolId2, "transferTicket")], "gmail1ConnectorName": [(toolId3, "sendEmail"),..] }
"a_key": { # The enabled tools on a connector
"toolInfo": [ # The list of tools with corresponding tool information.
{ # Information to identify a tool.
"toolDisplayName": "A String", # The display name of the tool.
"toolName": "A String", # The name of the tool as defined by DataConnectorService.QueryAvailableActions. Note: it's using `action` in the DataConnectorService apis, but they are the same as the `tool` here.
},
],
},
},
"generationConfig": { # Configuration for the generation of the assistant response. # Optional. Configuration for the generation of the assistant response.
"allowedModelIds": [ # Optional. The list of models that are allowed to be used for assistant.
"A String",
],
"defaultLanguage": "A String", # The default language to use for the generation of the assistant response. Use an ISO 639-1 language code such as `en`. If not specified, the language will be automatically detected.
"defaultModelId": "A String", # Optional. The default model to use for assistant.
"systemInstruction": { # System instruction, also known as the prompt preamble for LLM calls. # System instruction, also known as the prompt preamble for LLM calls. See also https://cloud.google.com/vertex-ai/generative-ai/docs/learn/prompts/system-instructions
"additionalSystemInstruction": "A String", # Optional. Additional system instruction that will be added to the default system instruction.
},
},
"name": "A String", # Immutable. Resource name of the assistant. Format: `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/assistants/{assistant}` It must be a UTF-8 encoded string with a length limit of 1024 characters.
"webGroundingType": "A String", # Optional. The type of web grounding to use.
}
assistantId: string, Required. The ID to use for the Assistant, which will become the final component of the Assistant's resource name. This field must conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) with a length limit of 63 characters.
x__xgafv: string, V1 error format.
Allowed values
1 - v1 error format
2 - v2 error format
Returns:
An object of the form:
{ # Discovery Engine Assistant resource.
"customerPolicy": { # Customer-defined policy for the assistant. # Optional. Customer policy for the assistant.
"bannedPhrases": [ # Optional. List of banned phrases.
{ # Definition of a customer-defined banned phrase. A banned phrase is not allowed to appear in the user query or the LLM response, or else the answer will be refused.
"ignoreDiacritics": True or False, # Optional. If true, diacritical marks (e.g., accents, umlauts) are ignored when matching banned phrases. For example, "cafe" would match "café".
"matchType": "A String", # Optional. Match type for the banned phrase.
"phrase": "A String", # Required. The raw string content to be banned.
},
],
"modelArmorConfig": { # Configuration for customer defined Model Armor templates to be used for sanitizing user prompts and assistant responses. # Optional. Model Armor configuration to be used for sanitizing user prompts and assistant responses.
"failureMode": "A String", # Optional. Defines the failure mode for Model Armor sanitization.
"responseTemplate": "A String", # Optional. The resource name of the Model Armor template for sanitizing assistant responses. Format: `projects/{project}/locations/{location}/templates/{template_id}` If not specified, no sanitization will be applied to the assistant response.
"userPromptTemplate": "A String", # Optional. The resource name of the Model Armor template for sanitizing user prompts. Format: `projects/{project}/locations/{location}/templates/{template_id}` If not specified, no sanitization will be applied to the user prompt.
},
},
"defaultWebGroundingToggleOff": True or False, # Optional. This field controls the default web grounding toggle for end users if `web_grounding_type` is set to `WEB_GROUNDING_TYPE_GOOGLE_SEARCH` or `WEB_GROUNDING_TYPE_ENTERPRISE_WEB_SEARCH`. By default, this field is set to false. If `web_grounding_type` is `WEB_GROUNDING_TYPE_GOOGLE_SEARCH` or `WEB_GROUNDING_TYPE_ENTERPRISE_WEB_SEARCH`, end users will have web grounding enabled by default on UI. If true, grounding toggle will be disabled by default on UI. End users can still enable web grounding in the UI if web grounding is enabled.
"description": "A String", # Optional. Description for additional information. Expected to be shown on the configuration UI, not to the users of the assistant.
"disableLocationContext": True or False, # Optional. Indicates whether to disable user location context. By default, user location context is enabled.
"displayName": "A String", # Required. The assistant display name. It must be a UTF-8 encoded string with a length limit of 128 characters.
"enabledTools": { # Optional. Note: not implemented yet. Use enabled_actions instead. The enabled tools on this assistant. The keys are connector name, for example "projects/{projectId}/locations/{locationId}/collections/{collectionId}/dataconnector The values consist of admin enabled tools towards the connector instance. Admin can selectively enable multiple tools on any of the connector instances that they created in the project. For example {"jira1ConnectorName": [(toolId1, "createTicket"), (toolId2, "transferTicket")], "gmail1ConnectorName": [(toolId3, "sendEmail"),..] }
"a_key": { # The enabled tools on a connector
"toolInfo": [ # The list of tools with corresponding tool information.
{ # Information to identify a tool.
"toolDisplayName": "A String", # The display name of the tool.
"toolName": "A String", # The name of the tool as defined by DataConnectorService.QueryAvailableActions. Note: it's using `action` in the DataConnectorService apis, but they are the same as the `tool` here.
},
],
},
},
"generationConfig": { # Configuration for the generation of the assistant response. # Optional. Configuration for the generation of the assistant response.
"allowedModelIds": [ # Optional. The list of models that are allowed to be used for assistant.
"A String",
],
"defaultLanguage": "A String", # The default language to use for the generation of the assistant response. Use an ISO 639-1 language code such as `en`. If not specified, the language will be automatically detected.
"defaultModelId": "A String", # Optional. The default model to use for assistant.
"systemInstruction": { # System instruction, also known as the prompt preamble for LLM calls. # System instruction, also known as the prompt preamble for LLM calls. See also https://cloud.google.com/vertex-ai/generative-ai/docs/learn/prompts/system-instructions
"additionalSystemInstruction": "A String", # Optional. Additional system instruction that will be added to the default system instruction.
},
},
"name": "A String", # Immutable. Resource name of the assistant. Format: `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/assistants/{assistant}` It must be a UTF-8 encoded string with a length limit of 1024 characters.
"webGroundingType": "A String", # Optional. The type of web grounding to use.
}</pre>
</div>
<div class="method">
<code class="details" id="delete">delete(name, x__xgafv=None)</code>
<pre>Deletes an Assistant.
Args:
name: string, Required. Resource name of Assistant. Format: `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/assistants/{assistant}` If the caller does not have permission to delete the Assistant, regardless of whether or not it exists, a PERMISSION_DENIED error is returned. If the Assistant to delete does not exist, a NOT_FOUND error is returned. (required)
x__xgafv: string, V1 error format.
Allowed values
1 - v1 error format
2 - v2 error format
Returns:
An object of the form:
{ # A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }
}</pre>
</div>
<div class="method">
<code class="details" id="get">get(name, x__xgafv=None)</code>
<pre>Gets an Assistant.
Args:
name: string, Required. Resource name of Assistant. Format: `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/assistants/{assistant}` (required)
x__xgafv: string, V1 error format.
Allowed values
1 - v1 error format
2 - v2 error format
Returns:
An object of the form:
{ # Discovery Engine Assistant resource.
"customerPolicy": { # Customer-defined policy for the assistant. # Optional. Customer policy for the assistant.
"bannedPhrases": [ # Optional. List of banned phrases.
{ # Definition of a customer-defined banned phrase. A banned phrase is not allowed to appear in the user query or the LLM response, or else the answer will be refused.
"ignoreDiacritics": True or False, # Optional. If true, diacritical marks (e.g., accents, umlauts) are ignored when matching banned phrases. For example, "cafe" would match "café".
"matchType": "A String", # Optional. Match type for the banned phrase.
"phrase": "A String", # Required. The raw string content to be banned.
},
],
"modelArmorConfig": { # Configuration for customer defined Model Armor templates to be used for sanitizing user prompts and assistant responses. # Optional. Model Armor configuration to be used for sanitizing user prompts and assistant responses.
"failureMode": "A String", # Optional. Defines the failure mode for Model Armor sanitization.
"responseTemplate": "A String", # Optional. The resource name of the Model Armor template for sanitizing assistant responses. Format: `projects/{project}/locations/{location}/templates/{template_id}` If not specified, no sanitization will be applied to the assistant response.
"userPromptTemplate": "A String", # Optional. The resource name of the Model Armor template for sanitizing user prompts. Format: `projects/{project}/locations/{location}/templates/{template_id}` If not specified, no sanitization will be applied to the user prompt.
},
},
"defaultWebGroundingToggleOff": True or False, # Optional. This field controls the default web grounding toggle for end users if `web_grounding_type` is set to `WEB_GROUNDING_TYPE_GOOGLE_SEARCH` or `WEB_GROUNDING_TYPE_ENTERPRISE_WEB_SEARCH`. By default, this field is set to false. If `web_grounding_type` is `WEB_GROUNDING_TYPE_GOOGLE_SEARCH` or `WEB_GROUNDING_TYPE_ENTERPRISE_WEB_SEARCH`, end users will have web grounding enabled by default on UI. If true, grounding toggle will be disabled by default on UI. End users can still enable web grounding in the UI if web grounding is enabled.
"description": "A String", # Optional. Description for additional information. Expected to be shown on the configuration UI, not to the users of the assistant.
"disableLocationContext": True or False, # Optional. Indicates whether to disable user location context. By default, user location context is enabled.
"displayName": "A String", # Required. The assistant display name. It must be a UTF-8 encoded string with a length limit of 128 characters.
"enabledTools": { # Optional. Note: not implemented yet. Use enabled_actions instead. The enabled tools on this assistant. The keys are connector name, for example "projects/{projectId}/locations/{locationId}/collections/{collectionId}/dataconnector The values consist of admin enabled tools towards the connector instance. Admin can selectively enable multiple tools on any of the connector instances that they created in the project. For example {"jira1ConnectorName": [(toolId1, "createTicket"), (toolId2, "transferTicket")], "gmail1ConnectorName": [(toolId3, "sendEmail"),..] }
"a_key": { # The enabled tools on a connector
"toolInfo": [ # The list of tools with corresponding tool information.
{ # Information to identify a tool.
"toolDisplayName": "A String", # The display name of the tool.
"toolName": "A String", # The name of the tool as defined by DataConnectorService.QueryAvailableActions. Note: it's using `action` in the DataConnectorService apis, but they are the same as the `tool` here.
},
],
},
},
"generationConfig": { # Configuration for the generation of the assistant response. # Optional. Configuration for the generation of the assistant response.
"allowedModelIds": [ # Optional. The list of models that are allowed to be used for assistant.
"A String",
],
"defaultLanguage": "A String", # The default language to use for the generation of the assistant response. Use an ISO 639-1 language code such as `en`. If not specified, the language will be automatically detected.
"defaultModelId": "A String", # Optional. The default model to use for assistant.
"systemInstruction": { # System instruction, also known as the prompt preamble for LLM calls. # System instruction, also known as the prompt preamble for LLM calls. See also https://cloud.google.com/vertex-ai/generative-ai/docs/learn/prompts/system-instructions
"additionalSystemInstruction": "A String", # Optional. Additional system instruction that will be added to the default system instruction.
},
},
"name": "A String", # Immutable. Resource name of the assistant. Format: `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/assistants/{assistant}` It must be a UTF-8 encoded string with a length limit of 1024 characters.
"webGroundingType": "A String", # Optional. The type of web grounding to use.
}</pre>
</div>
<div class="method">
<code class="details" id="list">list(parent, pageSize=None, pageToken=None, x__xgafv=None)</code>
<pre>Lists all Assistants under an Engine.
Args:
parent: string, Required. The parent resource name. Format: `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}` (required)
pageSize: integer, Maximum number of Assistants to return. If unspecified, defaults to 100. The maximum allowed value is 1000; anything above that will be coerced down to 1000.
pageToken: string, A page token ListAssistantsResponse.next_page_token, received from a previous AssistantService.ListAssistants call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to ListAssistants must match the call that provided the page token.
x__xgafv: string, V1 error format.
Allowed values
1 - v1 error format
2 - v2 error format
Returns:
An object of the form:
{ # Response message for the AssistantService.ListAssistants method.
"assistants": [ # All the customer's Assistants.
{ # Discovery Engine Assistant resource.
"customerPolicy": { # Customer-defined policy for the assistant. # Optional. Customer policy for the assistant.
"bannedPhrases": [ # Optional. List of banned phrases.
{ # Definition of a customer-defined banned phrase. A banned phrase is not allowed to appear in the user query or the LLM response, or else the answer will be refused.
"ignoreDiacritics": True or False, # Optional. If true, diacritical marks (e.g., accents, umlauts) are ignored when matching banned phrases. For example, "cafe" would match "café".
"matchType": "A String", # Optional. Match type for the banned phrase.
"phrase": "A String", # Required. The raw string content to be banned.
},
],
"modelArmorConfig": { # Configuration for customer defined Model Armor templates to be used for sanitizing user prompts and assistant responses. # Optional. Model Armor configuration to be used for sanitizing user prompts and assistant responses.
"failureMode": "A String", # Optional. Defines the failure mode for Model Armor sanitization.
"responseTemplate": "A String", # Optional. The resource name of the Model Armor template for sanitizing assistant responses. Format: `projects/{project}/locations/{location}/templates/{template_id}` If not specified, no sanitization will be applied to the assistant response.
"userPromptTemplate": "A String", # Optional. The resource name of the Model Armor template for sanitizing user prompts. Format: `projects/{project}/locations/{location}/templates/{template_id}` If not specified, no sanitization will be applied to the user prompt.
},
},
"defaultWebGroundingToggleOff": True or False, # Optional. This field controls the default web grounding toggle for end users if `web_grounding_type` is set to `WEB_GROUNDING_TYPE_GOOGLE_SEARCH` or `WEB_GROUNDING_TYPE_ENTERPRISE_WEB_SEARCH`. By default, this field is set to false. If `web_grounding_type` is `WEB_GROUNDING_TYPE_GOOGLE_SEARCH` or `WEB_GROUNDING_TYPE_ENTERPRISE_WEB_SEARCH`, end users will have web grounding enabled by default on UI. If true, grounding toggle will be disabled by default on UI. End users can still enable web grounding in the UI if web grounding is enabled.
"description": "A String", # Optional. Description for additional information. Expected to be shown on the configuration UI, not to the users of the assistant.
"disableLocationContext": True or False, # Optional. Indicates whether to disable user location context. By default, user location context is enabled.
"displayName": "A String", # Required. The assistant display name. It must be a UTF-8 encoded string with a length limit of 128 characters.
"enabledTools": { # Optional. Note: not implemented yet. Use enabled_actions instead. The enabled tools on this assistant. The keys are connector name, for example "projects/{projectId}/locations/{locationId}/collections/{collectionId}/dataconnector The values consist of admin enabled tools towards the connector instance. Admin can selectively enable multiple tools on any of the connector instances that they created in the project. For example {"jira1ConnectorName": [(toolId1, "createTicket"), (toolId2, "transferTicket")], "gmail1ConnectorName": [(toolId3, "sendEmail"),..] }
"a_key": { # The enabled tools on a connector
"toolInfo": [ # The list of tools with corresponding tool information.
{ # Information to identify a tool.
"toolDisplayName": "A String", # The display name of the tool.
"toolName": "A String", # The name of the tool as defined by DataConnectorService.QueryAvailableActions. Note: it's using `action` in the DataConnectorService apis, but they are the same as the `tool` here.
},
],
},
},
"generationConfig": { # Configuration for the generation of the assistant response. # Optional. Configuration for the generation of the assistant response.
"allowedModelIds": [ # Optional. The list of models that are allowed to be used for assistant.
"A String",
],
"defaultLanguage": "A String", # The default language to use for the generation of the assistant response. Use an ISO 639-1 language code such as `en`. If not specified, the language will be automatically detected.
"defaultModelId": "A String", # Optional. The default model to use for assistant.
"systemInstruction": { # System instruction, also known as the prompt preamble for LLM calls. # System instruction, also known as the prompt preamble for LLM calls. See also https://cloud.google.com/vertex-ai/generative-ai/docs/learn/prompts/system-instructions
"additionalSystemInstruction": "A String", # Optional. Additional system instruction that will be added to the default system instruction.
},
},
"name": "A String", # Immutable. Resource name of the assistant. Format: `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/assistants/{assistant}` It must be a UTF-8 encoded string with a length limit of 1024 characters.
"webGroundingType": "A String", # Optional. The type of web grounding to use.
},
],
"nextPageToken": "A String", # A token that can be sent as ListAssistantsRequest.page_token to retrieve the next page. If this field is omitted, there are no subsequent pages.
}</pre>
</div>
<div class="method">
<code class="details" id="listAvailableAgentViews">listAvailableAgentViews(parent, adminView=None, agentOrigin=None, filter=None, languageCode=None, maxSuggestedPrompts=None, pageSize=None, pageToken=None, sortBy=None, x__xgafv=None)</code>
<pre>Lists the data for displaying the Agents under an Assistant which are available to the caller.
Args:
parent: string, Required. The parent resource name. Format: `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/assistants/{assistant}` (required)
adminView: boolean, Optional. Indicates whether to consider if the caller is an admin. If set, and the caller is an admin, the response will consider admin-only permissions. Otherwise, a caller with admin permissions will get a response as an unprivileged user.
agentOrigin: string, Optional. The origin of the Agent.
Allowed values
AGENT_ORIGIN_UNSPECIFIED - The origin is unspecified.
GOOGLE - Agent defined by Google.
ORGANIZATION - Agent defined by the organization.
USER - Agent defined by the user.
filter: string, Optional. The filter syntax consists of an expression language for constructing a predicate from one or more fields of the files being filtered. Filter expression is case-sensitive. Allowed fields are: * `display_name` * `state` Some examples of filters would be: * `display_name = 'agent_1'` * `display_name = 'agent_1' AND state = ENABLED` For a full description of the filter format, please see https://google.aip.dev/160.
languageCode: string, Optional. The UI language currently shown to the user. Specifying this field request that the texts in the AgentViews in the response should be translated to this language.
maxSuggestedPrompts: integer, Optional. The maximum number of suggested prompts to return per agent.
pageSize: integer, Optional. Maximum number of AgentViewss to return. If unspecified, defaults to 100. The maximum allowed value is 1000; anything above that will be coerced down to 1000.
pageToken: string, Optional. A page token ListAvailableAgentViewsResponse.next_page_token, received from a previous AgentService.ListAvailableAgentViews call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to ListAvailableAgentViews must match the call that provided the page token.
sortBy: string, Optional. The field to sort by. Can have the following values: - display-name: The display name of the agent. - description: The description of the agent. - create-time: The creation time of the agent. - state: The state of the agent.
x__xgafv: string, V1 error format.
Allowed values
1 - v1 error format
2 - v2 error format
Returns:
An object of the form:
{ # Response message for the AgentService.ListAvailableAgentViews method.
"agentViews": [ # The agent sources visible to the caller under the parent Assistant.
{ # The data for displaying an Agent.
"agentOrigin": "A String", # Immutable. The origin of the Agent.
"agentSharingState": "A String", # Output only. The sharing state of the agent.
"agentType": "A String", # Output only. The type of the agent.
"customPlaceholderText": "A String", # The custom placeholder text that appears in the text box before the user enters any text.
"deploymentFailureReason": "A String", # The reason why the agent deployment failed. Only set if the state is DEPLOYMENT_FAILED.
"description": "A String", # Required. Human-readable description of the agent. This might be used by an LLM to automatically select an agent to respond to a user query and to generate the first version of the steps for the agent that can be modified by the user. The language of this is either Agent.language_code, or ListAvailableAgentViewsRequest.language_code if translations are enabled.
"displayName": "A String", # Required. Display name of the agent. The language of this is either Agent.language_code, or ListAvailableAgentViewsRequest.language_code if translations are enabled.
"icon": { # Represents an image. # Optional. The icon that represents the agent on the UI.
"content": "A String", # Base64-encoded image file contents.
"uri": "A String", # Image URI.
},
"name": "A String", # Resource name of the agent. Format: `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/assistants/{assistant}/agents/{agent}`
"rejectionReason": "A String", # The reason why the agent was rejected. Only set if the state is PRIVATE, and got there via rejection.
"state": "A String", # Output only. The state of the Agent.
"suggestedPrompts": [ # Optional. The suggested prompts for the agent, to be shown on the agent landing page.
{ # A suggested prompt for the agent, to be shown on the agent landing page.
"text": "A String", # Required. The text of the suggested prompt. The language of this is either Agent.language_code, or ListAvailableAgentViewsRequest.language_code if translations are enabled.
},
],
"suspensionReason": "A String", # The reason why the agent was suspended. Only set if the state is SUSPENDED.
"userAnnotations": { # Per-user annotations for an Agent, based on UserAnnotation. # Optional. Per-user annotations of the current caller for the agent.
"pinned": True or False, # Optional. Whether the agent is pinned, pinned agent will be displayed on the top of the agent list.
"viewed": True or False, # Optional. Whether the agent has been viewed by the user.
},
"userPermissions": { # The permissions of the user on an Agent. # The permissions of the user for this Agent.
"canDelete": True or False, # If the user can delete this Agent.
"canEdit": True or False, # If the user can edit this Agent.
"canProposeUsers": True or False, # If the user can propose other users to share the Agent with.
"canRequestReview": True or False, # If the user can request a review for this Agent.
"canRun": True or False, # If the user can run this Agent.
"canView": True or False, # If the user can view the source of this Agent.
"canWithdraw": True or False, # If the user can withdraw this Agent.
},
},
],
"nextPageToken": "A String", # A token that can be sent as ListAvailableAgentViewsRequest.page_token to retrieve the next page. If this field is omitted, there are no subsequent pages.
}</pre>
</div>
<div class="method">
<code class="details" id="listAvailableAgentViews_next">listAvailableAgentViews_next()</code>
<pre>Retrieves the next page of results.
Args:
previous_request: The request for the previous page. (required)
previous_response: The response from the request for the previous page. (required)
Returns:
A request object that you can call 'execute()' on to request the next
page. Returns None if there are no more items in the collection.
</pre>
</div>
<div class="method">
<code class="details" id="list_next">list_next()</code>
<pre>Retrieves the next page of results.
Args:
previous_request: The request for the previous page. (required)
previous_response: The response from the request for the previous page. (required)
Returns:
A request object that you can call 'execute()' on to request the next
page. Returns None if there are no more items in the collection.
</pre>
</div>
<div class="method">
<code class="details" id="patch">patch(name, body=None, updateMask=None, x__xgafv=None)</code>
<pre>Updates an Assistant
Args:
name: string, Immutable. Resource name of the assistant. Format: `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/assistants/{assistant}` It must be a UTF-8 encoded string with a length limit of 1024 characters. (required)
body: object, The request body.
The object takes the form of:
{ # Discovery Engine Assistant resource.
"customerPolicy": { # Customer-defined policy for the assistant. # Optional. Customer policy for the assistant.
"bannedPhrases": [ # Optional. List of banned phrases.
{ # Definition of a customer-defined banned phrase. A banned phrase is not allowed to appear in the user query or the LLM response, or else the answer will be refused.
"ignoreDiacritics": True or False, # Optional. If true, diacritical marks (e.g., accents, umlauts) are ignored when matching banned phrases. For example, "cafe" would match "café".
"matchType": "A String", # Optional. Match type for the banned phrase.
"phrase": "A String", # Required. The raw string content to be banned.
},
],
"modelArmorConfig": { # Configuration for customer defined Model Armor templates to be used for sanitizing user prompts and assistant responses. # Optional. Model Armor configuration to be used for sanitizing user prompts and assistant responses.
"failureMode": "A String", # Optional. Defines the failure mode for Model Armor sanitization.
"responseTemplate": "A String", # Optional. The resource name of the Model Armor template for sanitizing assistant responses. Format: `projects/{project}/locations/{location}/templates/{template_id}` If not specified, no sanitization will be applied to the assistant response.
"userPromptTemplate": "A String", # Optional. The resource name of the Model Armor template for sanitizing user prompts. Format: `projects/{project}/locations/{location}/templates/{template_id}` If not specified, no sanitization will be applied to the user prompt.
},
},
"defaultWebGroundingToggleOff": True or False, # Optional. This field controls the default web grounding toggle for end users if `web_grounding_type` is set to `WEB_GROUNDING_TYPE_GOOGLE_SEARCH` or `WEB_GROUNDING_TYPE_ENTERPRISE_WEB_SEARCH`. By default, this field is set to false. If `web_grounding_type` is `WEB_GROUNDING_TYPE_GOOGLE_SEARCH` or `WEB_GROUNDING_TYPE_ENTERPRISE_WEB_SEARCH`, end users will have web grounding enabled by default on UI. If true, grounding toggle will be disabled by default on UI. End users can still enable web grounding in the UI if web grounding is enabled.
"description": "A String", # Optional. Description for additional information. Expected to be shown on the configuration UI, not to the users of the assistant.
"disableLocationContext": True or False, # Optional. Indicates whether to disable user location context. By default, user location context is enabled.
"displayName": "A String", # Required. The assistant display name. It must be a UTF-8 encoded string with a length limit of 128 characters.
"enabledTools": { # Optional. Note: not implemented yet. Use enabled_actions instead. The enabled tools on this assistant. The keys are connector name, for example "projects/{projectId}/locations/{locationId}/collections/{collectionId}/dataconnector The values consist of admin enabled tools towards the connector instance. Admin can selectively enable multiple tools on any of the connector instances that they created in the project. For example {"jira1ConnectorName": [(toolId1, "createTicket"), (toolId2, "transferTicket")], "gmail1ConnectorName": [(toolId3, "sendEmail"),..] }
"a_key": { # The enabled tools on a connector
"toolInfo": [ # The list of tools with corresponding tool information.
{ # Information to identify a tool.
"toolDisplayName": "A String", # The display name of the tool.
"toolName": "A String", # The name of the tool as defined by DataConnectorService.QueryAvailableActions. Note: it's using `action` in the DataConnectorService apis, but they are the same as the `tool` here.
},
],
},
},
"generationConfig": { # Configuration for the generation of the assistant response. # Optional. Configuration for the generation of the assistant response.
"allowedModelIds": [ # Optional. The list of models that are allowed to be used for assistant.
"A String",
],
"defaultLanguage": "A String", # The default language to use for the generation of the assistant response. Use an ISO 639-1 language code such as `en`. If not specified, the language will be automatically detected.
"defaultModelId": "A String", # Optional. The default model to use for assistant.
"systemInstruction": { # System instruction, also known as the prompt preamble for LLM calls. # System instruction, also known as the prompt preamble for LLM calls. See also https://cloud.google.com/vertex-ai/generative-ai/docs/learn/prompts/system-instructions
"additionalSystemInstruction": "A String", # Optional. Additional system instruction that will be added to the default system instruction.
},
},
"name": "A String", # Immutable. Resource name of the assistant. Format: `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/assistants/{assistant}` It must be a UTF-8 encoded string with a length limit of 1024 characters.
"webGroundingType": "A String", # Optional. The type of web grounding to use.
}
updateMask: string, The list of fields to update.
x__xgafv: string, V1 error format.
Allowed values
1 - v1 error format
2 - v2 error format
Returns:
An object of the form:
{ # Discovery Engine Assistant resource.
"customerPolicy": { # Customer-defined policy for the assistant. # Optional. Customer policy for the assistant.
"bannedPhrases": [ # Optional. List of banned phrases.
{ # Definition of a customer-defined banned phrase. A banned phrase is not allowed to appear in the user query or the LLM response, or else the answer will be refused.
"ignoreDiacritics": True or False, # Optional. If true, diacritical marks (e.g., accents, umlauts) are ignored when matching banned phrases. For example, "cafe" would match "café".
"matchType": "A String", # Optional. Match type for the banned phrase.
"phrase": "A String", # Required. The raw string content to be banned.
},
],
"modelArmorConfig": { # Configuration for customer defined Model Armor templates to be used for sanitizing user prompts and assistant responses. # Optional. Model Armor configuration to be used for sanitizing user prompts and assistant responses.
"failureMode": "A String", # Optional. Defines the failure mode for Model Armor sanitization.
"responseTemplate": "A String", # Optional. The resource name of the Model Armor template for sanitizing assistant responses. Format: `projects/{project}/locations/{location}/templates/{template_id}` If not specified, no sanitization will be applied to the assistant response.
"userPromptTemplate": "A String", # Optional. The resource name of the Model Armor template for sanitizing user prompts. Format: `projects/{project}/locations/{location}/templates/{template_id}` If not specified, no sanitization will be applied to the user prompt.
},
},
"defaultWebGroundingToggleOff": True or False, # Optional. This field controls the default web grounding toggle for end users if `web_grounding_type` is set to `WEB_GROUNDING_TYPE_GOOGLE_SEARCH` or `WEB_GROUNDING_TYPE_ENTERPRISE_WEB_SEARCH`. By default, this field is set to false. If `web_grounding_type` is `WEB_GROUNDING_TYPE_GOOGLE_SEARCH` or `WEB_GROUNDING_TYPE_ENTERPRISE_WEB_SEARCH`, end users will have web grounding enabled by default on UI. If true, grounding toggle will be disabled by default on UI. End users can still enable web grounding in the UI if web grounding is enabled.
"description": "A String", # Optional. Description for additional information. Expected to be shown on the configuration UI, not to the users of the assistant.
"disableLocationContext": True or False, # Optional. Indicates whether to disable user location context. By default, user location context is enabled.
"displayName": "A String", # Required. The assistant display name. It must be a UTF-8 encoded string with a length limit of 128 characters.
"enabledTools": { # Optional. Note: not implemented yet. Use enabled_actions instead. The enabled tools on this assistant. The keys are connector name, for example "projects/{projectId}/locations/{locationId}/collections/{collectionId}/dataconnector The values consist of admin enabled tools towards the connector instance. Admin can selectively enable multiple tools on any of the connector instances that they created in the project. For example {"jira1ConnectorName": [(toolId1, "createTicket"), (toolId2, "transferTicket")], "gmail1ConnectorName": [(toolId3, "sendEmail"),..] }
"a_key": { # The enabled tools on a connector
"toolInfo": [ # The list of tools with corresponding tool information.
{ # Information to identify a tool.
"toolDisplayName": "A String", # The display name of the tool.
"toolName": "A String", # The name of the tool as defined by DataConnectorService.QueryAvailableActions. Note: it's using `action` in the DataConnectorService apis, but they are the same as the `tool` here.
},
],
},
},
"generationConfig": { # Configuration for the generation of the assistant response. # Optional. Configuration for the generation of the assistant response.
"allowedModelIds": [ # Optional. The list of models that are allowed to be used for assistant.
"A String",
],
"defaultLanguage": "A String", # The default language to use for the generation of the assistant response. Use an ISO 639-1 language code such as `en`. If not specified, the language will be automatically detected.
"defaultModelId": "A String", # Optional. The default model to use for assistant.
"systemInstruction": { # System instruction, also known as the prompt preamble for LLM calls. # System instruction, also known as the prompt preamble for LLM calls. See also https://cloud.google.com/vertex-ai/generative-ai/docs/learn/prompts/system-instructions
"additionalSystemInstruction": "A String", # Optional. Additional system instruction that will be added to the default system instruction.
},
},
"name": "A String", # Immutable. Resource name of the assistant. Format: `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/assistants/{assistant}` It must be a UTF-8 encoded string with a length limit of 1024 characters.
"webGroundingType": "A String", # Optional. The type of web grounding to use.
}</pre>
</div>
<div class="method">
<code class="details" id="streamAssist">streamAssist(name, body=None, x__xgafv=None)</code>
<pre>Assists the user with a query in a streaming fashion.
Args:
name: string, Required. The resource name of the Assistant. Format: `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/assistants/{assistant}` (required)
body: object, The request body.
The object takes the form of:
{ # Request for the AssistantService.StreamAssist method.
"generationSpec": { # Assistant generation specification for the request. This allows to override the default generation configuration at the engine level. # Optional. Specification of the generation configuration for the request.
"modelId": "A String", # Optional. The Vertex AI model_id used for the generative model. If not set, the default Assistant model will be used.
},
"query": { # Defines a user inputed query. # Optional. Current user query. Empty query is only supported if `file_ids` are provided. In this case, the answer will be generated based on those context files.
"queryId": "A String", # Output only. Unique Id for the query.
"text": "A String", # Plain text.
},
"session": "A String", # Optional. The session to use for the request. If specified, the assistant has access to the session history, and the query and the answer are stored there. If `-` is specified as the session ID, or it is left empty, then a new session is created with an automatically generated ID. Format: `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/sessions/{session}`
"toolsSpec": { # Specification of tools that are used to serve the request. # Optional. Specification of tools that are used to serve the request.
"imageGenerationSpec": { # Specification of the image generation tool. # Optional. Specification of the image generation tool.
},
"vertexAiSearchSpec": { # Specification of the Vertex AI Search tool. # Optional. Specification of the Vertex AI Search tool.
"dataStoreSpecs": [ # Optional. Specs defining DataStores to filter on in a search call and configurations for those data stores. This is only considered for Engines with multiple data stores.
{ # A struct to define data stores to filter on in a search call and configurations for those data stores. Otherwise, an `INVALID_ARGUMENT` error is returned.
"boostSpec": { # Boost specification to boost certain documents. # Optional. Boost specification to boost certain documents. For more information on boosting, see [Boosting](https://cloud.google.com/generative-ai-app-builder/docs/boost-search-results)
"conditionBoostSpecs": [ # Condition boost specifications. If a document matches multiple conditions in the specifications, boost scores from these specifications are all applied and combined in a non-linear way. Maximum number of specifications is 20.
{ # Boost applies to documents which match a condition.
"boost": 3.14, # Strength of the condition boost, which should be in [-1, 1]. Negative boost means demotion. Default is 0.0. Setting to 1.0 gives the document a big promotion. However, it does not necessarily mean that the boosted document will be the top result at all times, nor that other documents will be excluded. Results could still be shown even when none of them matches the condition. And results that are significantly more relevant to the search query can still trump your heavily favored but irrelevant documents. Setting to -1.0 gives the document a big demotion. However, results that are deeply relevant might still be shown. The document will have an upstream battle to get a fairly high ranking, but it is not blocked out completely. Setting to 0.0 means no boost applied. The boosting condition is ignored. Only one of the (condition, boost) combination or the boost_control_spec below are set. If both are set then the global boost is ignored and the more fine-grained boost_control_spec is applied.
"boostControlSpec": { # Specification for custom ranking based on customer specified attribute value. It provides more controls for customized ranking than the simple (condition, boost) combination above. # Complex specification for custom ranking based on customer defined attribute value.
"attributeType": "A String", # The attribute type to be used to determine the boost amount. The attribute value can be derived from the field value of the specified field_name. In the case of numerical it is straightforward i.e. attribute_value = numerical_field_value. In the case of freshness however, attribute_value = (time.now() - datetime_field_value).
"controlPoints": [ # The control points used to define the curve. The monotonic function (defined through the interpolation_type above) passes through the control points listed here.
{ # The control points used to define the curve. The curve defined through these control points can only be monotonically increasing or decreasing(constant values are acceptable).
"attributeValue": "A String", # Can be one of: 1. The numerical field value. 2. The duration spec for freshness: The value must be formatted as an XSD `dayTimeDuration` value (a restricted subset of an ISO 8601 duration value). The pattern for this is: `nDnM]`.
"boostAmount": 3.14, # The value between -1 to 1 by which to boost the score if the attribute_value evaluates to the value specified above.
},
],
"fieldName": "A String", # The name of the field whose value will be used to determine the boost amount.
"interpolationType": "A String", # The interpolation type to be applied to connect the control points listed below.
},
"condition": "A String", # An expression which specifies a boost condition. The syntax and supported fields are the same as a filter expression. See SearchRequest.filter for detail syntax and limitations. Examples: * To boost documents with document ID "doc_1" or "doc_2", and color "Red" or "Blue": `(document_id: ANY("doc_1", "doc_2")) AND (color: ANY("Red", "Blue"))`
},
],
},
"customSearchOperators": "A String", # Optional. Custom search operators which if specified will be used to filter results from workspace data stores. For more information on custom search operators, see [SearchOperators](https://support.google.com/cloudsearch/answer/6172299).
"dataStore": "A String", # Required. Full resource name of DataStore, such as `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`. The path must include the project number, project id is not supported for this field.
"filter": "A String", # Optional. Filter specification to filter documents in the data store specified by data_store field. For more information on filtering, see [Filtering](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata)
},
],
"filter": "A String", # Optional. The filter syntax consists of an expression language for constructing a predicate from one or more fields of the documents being filtered. Filter expression is case-sensitive. If this field is unrecognizable, an `INVALID_ARGUMENT` is returned. Filtering in Vertex AI Search is done by mapping the LHS filter key to a key property defined in the Vertex AI Search backend -- this mapping is defined by the customer in their schema. For example a media customer might have a field 'name' in their schema. In this case the filter would look like this: filter --> name:'ANY("king kong")' For more information about filtering including syntax and filter operators, see [Filter](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata)
},
"videoGenerationSpec": { # Specification of the video generation tool. # Optional. Specification of the video generation tool.
},
"webGroundingSpec": { # Specification of the web grounding tool. # Optional. Specification of the web grounding tool. If field is present, enables grounding with web search. Works only if Assistant.web_grounding_type is WEB_GROUNDING_TYPE_GOOGLE_SEARCH or WEB_GROUNDING_TYPE_ENTERPRISE_WEB_SEARCH.
},
},
"userMetadata": { # User metadata of the request. # Optional. Information about the user initiating the query.
"preferredLanguageCode": "A String", # Optional. Preferred language to be used for answering if language detection fails. Also used as the language of error messages created by actions, regardless of language detection results.
"timeZone": "A String", # Optional. IANA time zone, e.g. Europe/Budapest.
},
}
x__xgafv: string, V1 error format.
Allowed values
1 - v1 error format
2 - v2 error format
Returns:
An object of the form:
{ # Response for the AssistantService.StreamAssist method.
"answer": { # AssistAnswer resource, main part of AssistResponse. # Assist answer resource object containing parts of the assistant's final answer for the user's query. Not present if the current response doesn't add anything to previously sent AssistAnswer.replies. Observe AssistAnswer.state to see if more parts are to be expected. While the state is `IN_PROGRESS`, the AssistAnswer.replies field in each response will contain replies (reply fragments) to be appended to the ones received in previous responses. AssistAnswer.name won't be filled. If the state is `SUCCEEDED`, `FAILED` or `SKIPPED`, the response is the last response and AssistAnswer.name will have a value.
"assistSkippedReasons": [ # Reasons for not answering the assist call.
"A String",
],
"customerPolicyEnforcementResult": { # Customer policy enforcement results. Contains the results of the various policy checks, like the banned phrases or the Model Armor checks. # Optional. The field contains information about the various policy checks' results like the banned phrases or the Model Armor checks. This field is populated only if the assist call was skipped due to a policy violation.
"policyResults": [ # Customer policy enforcement results. Populated only if the assist call was skipped due to a policy violation. It contains results from those filters that blocked the processing of the query.
{ # Customer policy enforcement result for a single policy type.
"bannedPhraseEnforcementResult": { # Customer policy enforcement result for the banned phrase policy. # The policy enforcement result for the banned phrase policy.
"bannedPhrases": [ # The banned phrases that were found in the query or the answer.
"A String",
],
},
"modelArmorEnforcementResult": { # Customer policy enforcement result for the Model Armor policy. # The policy enforcement result for the Model Armor policy.
"error": { # The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors). # The error returned by Model Armor if the policy enforcement failed for some reason.
"code": 42, # The status code, which should be an enum value of google.rpc.Code.
"details": [ # A list of messages that carry the error details. There is a common set of message types for APIs to use.
{
"a_key": "", # Properties of the object. Contains field @type with type URL.
},
],
"message": "A String", # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.
},
"modelArmorViolation": "A String", # The Model Armor violation that was found.
},
},
],
"verdict": "A String", # Final verdict of the customer policy enforcement. If only one policy blocked the processing, the verdict is BLOCK.
},
"name": "A String", # Immutable. Identifier. Resource name of the `AssistAnswer`. Format: `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/sessions/{session}/assistAnswers/{assist_answer}` This field must be a UTF-8 encoded string with a length limit of 1024 characters.
"replies": [ # Replies of the assistant.
{ # One part of the multi-part response of the assist call.
"groundedContent": { # A piece of content and possibly its grounding information. Not all content needs grounding. Phrases like "Of course, I will gladly search it for you." do not need grounding. # Possibly grounded response text or media from the assistant.
"citationMetadata": { # A collection of source attributions for a piece of content. # Source attribution of the generated content. See also https://cloud.google.com/vertex-ai/generative-ai/docs/learn/overview#citation_check
"citations": [ # Output only. List of citations.
{ # Source attributions for content.
"endIndex": 42, # Output only. End index into the content.
"license": "A String", # Output only. License of the attribution.
"publicationDate": { # Represents a whole or partial calendar date, such as a birthday. The time of day and time zone are either specified elsewhere or are insignificant. The date is relative to the Gregorian Calendar. This can represent one of the following: * A full date, with non-zero year, month, and day values. * A month and day, with a zero year (for example, an anniversary). * A year on its own, with a zero month and a zero day. * A year and month, with a zero day (for example, a credit card expiration date). Related types: * google.type.TimeOfDay * google.type.DateTime * google.protobuf.Timestamp # Output only. Publication date of the attribution.
"day": 42, # Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant.
"month": 42, # Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day.
"year": 42, # Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year.
},
"startIndex": 42, # Output only. Start index into the content.
"title": "A String", # Output only. Title of the attribution.
"uri": "A String", # Output only. Url reference of the attribution.
},
],
},
"content": { # Multi-modal content. # The content.
"codeExecutionResult": { # Result of executing ExecutableCode. # Result of executing an ExecutableCode.
"outcome": "A String", # Required. Outcome of the code execution.
"output": "A String", # Optional. Contains stdout when code execution is successful, stderr or other description otherwise.
},
"executableCode": { # Code generated by the model that is meant to be executed by the model. # Code generated by the model that is meant to be executed.
"code": "A String", # Required. The code content. Currently only supports Python.
},
"file": { # A file, e.g., an audio summary. # A file, e.g., an audio summary.
"fileId": "A String", # Required. The file ID.
"mimeType": "A String", # Required. The media type (MIME type) of the file.
},
"inlineData": { # Inline blob. # Inline binary data.
"data": "A String", # Required. Raw bytes.
"mimeType": "A String", # Required. The media type (MIME type) of the generated data.
},
"role": "A String", # The producer of the content. Can be "model" or "user".
"text": "A String", # Inline text.
"thought": True or False, # Optional. Indicates if the part is thought from the model.
},
"textGroundingMetadata": { # Grounding details for text sources. # Metadata for grounding based on text sources.
"references": [ # References for the grounded text.
{ # Referenced content and related document metadata.
"content": "A String", # Referenced text content.
"documentMetadata": { # Document metadata. # Document metadata.
"document": "A String", # Document resource name.
"domain": "A String", # Domain name from the document URI. Note that the `uri` field may contain a URL that redirects to the actual website, in which case this will contain the domain name of the target site.
"mimeType": "A String", # The mime type of the document. https://www.iana.org/assignments/media-types/media-types.xhtml.
"pageIdentifier": "A String", # Page identifier.
"title": "A String", # Title.
"uri": "A String", # URI for the document. It may contain a URL that redirects to the actual website.
},
},
],
"segments": [ # Grounding information for parts of the text.
{ # Grounding information for a segment of the text.
"endIndex": "A String", # End of the segment, exclusive.
"groundingScore": 3.14, # Score for the segment.
"referenceIndices": [ # References for the segment.
42,
],
"startIndex": "A String", # Zero-based index indicating the start of the segment, measured in bytes of a UTF-8 string (i.e. characters encoded on multiple bytes have a length of more than one).
"text": "A String", # The text segment itself.
},
],
},
},
"replyId": "A String", # Output only. When set, uniquely identifies a reply within the `AssistAnswer` resource. During an AssistantService.StreamAssist call, multiple `Reply` messages with the same ID can occur within the response stream (across multiple AssistantService.StreamAssistResponse messages). These represent parts of a single `Reply` message in the final `AssistAnswer` resource.
},
],
"state": "A String", # State of the answer generation.
},
"assistToken": "A String", # A global unique ID that identifies the current pair of request and stream of responses. Used for feedback and support.
"invocationTools": [ # The tool names of the tools that were invoked.
"A String",
],
"sessionInfo": { # Information about the session. # Session information. Only included in the final StreamAssistResponse of the response stream.
"session": "A String", # Name of the newly generated or continued session. Format: `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/sessions/{session}`.
},
}</pre>
</div>
</body></html>
|