- Resource: AssistAnswer
- JSON representation
- State
- Reply
- AssistantGroundedContent
- TextGroundingMetadata
- Segment
- Reference
- DocumentMetadata
- BoundingBox
- BoundingPoly
- NormalizedVertex
- SearchEntryPoint
- AssistantContent
- Blob
- File
- ExecutableCode
- CodeExecutionResult
- Outcome
- ContentMetadata
- ContentKind
- AssistSkippedReason
- CustomerPolicyEnforcementResult
- Verdict
- PolicyEnforcementResult
- BannedPhraseEnforcementResult
- ModelArmorEnforcementResult
- Methods
Resource: AssistAnswer
AssistAnswer resource, main part of AssistResponse
.
JSON representation |
---|
{ "name": string, "state": enum ( |
Fields | |
---|---|
name |
Immutable. Identifier. Resource name of the This field must be a UTF-8 encoded string with a length limit of 1024 characters. |
state |
State of the answer generation. |
replies[] |
Replies of the assistant. |
diagnosticInfo |
Optional. Diagnostic information collected while processing the request. This is meant for human readers only, mainly to help with debugging. The structure of the data is subject to change without notice. |
assistSkippedReasons[] |
Reasons for not answering the assist call. |
customerPolicyEnforcementResult |
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. |
State
State of the answer generation.
Enums | |
---|---|
STATE_UNSPECIFIED |
Unknown. |
IN_PROGRESS |
Assist operation is currently in progress. |
FAILED |
Assist operation has failed. |
SUCCEEDED |
Assist operation has succeeded. |
SKIPPED |
Assist operation has been skipped. |
Reply
One part of the multi-part response of the assist call.
JSON representation |
---|
{ // Union field |
Fields | |
---|---|
Union field reply . Alternatives for the assistant reply. reply can be only one of the following: |
|
groundedContent |
Possibly grounded response text or media from the assistant. |
AssistantGroundedContent
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.
JSON representation |
---|
{ "content": { object ( |
Fields | |
---|---|
content |
The content. |
contentMetadata |
Optional. metadata for the content. Currently only used for answers of research assistants. |
Union field metadata . Grounding metadata for various modals. It only supports text for now. metadata can be only one of the following: |
|
textGroundingMetadata |
Metadata for grounding based on text sources. |
TextGroundingMetadata
Grounding details for text sources.
JSON representation |
---|
{ "segments": [ { object ( |
Fields | |
---|---|
segments[] |
Grounding information for parts of the text. |
references[] |
References for the grounded text. |
searchEntryPoints[] |
Optional. Google Search entry points for the web searches used for grounding. |
Segment
Grounding information for a segment of the text.
JSON representation |
---|
{ "startIndex": string, "endIndex": string, "referenceIndices": [ integer ], "groundingScore": number, "text": string } |
Fields | |
---|---|
startIndex |
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). |
endIndex |
End of the segment, exclusive. |
referenceIndices[] |
References for the segment. |
groundingScore |
Score for the segment. |
text |
The text segment itself. |
Reference
Referenced content and related document metadata.
JSON representation |
---|
{
"content": string,
"documentMetadata": {
object ( |
Fields | |
---|---|
content |
Referenced text content. |
documentMetadata |
Document metadata. |
DocumentMetadata
Document metadata.
JSON representation |
---|
{
"boundingBoxes": [
{
object ( |
Fields | |
---|---|
boundingBoxes[] |
Optional. Bounding boxes for this reference. Repeated to support references spawning multiple pages. |
document |
Document resource name. |
uri |
URI for the document. It may contain a URL that redirects to the actual website. |
title |
Title. |
pageIdentifier |
Page identifier. |
domain |
Domain name from the document URI. Note that the |
mimeType |
The mime type of the document. https://www.iana.org/assignments/media-types/media-types.xhtml. |
BoundingBox
A bounding box that spawns a single page.
JSON representation |
---|
{
"pageNumber": string,
"boundingPoly": {
object ( |
Fields | |
---|---|
pageNumber |
|
boundingPoly |
Bounding poly for the text content in the document. |
BoundingPoly
Bounding poly for the text content in the document.
JSON representation |
---|
{
"normalizedVertices": [
{
object ( |
Fields | |
---|---|
normalizedVertices[] |
|
NormalizedVertex
A vertex represents a 2D point in the image.
NOTE: the normalized vertex coordinates are relative to the original image and range from 0 to 1.
JSON representation |
---|
{ "x": number, "y": number } |
Fields | |
---|---|
x |
X coordinate. |
y |
Y coordinate (starts from the top of the image). |
SearchEntryPoint
Google Search entry point.
JSON representation |
---|
{ "renderedContent": string } |
Fields | |
---|---|
renderedContent |
Web content snippet that can be embedded in a web page or an app webview. |
AssistantContent
Multi-modal content.
JSON representation |
---|
{ "role": string, "thought": boolean, // Union field |
Fields | |
---|---|
role |
The producer of the content. Can be "model" or "user". |
thought |
Optional. Indicates if the part is thought from the model. |
Union field data . Contained data. data can be only one of the following: |
|
text |
Inline text. |
inlineData |
Inline binary data. |
file |
A file, e.g., an audio summary. |
executableCode |
code generated by the model that is meant to be executed. |
codeExecutionResult |
Result of executing an ExecutableCode. |
Blob
Inline blob.
JSON representation |
---|
{ "mimeType": string, "data": string } |
Fields | |
---|---|
mimeType |
Required. The media type (MIME type) of the generated data. |
data |
Required. Raw bytes. A base64-encoded string. |
File
A file, e.g., an audio summary.
JSON representation |
---|
{ "mimeType": string, "fileId": string } |
Fields | |
---|---|
mimeType |
Required. The media type (MIME type) of the file. |
fileId |
Required. The file id. |
ExecutableCode
code generated by the model that is meant to be executed by the model.
JSON representation |
---|
{ "code": string } |
Fields | |
---|---|
code |
Required. The code content. Currently only supports Python. |
CodeExecutionResult
Result of executing ExecutableCode.
JSON representation |
---|
{
"outcome": enum ( |
Fields | |
---|---|
outcome |
Required. Outcome of the code execution. |
output |
Optional. Contains stdout when code execution is successful, stderr or other description otherwise. |
Outcome
Enumeration of possible outcomes of the code execution.
Enums | |
---|---|
OUTCOME_UNSPECIFIED |
Unspecified status. This value should not be used. |
OUTCOME_OK |
code execution completed successfully. |
OUTCOME_FAILED |
code execution finished but with a failure. stderr should contain the reason. |
OUTCOME_DEADLINE_EXCEEDED |
code execution ran for too long, and was cancelled. There may or may not be a partial output present. |
ContentMetadata
metadata for the content.
JSON representation |
---|
{
"contentKind": enum ( |
Fields | |
---|---|
contentKind |
type of the content. Shows which part of the answer of the research assistant this content belongs to. |
contentId |
id of the content. It is used to connect research questions with answers to them. For example, the parts of the answer to a research question will have the same |
ContentKind
Possible content kinds. Currently only used for differentiating sections in the full answer of a research assistant.
Enums | |
---|---|
CONTENT_KIND_UNSPECIFIED |
Unknown. |
RESEARCH_PLAN |
Research plan. |
RESEARCH_QUESTION |
Research question. |
RESEARCH_ANSWER |
Research answer. |
RESEARCH_REPORT |
Research report. |
RESEARCH_AUDIO_SUMMARY |
Research audio summary. |
AssistSkippedReason
Possible reasons for not answering an assist call.
Enums | |
---|---|
ASSIST_SKIPPED_REASON_UNSPECIFIED |
Default value. Skip reason is not specified. |
NON_ASSIST_SEEKING_QUERY_IGNORED |
The assistant ignored the query, because it did not appear to be answer-seeking. |
CUSTOMER_POLICY_VIOLATION |
The assistant ignored the query or refused to answer because of a customer policy violation (e.g., the query or the answer contained a banned phrase). |
CustomerPolicyEnforcementResult
Customer policy enforcement results. Contains the results of the various policy checks, like the banned phrases or the Model Armor checks.
JSON representation |
---|
{ "verdict": enum ( |
Fields | |
---|---|
verdict |
Final verdict of the customer policy enforcement. If only one policy blocked the processing, the verdict is BLOCK. |
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. |
Verdict
The verdict of the customer policy enforcement.
Enums | |
---|---|
UNSPECIFIED |
Unknown value. |
ALLOW |
There was no policy violation. |
BLOCK |
Processing was blocked by the customer policy. |
PolicyEnforcementResult
Customer policy enforcement result for a single policy type.
JSON representation |
---|
{ // Union field |
Fields | |
---|---|
Union field enforcement_result . The policy type specific result. It can be either an error or a detailed information about the policy enforcement result. enforcement_result can be only one of the following: |
|
bannedPhraseEnforcementResult |
The policy enforcement result for the banned phrase policy. |
modelArmorEnforcementResult |
The policy enforcement result for the Model Armor policy. |
BannedPhraseEnforcementResult
Customer policy enforcement result for the banned phrase policy.
JSON representation |
---|
{ "bannedPhrases": [ string ] } |
Fields | |
---|---|
bannedPhrases[] |
The banned phrases that were found in the query or the answer. |
ModelArmorEnforcementResult
Customer policy enforcement result for the Model Armor policy.
JSON representation |
---|
{ // Union field |
Fields | |
---|---|
Union field result . The Model Armor policy result. result can be only one of the following: |
|
modelArmorViolation |
The Model Armor violation that was found. |
error |
The error returned by Model Armor if the policy enforcement failed for some reason. |
Methods |
|
---|---|
|
Gets an AssistAnswer . |