Tool: conversational_search
Perform a conversational search on ingested data in Google owned data stores
The following sample demonstrate how to use curl to invoke the conversational_search MCP tool.
| Curl Request |
|---|
curl --location 'https://discoveryengine.googleapis.com/mcp' \ --header 'content-type: application/json' \ --header 'accept: application/json, text/event-stream' \ --data '{ "method": "tools/call", "params": { "name": "conversational_search", "arguments": { // provide these details according to the tool's MCP specification } }, "jsonrpc": "2.0", "id": 1 }' |
Input Schema
Request message for ConversationalSearchService.AnswerQuery method.
AnswerQueryRequest
| JSON representation |
|---|
{ "servingConfig": string, "query": { object ( |
| Fields | |
|---|---|
servingConfig |
Required. The resource name of the Search serving config, such as |
query |
Required. Current user query. |
session |
The session resource name. Not required. When session field is not set, the API is in sessionless mode. We support auto session mode: users can use the wildcard symbol |
safetySpec |
Model specification. |
relatedQuestionsSpec |
Related questions specification. |
groundingSpec |
Optional. Grounding specification. |
answerGenerationSpec |
Answer generation specification. |
searchSpec |
Search specification. |
queryUnderstandingSpec |
Query understanding specification. |
asynchronousMode |
Deprecated: This field is deprecated. Streaming Answer API will be supported. Asynchronous mode control. If enabled, the response will be returned with answer/session resource name without final answer. The API users need to do the polling to get the latest status of answer/session by calling |
userPseudoId |
A unique identifier for tracking visitors. For example, this could be implemented with an HTTP cookie, which should be able to uniquely identify a visitor on a single device. This unique identifier should not change if the visitor logs in or out of the website. This field should NOT have a fixed value such as The field must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an |
userLabels |
The user labels applied to a resource must meet the following requirements:
See Google Cloud Document for more details. An object containing a list of |
endUserSpec |
Optional. End user specification. |
Query
| JSON representation |
|---|
{ "queryId": string, // Union field |
| Fields | |
|---|---|
queryId |
Output only. Unique Id for the query. |
Union field content. Query content. content can be only one of the following: |
|
text |
Plain text. |
SafetySpec
| JSON representation |
|---|
{
"enable": boolean,
"safetySettings": [
{
object ( |
| Fields | |
|---|---|
enable |
Enable the safety filtering on the answer response. It is false by default. |
safetySettings[] |
Optional. Safety settings. This settings are effective only when the safety_spec.enable is true. |
SafetySetting
| JSON representation |
|---|
{ "category": enum ( |
| Fields | |
|---|---|
category |
Required. Harm category. |
threshold |
Required. The harm block threshold. |
RelatedQuestionsSpec
| JSON representation |
|---|
{ "enable": boolean } |
| Fields | |
|---|---|
enable |
Enable related questions feature if true. |
GroundingSpec
| JSON representation |
|---|
{
"includeGroundingSupports": boolean,
"filteringLevel": enum ( |
| Fields | |
|---|---|
includeGroundingSupports |
Optional. Specifies whether to include grounding_supports in the answer. The default value is When this field is set to |
filteringLevel |
Optional. Specifies whether to enable the filtering based on grounding score and at what level. |
AnswerGenerationSpec
| JSON representation |
|---|
{ "modelSpec": { object ( |
| Fields | |
|---|---|
modelSpec |
Answer generation model specification. |
promptSpec |
Answer generation prompt specification. |
includeCitations |
Specifies whether to include citation metadata in the answer. The default value is |
answerLanguageCode |
Language code for Answer. Use language tags defined by BCP47. Note: This is an experimental feature. |
ignoreAdversarialQuery |
Specifies whether to filter out adversarial queries. The default value is Google employs search-query classification to detect adversarial queries. No answer is returned if the search query is classified as an adversarial query. For example, a user might ask a question regarding negative comments about the company or submit a query designed to generate unsafe, policy-violating output. If this field is set to |
ignoreNonAnswerSeekingQuery |
Specifies whether to filter out queries that are not answer-seeking. The default value is Google employs search-query classification to detect answer-seeking queries. No answer is returned if the search query is classified as a non-answer seeking query. If this field is set to |
ignoreJailBreakingQuery |
Optional. Specifies whether to filter out jail-breaking queries. The default value is Google employs search-query classification to detect jail-breaking queries. No summary is returned if the search query is classified as a jail-breaking query. A user might add instructions to the query to change the tone, style, language, content of the answer, or ask the model to act as a different entity, e.g. "Reply in the tone of a competing company's CEO". If this field is set to |
multimodalSpec |
Optional. Multimodal specification. |
Union field
|
|
ignoreLowRelevantContent |
Specifies whether to filter out queries that have low relevance. If this field is set to |
ModelSpec
| JSON representation |
|---|
{ "modelVersion": string } |
| Fields | |
|---|---|
modelVersion |
Model version. If not set, it will use the default stable model. Allowed values are: stable, preview. |
PromptSpec
| JSON representation |
|---|
{ "preamble": string } |
| Fields | |
|---|---|
preamble |
Customized preamble. |
MultimodalSpec
| JSON representation |
|---|
{
"imageSource": enum ( |
| Fields | |
|---|---|
imageSource |
Optional. Source of image returned in the answer. |
SearchSpec
| JSON representation |
|---|
{ // Union field |
| Fields | |
|---|---|
Union field input. Search parameters to control the search behavior. Or provide search result list to generate answer. input can be only one of the following: |
|
searchParams |
Search parameters. |
searchResultList |
Search result list. |
SearchParams
| JSON representation |
|---|
{ "maxReturnResults": integer, "filter": string, "boostSpec": { object ( |
| Fields | |
|---|---|
maxReturnResults |
Number of search results to return. The default value is 10. |
filter |
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. This will be used to filter search results which may affect the Answer response. If this field is unrecognizable, an 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 customers 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 |
boostSpec |
Boost specification to boost certain documents in search results which may affect the answer query response. For more information on boosting, see Boosting |
orderBy |
The order in which documents are returned. Documents can be ordered by a field in an If this field is unrecognizable, an |
searchResultMode |
Specifies the search result mode. If unspecified, the search result mode defaults to |
customFineTuningSpec |
Custom fine tuning configs. |
dataStoreSpecs[] |
Specs defining dataStores to filter on in a search call and configurations for those dataStores. This is only considered for engines with multiple dataStores use case. For single dataStore within an engine, they should use the specs at the top level. |
naturalLanguageQueryUnderstandingSpec |
Optional. Specification to enable natural language understanding capabilities for search requests. |
BoostSpec
| JSON representation |
|---|
{
"conditionBoostSpecs": [
{
object ( |
| Fields | |
|---|---|
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. |
ConditionBoostSpec
| JSON representation |
|---|
{
"condition": string,
"boost": number,
"boostControlSpec": {
object ( |
| Fields | |
|---|---|
condition |
An expression which specifies a boost condition. The syntax and supported fields are the same as a filter expression. See Examples:
|
boost |
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 |
Complex specification for custom ranking based on customer defined attribute value. |
BoostControlSpec
| JSON representation |
|---|
{ "fieldName": string, "attributeType": enum ( |
| Fields | |
|---|---|
fieldName |
The name of the field whose value will be used to determine the boost amount. |
attributeType |
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). |
interpolationType |
The interpolation type to be applied to connect the control points listed below. |
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. |
ControlPoint
| JSON representation |
|---|
{ "attributeValue": string, "boostAmount": number } |
| Fields | |
|---|---|
attributeValue |
Can be one of: 1. The numerical field value. 2. The duration spec for freshness: The value must be formatted as an XSD |
boostAmount |
The value between -1 to 1 by which to boost the score if the attribute_value evaluates to the value specified above. |
CustomFineTuningSpec
| JSON representation |
|---|
{ "enableSearchAdaptor": boolean } |
| Fields | |
|---|---|
enableSearchAdaptor |
Whether or not to enable and include custom fine tuned search adaptor model. |
DataStoreSpec
| JSON representation |
|---|
{
"dataStore": string,
"filter": string,
"boostSpec": {
object ( |
| Fields | |
|---|---|
dataStore |
Required. Full resource name of |
filter |
Optional. Filter specification to filter documents in the data store specified by data_store field. For more information on filtering, see Filtering |
boostSpec |
Optional. Boost specification to boost certain documents. For more information on boosting, see Boosting |
customSearchOperators |
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. |
NaturalLanguageQueryUnderstandingSpec
| JSON representation |
|---|
{ "filterExtractionCondition": enum ( |
| Fields | |
|---|---|
filterExtractionCondition |
The condition under which filter extraction should occur. Server behavior defaults to |
geoSearchQueryDetectionFieldNames[] |
Field names used for location-based filtering, where geolocation filters are detected in natural language search queries. Only valid when the FilterExtractionCondition is set to If this field is set, it overrides the field names set in |
extractedFilterBehavior |
Optional. Controls behavior of how extracted filters are applied to the search. The default behavior depends on the request. For single datastore structured search, the default is |
allowedFieldNames[] |
Optional. Allowlist of fields that can be used for natural language filter extraction. By default, if this is unspecified, all indexable fields are eligible for natural language filter extraction (but are not guaranteed to be used). If any fields are specified in allowed_field_names, only the fields that are both marked as indexable in the schema and specified in the allowlist will be eligible for natural language filter extraction. Note: for multi-datastore search, this is not yet supported, and will be ignored. |
SearchResultList
| JSON representation |
|---|
{
"searchResults": [
{
object ( |
| Fields | |
|---|---|
searchResults[] |
Search results. |
SearchResult
| JSON representation |
|---|
{ // Union field |
| Fields | |
|---|---|
Union field content. Search result content. content can be only one of the following: |
|
unstructuredDocumentInfo |
Unstructured document information. |
chunkInfo |
Chunk information. |
UnstructuredDocumentInfo
| JSON representation |
|---|
{ "document": string, "uri": string, "title": string, "documentContexts": [ { object ( |
| Fields | |
|---|---|
document |
Document resource name. |
uri |
URI for the document. |
title |
Title. |
documentContexts[] |
List of document contexts. The content will be used for Answer Generation. This is supposed to be the main content of the document that can be long and comprehensive. |
extractiveSegments[] |
List of extractive segments. |
extractiveAnswers[] |
Deprecated: This field is deprecated and will have no effect on the Answer generation. Please use document_contexts and extractive_segments fields. List of extractive answers. |
DocumentContext
| JSON representation |
|---|
{ "pageIdentifier": string, "content": string } |
| Fields | |
|---|---|
pageIdentifier |
Page identifier. |
content |
Document content to be used for answer generation. |
ExtractiveSegment
| JSON representation |
|---|
{ "pageIdentifier": string, "content": string } |
| Fields | |
|---|---|
pageIdentifier |
Page identifier. |
content |
Extractive segment content. |
ExtractiveAnswer
| JSON representation |
|---|
{ "pageIdentifier": string, "content": string } |
| Fields | |
|---|---|
pageIdentifier |
Page identifier. |
content |
Extractive answer content. |
ChunkInfo
| JSON representation |
|---|
{
"chunk": string,
"content": string,
"documentMetadata": {
object ( |
| Fields | |
|---|---|
chunk |
Chunk resource name. |
content |
Chunk textual content. |
documentMetadata |
Metadata of the document from the current chunk. |
DocumentMetadata
| JSON representation |
|---|
{ "uri": string, "title": string } |
| Fields | |
|---|---|
uri |
Uri of the document. |
title |
Title of the document. |
QueryUnderstandingSpec
| JSON representation |
|---|
{ "queryClassificationSpec": { object ( |
| Fields | |
|---|---|
queryClassificationSpec |
Query classification specification. |
queryRephraserSpec |
Query rephraser specification. |
disableSpellCorrection |
Optional. Whether to disable spell correction. The default value is |
QueryClassificationSpec
| JSON representation |
|---|
{
"types": [
enum ( |
| Fields | |
|---|---|
types[] |
Enabled query classification types. |
QueryRephraserSpec
| JSON representation |
|---|
{
"disable": boolean,
"maxRephraseSteps": integer,
"modelSpec": {
object ( |
| Fields | |
|---|---|
disable |
Disable query rephraser. |
maxRephraseSteps |
Max rephrase steps. The max number is 5 steps. If not set or set to < 1, it will be set to 1 by default. |
modelSpec |
Optional. Query Rephraser Model specification. |
ModelSpec
| JSON representation |
|---|
{
"modelType": enum ( |
| Fields | |
|---|---|
modelType |
Optional. Enabled query rephraser model type. If not set, it will use LARGE by default. |
UserLabelsEntry
| JSON representation |
|---|
{ "key": string, "value": string } |
| Fields | |
|---|---|
key |
|
value |
|
EndUserSpec
| JSON representation |
|---|
{
"endUserMetadata": [
{
object ( |
| Fields | |
|---|---|
endUserMetadata[] |
Optional. End user metadata. |
EndUserMetaData
| JSON representation |
|---|
{ // Union field |
| Fields | |
|---|---|
Union field content. Search result content. content can be only one of the following: |
|
chunkInfo |
Chunk information. |
ChunkInfo
| JSON representation |
|---|
{
"content": string,
"documentMetadata": {
object ( |
| Fields | |
|---|---|
content |
Chunk textual content. It is limited to 8000 characters. |
documentMetadata |
Metadata of the document from the current chunk. |
DocumentMetadata
| JSON representation |
|---|
{ "title": string } |
| Fields | |
|---|---|
title |
Title of the document. |
Output Schema
Response message for ConversationalSearchService.AnswerQuery method.
AnswerQueryResponse
| JSON representation |
|---|
{ "answer": { object ( |
| Fields | |
|---|---|
answer |
Answer resource object. If |
session |
Session resource object. It will be only available when session field is set and valid in the |
answerQueryToken |
A global unique ID used for logging. |
Answer
| JSON representation |
|---|
{ "name": string, "state": enum ( |
| Fields | |
|---|---|
name |
Immutable. Fully qualified name |
state |
The state of the answer generation. |
answerText |
The textual answer. |
citations[] |
Citations. |
groundingSupports[] |
Optional. Grounding supports. |
references[] |
References. |
blobAttachments[] |
List of blob attachments in the answer. |
relatedQuestions[] |
Suggested related questions. |
steps[] |
Answer generation steps. |
queryUnderstandingInfo |
Query understanding information. |
answerSkippedReasons[] |
Additional answer-skipped reasons. This provides the reason for ignored cases. If nothing is skipped, this field is not set. |
createTime |
Output only. Answer creation timestamp. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: |
completeTime |
Output only. Answer completed timestamp. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: |
safetyRatings[] |
Optional. Safety ratings. |
Union field
|
|
groundingScore |
A score in the range of [0, 1] describing how grounded the answer is by the reference chunks. |
Citation
| JSON representation |
|---|
{
"startIndex": string,
"endIndex": string,
"sources": [
{
object ( |
| Fields | |
|---|---|
startIndex |
Index indicates the start of the segment, measured in bytes (UTF-8 unicode). If there are multi-byte characters,such as non-ASCII characters, the index measurement is longer than the string length. |
endIndex |
End of the attributed segment, exclusive. Measured in bytes (UTF-8 unicode). If there are multi-byte characters,such as non-ASCII characters, the index measurement is longer than the string length. |
sources[] |
Citation sources for the attributed segment. |
CitationSource
| JSON representation |
|---|
{ "referenceId": string } |
| Fields | |
|---|---|
referenceId |
ID of the citation source. |
GroundingSupport
| JSON representation |
|---|
{ "startIndex": string, "endIndex": string, "sources": [ { object ( |
| Fields | |
|---|---|
startIndex |
Required. Index indicates the start of the claim, measured in bytes (UTF-8 unicode). |
endIndex |
Required. End of the claim, exclusive. |
sources[] |
Optional. Citation sources for the claim. |
Union field
|
|
groundingScore |
A score in the range of [0, 1] describing how grounded is a specific claim by the references. Higher value means that the claim is better supported by the reference chunks. |
Union field
|
|
groundingCheckRequired |
Indicates that this claim required grounding check. When the system decided this claim didn't require attribution/grounding check, this field is set to false. In that case, no grounding check was done for the claim and therefore |
Reference
| JSON representation |
|---|
{ // Union field |
| Fields | |
|---|---|
Union field content. Search result content. content can be only one of the following: |
|
unstructuredDocumentInfo |
Unstructured document information. |
chunkInfo |
Chunk information. |
structuredDocumentInfo |
Structured document information. |
UnstructuredDocumentInfo
| JSON representation |
|---|
{
"document": string,
"uri": string,
"title": string,
"chunkContents": [
{
object ( |
| Fields | |
|---|---|
document |
Document resource name. |
uri |
URI for the document. |
title |
Title. |
chunkContents[] |
List of cited chunk contents derived from document content. |
structData |
The structured JSON metadata for the document. It is populated from the struct data from the Chunk in search result. |
ChunkContent
| JSON representation |
|---|
{ "content": string, "pageIdentifier": string, "blobAttachmentIndexes": [ string ], // Union field |
| Fields | |
|---|---|
content |
Chunk textual content. |
pageIdentifier |
Page identifier. |
blobAttachmentIndexes[] |
Output only. Stores indexes of blobattachments linked to this chunk. |
Union field
|
|
relevanceScore |
The relevance of the chunk for a given query. Values range from 0.0 (completely irrelevant) to 1.0 (completely relevant). This value is for informational purpose only. It may change for the same query and chunk at any time due to a model retraining or change in implementation. |
Struct
| JSON representation |
|---|
{ "fields": { string: value, ... } } |
| Fields | |
|---|---|
fields |
Unordered map of dynamically typed values. An object containing a list of |
FieldsEntry
| JSON representation |
|---|
{ "key": string, "value": value } |
| Fields | |
|---|---|
key |
|
value |
|
Value
| JSON representation |
|---|
{ // Union field |
| Fields | |
|---|---|
Union field kind. The kind of value. kind can be only one of the following: |
|
nullValue |
Represents a null value. |
numberValue |
Represents a double value. |
stringValue |
Represents a string value. |
boolValue |
Represents a boolean value. |
structValue |
Represents a structured value. |
listValue |
Represents a repeated |
ListValue
| JSON representation |
|---|
{ "values": [ value ] } |
| Fields | |
|---|---|
values[] |
Repeated field of dynamically typed values. |
ChunkInfo
| JSON representation |
|---|
{ "chunk": string, "content": string, "documentMetadata": { object ( |
| Fields | |
|---|---|
chunk |
Chunk resource name. |
content |
Chunk textual content. |
documentMetadata |
Document metadata. |
blobAttachmentIndexes[] |
Output only. Stores indexes of blobattachments linked to this chunk. |
Union field
|
|
relevanceScore |
The relevance of the chunk for a given query. Values range from 0.0 (completely irrelevant) to 1.0 (completely relevant). This value is for informational purpose only. It may change for the same query and chunk at any time due to a model retraining or change in implementation. |
DocumentMetadata
| JSON representation |
|---|
{ "document": string, "uri": string, "title": string, "pageIdentifier": string, "structData": { object } } |
| Fields | |
|---|---|
document |
Document resource name. |
uri |
URI for the document. |
title |
Title. |
pageIdentifier |
Page identifier. |
structData |
The structured JSON metadata for the document. It is populated from the struct data from the Chunk in search result. |
StructuredDocumentInfo
| JSON representation |
|---|
{ "document": string, "structData": { object }, "title": string, "uri": string } |
| Fields | |
|---|---|
document |
Document resource name. |
structData |
Structured search data. |
title |
Output only. The title of the document. |
uri |
Output only. The URI of the document. |
BlobAttachment
| JSON representation |
|---|
{ "data": { object ( |
| Fields | |
|---|---|
data |
Output only. The mime type and data of the blob. |
attributionType |
Output only. The attribution type of the blob. |
Blob
| JSON representation |
|---|
{ "mimeType": string, "data": string } |
| Fields | |
|---|---|
mimeType |
Output only. The media type (MIME type) of the generated or retrieved data. |
data |
Output only. Raw bytes. A base64-encoded string. |
Step
| JSON representation |
|---|
{ "state": enum ( |
| Fields | |
|---|---|
state |
The state of the step. |
description |
The description of the step. |
thought |
The thought of the step. |
actions[] |
Actions. |
Action
| JSON representation |
|---|
{ "observation": { object ( |
| Fields | |
|---|---|
observation |
Observation. |
Union field action. The action. action can be only one of the following: |
|
searchAction |
Search action. |
SearchAction
| JSON representation |
|---|
{ "query": string } |
| Fields | |
|---|---|
query |
The query to search. |
Observation
| JSON representation |
|---|
{
"searchResults": [
{
object ( |
| Fields | |
|---|---|
searchResults[] |
Search results observed by the search action, it can be snippets info or chunk info, depending on the citation type set by the user. |
SearchResult
| JSON representation |
|---|
{ "document": string, "uri": string, "title": string, "snippetInfo": [ { object ( |
| Fields | |
|---|---|
document |
Document resource name. |
uri |
URI for the document. |
title |
Title. |
snippetInfo[] |
If citation_type is DOCUMENT_LEVEL_CITATION, populate document level snippets. |
chunkInfo[] |
If citation_type is CHUNK_LEVEL_CITATION and chunk mode is on, populate chunk info. |
structData |
Data representation. The structured JSON data for the document. It's populated from the struct data from the Document, or the Chunk in search result. |
SnippetInfo
| JSON representation |
|---|
{ "snippet": string, "snippetStatus": string } |
| Fields | |
|---|---|
snippet |
Snippet content. |
snippetStatus |
Status of the snippet defined by the search team. |
ChunkInfo
| JSON representation |
|---|
{ "chunk": string, "content": string, // Union field |
| Fields | |
|---|---|
chunk |
Chunk resource name. |
content |
Chunk textual content. |
Union field
|
|
relevanceScore |
The relevance of the chunk for a given query. Values range from 0.0 (completely irrelevant) to 1.0 (completely relevant). This value is for informational purpose only. It may change for the same query and chunk at any time due to a model retraining or change in implementation. |
QueryUnderstandingInfo
| JSON representation |
|---|
{
"queryClassificationInfo": [
{
object ( |
| Fields | |
|---|---|
queryClassificationInfo[] |
Query classification information. |
QueryClassificationInfo
| JSON representation |
|---|
{
"type": enum ( |
| Fields | |
|---|---|
type |
Query classification type. |
positive |
Classification output. |
Timestamp
| JSON representation |
|---|
{ "seconds": string, "nanos": integer } |
| Fields | |
|---|---|
seconds |
Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. Must be between -62135596800 and 253402300799 inclusive (which corresponds to 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z). |
nanos |
Non-negative fractions of a second at nanosecond resolution. This field is the nanosecond portion of the duration, not an alternative to seconds. Negative second values with fractions must still have non-negative nanos values that count forward in time. Must be between 0 and 999,999,999 inclusive. |
SafetyRating
| JSON representation |
|---|
{ "category": enum ( |
| Fields | |
|---|---|
category |
Output only. Harm category. |
probability |
Output only. Harm probability levels in the content. |
probabilityScore |
Output only. Harm probability score. |
severity |
Output only. Harm severity levels in the content. |
severityScore |
Output only. Harm severity score. |
blocked |
Output only. Indicates whether the content was filtered out because of this rating. |
Session
| JSON representation |
|---|
{ "name": string, "displayName": string, "state": enum ( |
| Fields | |
|---|---|
name |
Immutable. Fully qualified name |
displayName |
Optional. The display name of the session. This field is used to identify the session in the UI. By default, the display name is the first turn query text in the session. |
state |
The state of the session. |
userPseudoId |
A unique identifier for tracking users. |
turns[] |
Turns. |
labels[] |
Optional. The labels for the session. Can be set as filter in ListSessionsRequest. |
startTime |
Output only. The time the session started. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: |
endTime |
Output only. The time the session finished. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: |
isPinned |
Optional. Whether the session is pinned, pinned session will be displayed on the top of the session list. |
Turn
| JSON representation |
|---|
{ "query": { object ( |
| Fields | |
|---|---|
query |
Optional. The user query. May not be set if this turn is merely regenerating an answer to a different turn |
answer |
Optional. The resource name of the answer to the user query. Only set if the answer generation (/answer API call) happened in this turn. |
detailedAnswer |
Output only. In |
detailedAssistAnswer |
Output only. In |
queryConfig |
Optional. Represents metadata related to the query config, for example LLM model and version used, model parameters (temperature, grounding parameters, etc.). The prefix "google." is reserved for Google-developed functionality. An object containing a list of |
Query
| JSON representation |
|---|
{ "queryId": string, // Union field |
| Fields | |
|---|---|
queryId |
Output only. Unique Id for the query. |
Union field content. Query content. content can be only one of the following: |
|
text |
Plain text. |
AssistAnswer
| 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. |
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. |
Reply
| JSON representation |
|---|
{ "replyId": string, // Union field |
| Fields | |
|---|---|
replyId |
Output only. When set, uniquely identifies a reply within the |
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
| JSON representation |
|---|
{ "content": { object ( |
| Fields | |
|---|---|
content |
The content. |
citationMetadata |
Source attribution of the generated content. See also https://cloud.google.com/vertex-ai/generative-ai/docs/learn/overview#citation_check |
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
| JSON representation |
|---|
{ "segments": [ { object ( |
| Fields | |
|---|---|
segments[] |
Grounding information for parts of the text. |
references[] |
References for the grounded text. |
Segment
| 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
| JSON representation |
|---|
{
"content": string,
"documentMetadata": {
object ( |
| Fields | |
|---|---|
content |
Referenced text content. |
documentMetadata |
Document metadata. |
DocumentMetadata
| JSON representation |
|---|
{ // Union field |
| Fields | |
|---|---|
Union field
|
|
document |
Document resource name. |
Union field
|
|
uri |
URI for the document. It may contain a URL that redirects to the actual website. |
Union field
|
|
title |
Title. |
Union field
|
|
pageIdentifier |
Page identifier. |
Union field
|
|
domain |
Domain name from the document URI. Note that the |
Union field
|
|
mimeType |
The mime type of the document. https://www.iana.org/assignments/media-types/media-types.xhtml. |
AssistantContent
| 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
| 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
| JSON representation |
|---|
{ "mimeType": string, "fileId": string } |
| Fields | |
|---|---|
mimeType |
Required. The media type (MIME type) of the file. |
fileId |
Required. The file ID. |
ExecutableCode
| JSON representation |
|---|
{ "code": string } |
| Fields | |
|---|---|
code |
Required. The code content. Currently only supports Python. |
CodeExecutionResult
| 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. |
CitationMetadata
| JSON representation |
|---|
{
"citations": [
{
object ( |
| Fields | |
|---|---|
citations[] |
Output only. List of citations. |
Citation
| JSON representation |
|---|
{
"startIndex": integer,
"endIndex": integer,
"uri": string,
"title": string,
"license": string,
"publicationDate": {
object ( |
| Fields | |
|---|---|
startIndex |
Output only. Start index into the content. |
endIndex |
Output only. End index into the content. |
uri |
Output only. Url reference of the attribution. |
title |
Output only. Title of the attribution. |
license |
Output only. License of the attribution. |
publicationDate |
Output only. Publication date of the attribution. |
Date
| JSON representation |
|---|
{ "year": integer, "month": integer, "day": integer } |
| Fields | |
|---|---|
year |
Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year. |
month |
Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day. |
day |
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. |
CustomerPolicyEnforcementResult
| 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. |
PolicyEnforcementResult
| 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
| JSON representation |
|---|
{ "bannedPhrases": [ string ] } |
| Fields | |
|---|---|
bannedPhrases[] |
The banned phrases that were found in the query or the answer. |
ModelArmorEnforcementResult
| 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. |
Status
| JSON representation |
|---|
{ "code": integer, "message": string, "details": [ { "@type": string, field1: ..., ... } ] } |
| Fields | |
|---|---|
code |
The status code, which should be an enum value of |
message |
A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the |
details[] |
A list of messages that carry the error details. There is a common set of message types for APIs to use. An object containing fields of an arbitrary type. An additional field |
Any
| JSON representation |
|---|
{ "typeUrl": string, "value": string } |
| Fields | |
|---|---|
typeUrl |
A URL/resource name that uniquely identifies the type of the serialized protocol buffer message. This string must contain at least one "/" character. The last segment of the URL's path must represent the fully qualified name of the type (as in In practice, teams usually precompile into the binary all types that they expect it to use in the context of Any. However, for URLs which use the scheme
Note: this functionality is not currently available in the official protobuf release, and it is not used for type URLs beginning with type.googleapis.com. As of May 2023, there are no widely used type server implementations and no plans to implement one. Schemes other than |
value |
Must be a valid serialized protocol buffer of the above specified type. A base64-encoded string. |
QueryConfigEntry
| JSON representation |
|---|
{ "key": string, "value": string } |
| Fields | |
|---|---|
key |
|
value |
|
Tool Annotations
Destructive Hint: ❌ | Idempotent Hint: ✅ | Read Only Hint: ✅ | Open World Hint: ❌