Close httplib2 connections.
converse(name, body=None, x__xgafv=None)
Converses a conversation.
create(parent, body=None, x__xgafv=None)
Creates a Conversation. If the Conversation to create already exists, an ALREADY_EXISTS error is returned.
Deletes a Conversation. If the Conversation to delete does not exist, a NOT_FOUND error is returned.
Gets a Conversation.
list(parent, filter=None, orderBy=None, pageSize=None, pageToken=None, x__xgafv=None)
Lists all Conversations by their parent DataStore.
Retrieves the next page of results.
patch(name, body=None, updateMask=None, x__xgafv=None)
Updates a Conversation. Conversation action type cannot be changed. If the Conversation to update does not exist, a NOT_FOUND error is returned.
close()
Close httplib2 connections.
converse(name, body=None, x__xgafv=None)
Converses a conversation. Args: name: string, Required. The resource name of the Conversation to get. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`. Use `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/conversations/-` to activate auto session mode, which automatically creates a new conversation inside a ConverseConversation session. (required) body: object, The request body. The object takes the form of: { # Request message for ConversationalSearchService.ConverseConversation method. "boostSpec": { # Boost specification to boost certain documents. # Boost specification to boost certain documents in search results which may affect the converse response. For more information on boosting, see [Boosting](https://cloud.google.com/retail/docs/boosting#boost) "conditionBoostSpecs": [ # Condition boost specifications. If a document matches multiple conditions in the specifictions, 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"))` }, ], }, "conversation": { # External conversation proto definition. # The conversation to be used by auto session only. The name field will be ignored as we automatically assign new name for the conversation in auto session. "endTime": "A String", # Output only. The time the conversation finished. "messages": [ # Conversation messages. { # Defines a conversation message. "createTime": "A String", # Output only. Message creation timestamp. "reply": { # Defines a reply message to user. # Search reply. "references": [ # References in the reply. { # Defines reference in reply. "anchorText": "A String", # Anchor text. "end": 42, # Anchor text end index. "start": 42, # Anchor text start index. "uri": "A String", # URI link reference. }, ], "reply": "A String", # DEPRECATED: use `summary` instead. Text reply. "summary": { # Summary of the top N search results specified by the summary spec. # Summary based on search results. "safetyAttributes": { # Safety Attribute categories and their associated confidence scores. # A collection of Safety Attribute categories and their associated confidence scores. "categories": [ # The display names of Safety Attribute categories associated with the generated content. Order matches the Scores. "A String", ], "scores": [ # The confidence scores of the each category, higher value means higher confidence. Order matches the Categories. 3.14, ], }, "summarySkippedReasons": [ # Additional summary-skipped reasons. This provides the reason for ignored cases. If nothing is skipped, this field is not set. "A String", ], "summaryText": "A String", # The summary content. "summaryWithMetadata": { # Summary with metadata information. # Summary with metadata information. "citationMetadata": { # Citation metadata. # Citation metadata for given summary. "citations": [ # Citations for segments. { # Citation info for a segment. "endIndex": "A String", # End of the attributed segment, exclusive. "sources": [ # Citation sources for the attributed segment. { # Citation source. "referenceIndex": "A String", # Document reference index from SummaryWithMetadata.references. It is 0-indexed and the value will be zero if the reference_index is not set explicitly. }, ], "startIndex": "A String", # Index indicates the start of the segment, measured in bytes/unicode. }, ], }, "references": [ # Document References. { # Document reference. "chunkContents": [ # List of cited chunk contents derived from document content. { # Chunk content. "content": "A String", # Chunk textual content. "pageIdentifier": "A String", # Page identifier. }, ], "document": "A String", # Required. Document.name of the document. Full resource name of the referenced document, in the format `projects/*/locations/*/collections/*/dataStores/*/branches/*/documents/*`. "title": "A String", # Title of the document. "uri": "A String", # Cloud Storage or HTTP uri for the document. }, ], "summary": "A String", # Summary text with no citation information. }, }, }, "userInput": { # Defines text input. # User text input. "context": { # Defines context of the conversation # Conversation context of the input. "activeDocument": "A String", # The current active document the user opened. It contains the document resource reference. "contextDocuments": [ # The current list of documents the user is seeing. It contains the document resource references. "A String", ], }, "input": "A String", # Text input. }, }, ], "name": "A String", # Immutable. Fully qualified name `projects/{project}/locations/global/collections/{collection}/dataStore/*/conversations/*` or `projects/{project}/locations/global/collections/{collection}/engines/*/conversations/*`. "startTime": "A String", # Output only. The time the conversation started. "state": "A String", # The state of the Conversation. "userPseudoId": "A String", # A unique identifier for tracking users. }, "filter": "A String", # 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 summary response. 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) "query": { # Defines text input. # Required. Current user input. "context": { # Defines context of the conversation # Conversation context of the input. "activeDocument": "A String", # The current active document the user opened. It contains the document resource reference. "contextDocuments": [ # The current list of documents the user is seeing. It contains the document resource references. "A String", ], }, "input": "A String", # Text input. }, "safeSearch": True or False, # Whether to turn on safe search. "servingConfig": "A String", # The resource name of the Serving Config to use. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/servingConfigs/{serving_config_id}` If this is not set, the default serving config will be used. "summarySpec": { # A specification for configuring a summary returned in a search response. # A specification for configuring the summary returned in the response. "ignoreAdversarialQuery": True or False, # Specifies whether to filter out adversarial queries. The default value is `false`. Google employs search-query classification to detect adversarial queries. No summary 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 `true`, we skip generating summaries for adversarial queries and return fallback messages instead. "ignoreJailBreakingQuery": True or False, # Optional. Specifies whether to filter out jail-breaking queries. The default value is `false`. 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 `true`, we skip generating summaries for jail-breaking queries and return fallback messages instead. "ignoreLowRelevantContent": True or False, # Specifies whether to filter out queries that have low relevance. The default value is `false`. If this field is set to `false`, all search results are used regardless of relevance to generate answers. If set to `true`, only queries with high relevance search results will generate answers. "ignoreNonSummarySeekingQuery": True or False, # Specifies whether to filter out queries that are not summary-seeking. The default value is `false`. Google employs search-query classification to detect summary-seeking queries. No summary is returned if the search query is classified as a non-summary seeking query. For example, `why is the sky blue` and `Who is the best soccer player in the world?` are summary-seeking queries, but `SFO airport` and `world cup 2026` are not. They are most likely navigational queries. If this field is set to `true`, we skip generating summaries for non-summary seeking queries and return fallback messages instead. "includeCitations": True or False, # Specifies whether to include citations in the summary. The default value is `false`. When this field is set to `true`, summaries include in-line citation numbers. Example summary including citations: BigQuery is Google Cloud's fully managed and completely serverless enterprise data warehouse [1]. BigQuery supports all data types, works across clouds, and has built-in machine learning and business intelligence, all within a unified platform [2, 3]. The citation numbers refer to the returned search results and are 1-indexed. For example, [1] means that the sentence is attributed to the first search result. [2, 3] means that the sentence is attributed to both the second and third search results. "languageCode": "A String", # Language code for Summary. Use language tags defined by [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt). Note: This is an experimental feature. "modelPromptSpec": { # Specification of the prompt to use with the model. # If specified, the spec will be used to modify the prompt provided to the LLM. "preamble": "A String", # Text at the beginning of the prompt that instructs the assistant. Examples are available in the user guide. }, "modelSpec": { # Specification of the model. # If specified, the spec will be used to modify the model specification provided to the LLM. "version": "A String", # The model version used to generate the summary. Supported values are: * `stable`: string. Default value when no value is specified. Uses a generally available, fine-tuned model. For more information, see [Answer generation model versions and lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models). * `preview`: string. (Public preview) Uses a preview model. For more information, see [Answer generation model versions and lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models). }, "summaryResultCount": 42, # The number of top results to generate the summary from. If the number of results returned is less than `summaryResultCount`, the summary is generated from all of the results. At most 10 results for documents mode, or 50 for chunks mode, can be used to generate a summary. The chunks mode is used when SearchRequest.ContentSearchSpec.search_result_mode is set to CHUNKS. "useSemanticChunks": True or False, # If true, answer will be generated from most relevant chunks from top search results. This feature will improve summary quality. Note that with this feature enabled, not all top search results will be referenced and included in the reference list, so the citation source index only points to the search results listed in the reference list. }, "userLabels": { # The user labels applied to a resource must meet the following requirements: * Each resource can have multiple labels, up to a maximum of 64. * Each label must be a key-value pair. * Keys have a minimum length of 1 character and a maximum length of 63 characters and cannot be empty. Values can be empty and have a maximum length of 63 characters. * Keys and values can contain only lowercase letters, numeric characters, underscores, and dashes. All characters must use UTF-8 encoding, and international characters are allowed. * The key portion of a label must be unique. However, you can use the same key with multiple resources. * Keys must start with a lowercase letter or international character. See [Google Cloud Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) for more details. "a_key": "A String", }, } 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 ConversationalSearchService.ConverseConversation method. "conversation": { # External conversation proto definition. # Updated conversation including the answer. "endTime": "A String", # Output only. The time the conversation finished. "messages": [ # Conversation messages. { # Defines a conversation message. "createTime": "A String", # Output only. Message creation timestamp. "reply": { # Defines a reply message to user. # Search reply. "references": [ # References in the reply. { # Defines reference in reply. "anchorText": "A String", # Anchor text. "end": 42, # Anchor text end index. "start": 42, # Anchor text start index. "uri": "A String", # URI link reference. }, ], "reply": "A String", # DEPRECATED: use `summary` instead. Text reply. "summary": { # Summary of the top N search results specified by the summary spec. # Summary based on search results. "safetyAttributes": { # Safety Attribute categories and their associated confidence scores. # A collection of Safety Attribute categories and their associated confidence scores. "categories": [ # The display names of Safety Attribute categories associated with the generated content. Order matches the Scores. "A String", ], "scores": [ # The confidence scores of the each category, higher value means higher confidence. Order matches the Categories. 3.14, ], }, "summarySkippedReasons": [ # Additional summary-skipped reasons. This provides the reason for ignored cases. If nothing is skipped, this field is not set. "A String", ], "summaryText": "A String", # The summary content. "summaryWithMetadata": { # Summary with metadata information. # Summary with metadata information. "citationMetadata": { # Citation metadata. # Citation metadata for given summary. "citations": [ # Citations for segments. { # Citation info for a segment. "endIndex": "A String", # End of the attributed segment, exclusive. "sources": [ # Citation sources for the attributed segment. { # Citation source. "referenceIndex": "A String", # Document reference index from SummaryWithMetadata.references. It is 0-indexed and the value will be zero if the reference_index is not set explicitly. }, ], "startIndex": "A String", # Index indicates the start of the segment, measured in bytes/unicode. }, ], }, "references": [ # Document References. { # Document reference. "chunkContents": [ # List of cited chunk contents derived from document content. { # Chunk content. "content": "A String", # Chunk textual content. "pageIdentifier": "A String", # Page identifier. }, ], "document": "A String", # Required. Document.name of the document. Full resource name of the referenced document, in the format `projects/*/locations/*/collections/*/dataStores/*/branches/*/documents/*`. "title": "A String", # Title of the document. "uri": "A String", # Cloud Storage or HTTP uri for the document. }, ], "summary": "A String", # Summary text with no citation information. }, }, }, "userInput": { # Defines text input. # User text input. "context": { # Defines context of the conversation # Conversation context of the input. "activeDocument": "A String", # The current active document the user opened. It contains the document resource reference. "contextDocuments": [ # The current list of documents the user is seeing. It contains the document resource references. "A String", ], }, "input": "A String", # Text input. }, }, ], "name": "A String", # Immutable. Fully qualified name `projects/{project}/locations/global/collections/{collection}/dataStore/*/conversations/*` or `projects/{project}/locations/global/collections/{collection}/engines/*/conversations/*`. "startTime": "A String", # Output only. The time the conversation started. "state": "A String", # The state of the Conversation. "userPseudoId": "A String", # A unique identifier for tracking users. }, "relatedQuestions": [ # Suggested related questions. "A String", ], "reply": { # Defines a reply message to user. # Answer to the current query. "references": [ # References in the reply. { # Defines reference in reply. "anchorText": "A String", # Anchor text. "end": 42, # Anchor text end index. "start": 42, # Anchor text start index. "uri": "A String", # URI link reference. }, ], "reply": "A String", # DEPRECATED: use `summary` instead. Text reply. "summary": { # Summary of the top N search results specified by the summary spec. # Summary based on search results. "safetyAttributes": { # Safety Attribute categories and their associated confidence scores. # A collection of Safety Attribute categories and their associated confidence scores. "categories": [ # The display names of Safety Attribute categories associated with the generated content. Order matches the Scores. "A String", ], "scores": [ # The confidence scores of the each category, higher value means higher confidence. Order matches the Categories. 3.14, ], }, "summarySkippedReasons": [ # Additional summary-skipped reasons. This provides the reason for ignored cases. If nothing is skipped, this field is not set. "A String", ], "summaryText": "A String", # The summary content. "summaryWithMetadata": { # Summary with metadata information. # Summary with metadata information. "citationMetadata": { # Citation metadata. # Citation metadata for given summary. "citations": [ # Citations for segments. { # Citation info for a segment. "endIndex": "A String", # End of the attributed segment, exclusive. "sources": [ # Citation sources for the attributed segment. { # Citation source. "referenceIndex": "A String", # Document reference index from SummaryWithMetadata.references. It is 0-indexed and the value will be zero if the reference_index is not set explicitly. }, ], "startIndex": "A String", # Index indicates the start of the segment, measured in bytes/unicode. }, ], }, "references": [ # Document References. { # Document reference. "chunkContents": [ # List of cited chunk contents derived from document content. { # Chunk content. "content": "A String", # Chunk textual content. "pageIdentifier": "A String", # Page identifier. }, ], "document": "A String", # Required. Document.name of the document. Full resource name of the referenced document, in the format `projects/*/locations/*/collections/*/dataStores/*/branches/*/documents/*`. "title": "A String", # Title of the document. "uri": "A String", # Cloud Storage or HTTP uri for the document. }, ], "summary": "A String", # Summary text with no citation information. }, }, }, "searchResults": [ # Search Results. { # Represents the search results. "chunk": { # Chunk captures all raw metadata information of items to be recommended or searched in the chunk mode. # The chunk data in the search response if the SearchRequest.ContentSearchSpec.search_result_mode is set to CHUNKS. "chunkMetadata": { # Metadata of the current chunk. This field is only populated on SearchService.Search API. # Output only. Metadata of the current chunk. "nextChunks": [ # The next chunks of the current chunk. The number is controlled by SearchRequest.ContentSearchSpec.ChunkSpec.num_next_chunks. This field is only populated on SearchService.Search API. # Object with schema name: GoogleCloudDiscoveryengineV1betaChunk ], "previousChunks": [ # The previous chunks of the current chunk. The number is controlled by SearchRequest.ContentSearchSpec.ChunkSpec.num_previous_chunks. This field is only populated on SearchService.Search API. # Object with schema name: GoogleCloudDiscoveryengineV1betaChunk ], }, "content": "A String", # Content is a string from a document (parsed content). "derivedStructData": { # Output only. This field is OUTPUT_ONLY. It contains derived data that are not in the original input document. "a_key": "", # Properties of the object. }, "documentMetadata": { # Document metadata contains the information of the document of the current chunk. # Metadata of the document from the current chunk. "structData": { # Data representation. The structured JSON data for the document. It should conform to the registered Schema or an `INVALID_ARGUMENT` error is thrown. "a_key": "", # Properties of the object. }, "title": "A String", # Title of the document. "uri": "A String", # Uri of the document. }, "id": "A String", # Unique chunk ID of the current chunk. "name": "A String", # The full resource name of the chunk. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document_id}/chunks/{chunk_id}`. This field must be a UTF-8 encoded string with a length limit of 1024 characters. "pageSpan": { # Page span of the chunk. # Page span of the chunk. "pageEnd": 42, # The end page of the chunk. "pageStart": 42, # The start page of the chunk. }, "relevanceScore": 3.14, # Output only. Represents the relevance score based on similarity. Higher score indicates higher chunk relevance. The score is in range [-1.0, 1.0]. Only populated on SearchResponse. }, "document": { # Document captures all raw metadata information of items to be recommended or searched. # The document data snippet in the search response. Only fields that are marked as `retrievable` are populated. "content": { # Unstructured data linked to this document. # The unstructured data linked to this document. Content must be set if this document is under a `CONTENT_REQUIRED` data store. "mimeType": "A String", # The MIME type of the content. Supported types: * `application/pdf` (PDF, only native PDFs are supported for now) * `text/html` (HTML) * `application/vnd.openxmlformats-officedocument.wordprocessingml.document` (DOCX) * `application/vnd.openxmlformats-officedocument.presentationml.presentation` (PPTX) * `text/plain` (TXT) See https://www.iana.org/assignments/media-types/media-types.xhtml. "rawBytes": "A String", # The content represented as a stream of bytes. The maximum length is 1,000,000 bytes (1 MB / ~0.95 MiB). Note: As with all `bytes` fields, this field is represented as pure binary in Protocol Buffers and base64-encoded string in JSON. For example, `abc123!?$*&()'-=@~` should be represented as `YWJjMTIzIT8kKiYoKSctPUB+` in JSON. See https://developers.google.com/protocol-buffers/docs/proto3#json. "uri": "A String", # The URI of the content. Only Cloud Storage URIs (e.g. `gs://bucket-name/path/to/file`) are supported. The maximum file size is 2.5 MB for text-based formats, 200 MB for other formats. }, "derivedStructData": { # Output only. This field is OUTPUT_ONLY. It contains derived data that are not in the original input document. "a_key": "", # Properties of the object. }, "id": "A String", # Immutable. The identifier of the document. Id should conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) standard with a length limit of 63 characters. "indexStatus": { # Index status of the document. # Output only. The index status of the document. * If document is indexed successfully, the index_time field is populated. * Otherwise, if document is not indexed due to errors, the error_samples field is populated. * Otherwise, index_status is unset. "errorSamples": [ # A sample of errors encountered while indexing the document. If this field is populated, the document is not indexed due to errors. { # 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). "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. }, ], "indexTime": "A String", # The time when the document was indexed. If this field is populated, it means the document has been indexed. }, "indexTime": "A String", # Output only. The last time the document was indexed. If this field is set, the document could be returned in search results. This field is OUTPUT_ONLY. If this field is not populated, it means the document has never been indexed. "jsonData": "A String", # The JSON string representation of the document. It should conform to the registered Schema or an `INVALID_ARGUMENT` error is thrown. "name": "A String", # Immutable. The full resource name of the document. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document_id}`. This field must be a UTF-8 encoded string with a length limit of 1024 characters. "parentDocumentId": "A String", # The identifier of the parent document. Currently supports at most two level document hierarchy. Id should conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) standard with a length limit of 63 characters. "schemaId": "A String", # The identifier of the schema located in the same data store. "structData": { # The structured JSON data for the document. It should conform to the registered Schema or an `INVALID_ARGUMENT` error is thrown. "a_key": "", # Properties of the object. }, }, "id": "A String", # Document.id of the searched Document. "modelScores": { # Google provided available scores. "a_key": { # Double list. "values": [ # Double values. 3.14, ], }, }, }, ], }
create(parent, body=None, x__xgafv=None)
Creates a Conversation. If the Conversation to create already exists, an ALREADY_EXISTS error is returned. Args: parent: string, Required. Full resource name of parent data store. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}` (required) body: object, The request body. The object takes the form of: { # External conversation proto definition. "endTime": "A String", # Output only. The time the conversation finished. "messages": [ # Conversation messages. { # Defines a conversation message. "createTime": "A String", # Output only. Message creation timestamp. "reply": { # Defines a reply message to user. # Search reply. "references": [ # References in the reply. { # Defines reference in reply. "anchorText": "A String", # Anchor text. "end": 42, # Anchor text end index. "start": 42, # Anchor text start index. "uri": "A String", # URI link reference. }, ], "reply": "A String", # DEPRECATED: use `summary` instead. Text reply. "summary": { # Summary of the top N search results specified by the summary spec. # Summary based on search results. "safetyAttributes": { # Safety Attribute categories and their associated confidence scores. # A collection of Safety Attribute categories and their associated confidence scores. "categories": [ # The display names of Safety Attribute categories associated with the generated content. Order matches the Scores. "A String", ], "scores": [ # The confidence scores of the each category, higher value means higher confidence. Order matches the Categories. 3.14, ], }, "summarySkippedReasons": [ # Additional summary-skipped reasons. This provides the reason for ignored cases. If nothing is skipped, this field is not set. "A String", ], "summaryText": "A String", # The summary content. "summaryWithMetadata": { # Summary with metadata information. # Summary with metadata information. "citationMetadata": { # Citation metadata. # Citation metadata for given summary. "citations": [ # Citations for segments. { # Citation info for a segment. "endIndex": "A String", # End of the attributed segment, exclusive. "sources": [ # Citation sources for the attributed segment. { # Citation source. "referenceIndex": "A String", # Document reference index from SummaryWithMetadata.references. It is 0-indexed and the value will be zero if the reference_index is not set explicitly. }, ], "startIndex": "A String", # Index indicates the start of the segment, measured in bytes/unicode. }, ], }, "references": [ # Document References. { # Document reference. "chunkContents": [ # List of cited chunk contents derived from document content. { # Chunk content. "content": "A String", # Chunk textual content. "pageIdentifier": "A String", # Page identifier. }, ], "document": "A String", # Required. Document.name of the document. Full resource name of the referenced document, in the format `projects/*/locations/*/collections/*/dataStores/*/branches/*/documents/*`. "title": "A String", # Title of the document. "uri": "A String", # Cloud Storage or HTTP uri for the document. }, ], "summary": "A String", # Summary text with no citation information. }, }, }, "userInput": { # Defines text input. # User text input. "context": { # Defines context of the conversation # Conversation context of the input. "activeDocument": "A String", # The current active document the user opened. It contains the document resource reference. "contextDocuments": [ # The current list of documents the user is seeing. It contains the document resource references. "A String", ], }, "input": "A String", # Text input. }, }, ], "name": "A String", # Immutable. Fully qualified name `projects/{project}/locations/global/collections/{collection}/dataStore/*/conversations/*` or `projects/{project}/locations/global/collections/{collection}/engines/*/conversations/*`. "startTime": "A String", # Output only. The time the conversation started. "state": "A String", # The state of the Conversation. "userPseudoId": "A String", # A unique identifier for tracking users. } x__xgafv: string, V1 error format. Allowed values 1 - v1 error format 2 - v2 error format Returns: An object of the form: { # External conversation proto definition. "endTime": "A String", # Output only. The time the conversation finished. "messages": [ # Conversation messages. { # Defines a conversation message. "createTime": "A String", # Output only. Message creation timestamp. "reply": { # Defines a reply message to user. # Search reply. "references": [ # References in the reply. { # Defines reference in reply. "anchorText": "A String", # Anchor text. "end": 42, # Anchor text end index. "start": 42, # Anchor text start index. "uri": "A String", # URI link reference. }, ], "reply": "A String", # DEPRECATED: use `summary` instead. Text reply. "summary": { # Summary of the top N search results specified by the summary spec. # Summary based on search results. "safetyAttributes": { # Safety Attribute categories and their associated confidence scores. # A collection of Safety Attribute categories and their associated confidence scores. "categories": [ # The display names of Safety Attribute categories associated with the generated content. Order matches the Scores. "A String", ], "scores": [ # The confidence scores of the each category, higher value means higher confidence. Order matches the Categories. 3.14, ], }, "summarySkippedReasons": [ # Additional summary-skipped reasons. This provides the reason for ignored cases. If nothing is skipped, this field is not set. "A String", ], "summaryText": "A String", # The summary content. "summaryWithMetadata": { # Summary with metadata information. # Summary with metadata information. "citationMetadata": { # Citation metadata. # Citation metadata for given summary. "citations": [ # Citations for segments. { # Citation info for a segment. "endIndex": "A String", # End of the attributed segment, exclusive. "sources": [ # Citation sources for the attributed segment. { # Citation source. "referenceIndex": "A String", # Document reference index from SummaryWithMetadata.references. It is 0-indexed and the value will be zero if the reference_index is not set explicitly. }, ], "startIndex": "A String", # Index indicates the start of the segment, measured in bytes/unicode. }, ], }, "references": [ # Document References. { # Document reference. "chunkContents": [ # List of cited chunk contents derived from document content. { # Chunk content. "content": "A String", # Chunk textual content. "pageIdentifier": "A String", # Page identifier. }, ], "document": "A String", # Required. Document.name of the document. Full resource name of the referenced document, in the format `projects/*/locations/*/collections/*/dataStores/*/branches/*/documents/*`. "title": "A String", # Title of the document. "uri": "A String", # Cloud Storage or HTTP uri for the document. }, ], "summary": "A String", # Summary text with no citation information. }, }, }, "userInput": { # Defines text input. # User text input. "context": { # Defines context of the conversation # Conversation context of the input. "activeDocument": "A String", # The current active document the user opened. It contains the document resource reference. "contextDocuments": [ # The current list of documents the user is seeing. It contains the document resource references. "A String", ], }, "input": "A String", # Text input. }, }, ], "name": "A String", # Immutable. Fully qualified name `projects/{project}/locations/global/collections/{collection}/dataStore/*/conversations/*` or `projects/{project}/locations/global/collections/{collection}/engines/*/conversations/*`. "startTime": "A String", # Output only. The time the conversation started. "state": "A String", # The state of the Conversation. "userPseudoId": "A String", # A unique identifier for tracking users. }
delete(name, x__xgafv=None)
Deletes a Conversation. If the Conversation to delete does not exist, a NOT_FOUND error is returned. Args: name: string, Required. The resource name of the Conversation to delete. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}` (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); } }
get(name, x__xgafv=None)
Gets a Conversation. Args: name: string, Required. The resource name of the Conversation to get. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}` (required) x__xgafv: string, V1 error format. Allowed values 1 - v1 error format 2 - v2 error format Returns: An object of the form: { # External conversation proto definition. "endTime": "A String", # Output only. The time the conversation finished. "messages": [ # Conversation messages. { # Defines a conversation message. "createTime": "A String", # Output only. Message creation timestamp. "reply": { # Defines a reply message to user. # Search reply. "references": [ # References in the reply. { # Defines reference in reply. "anchorText": "A String", # Anchor text. "end": 42, # Anchor text end index. "start": 42, # Anchor text start index. "uri": "A String", # URI link reference. }, ], "reply": "A String", # DEPRECATED: use `summary` instead. Text reply. "summary": { # Summary of the top N search results specified by the summary spec. # Summary based on search results. "safetyAttributes": { # Safety Attribute categories and their associated confidence scores. # A collection of Safety Attribute categories and their associated confidence scores. "categories": [ # The display names of Safety Attribute categories associated with the generated content. Order matches the Scores. "A String", ], "scores": [ # The confidence scores of the each category, higher value means higher confidence. Order matches the Categories. 3.14, ], }, "summarySkippedReasons": [ # Additional summary-skipped reasons. This provides the reason for ignored cases. If nothing is skipped, this field is not set. "A String", ], "summaryText": "A String", # The summary content. "summaryWithMetadata": { # Summary with metadata information. # Summary with metadata information. "citationMetadata": { # Citation metadata. # Citation metadata for given summary. "citations": [ # Citations for segments. { # Citation info for a segment. "endIndex": "A String", # End of the attributed segment, exclusive. "sources": [ # Citation sources for the attributed segment. { # Citation source. "referenceIndex": "A String", # Document reference index from SummaryWithMetadata.references. It is 0-indexed and the value will be zero if the reference_index is not set explicitly. }, ], "startIndex": "A String", # Index indicates the start of the segment, measured in bytes/unicode. }, ], }, "references": [ # Document References. { # Document reference. "chunkContents": [ # List of cited chunk contents derived from document content. { # Chunk content. "content": "A String", # Chunk textual content. "pageIdentifier": "A String", # Page identifier. }, ], "document": "A String", # Required. Document.name of the document. Full resource name of the referenced document, in the format `projects/*/locations/*/collections/*/dataStores/*/branches/*/documents/*`. "title": "A String", # Title of the document. "uri": "A String", # Cloud Storage or HTTP uri for the document. }, ], "summary": "A String", # Summary text with no citation information. }, }, }, "userInput": { # Defines text input. # User text input. "context": { # Defines context of the conversation # Conversation context of the input. "activeDocument": "A String", # The current active document the user opened. It contains the document resource reference. "contextDocuments": [ # The current list of documents the user is seeing. It contains the document resource references. "A String", ], }, "input": "A String", # Text input. }, }, ], "name": "A String", # Immutable. Fully qualified name `projects/{project}/locations/global/collections/{collection}/dataStore/*/conversations/*` or `projects/{project}/locations/global/collections/{collection}/engines/*/conversations/*`. "startTime": "A String", # Output only. The time the conversation started. "state": "A String", # The state of the Conversation. "userPseudoId": "A String", # A unique identifier for tracking users. }
list(parent, filter=None, orderBy=None, pageSize=None, pageToken=None, x__xgafv=None)
Lists all Conversations by their parent DataStore. Args: parent: string, Required. The data store resource name. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}` (required) filter: string, A filter to apply on the list results. The supported features are: user_pseudo_id, state. Example: "user_pseudo_id = some_id" orderBy: string, A comma-separated list of fields to order by, sorted in ascending order. Use "desc" after a field name for descending. Supported fields: * `update_time` * `create_time` * `conversation_name` Example: "update_time desc" "create_time" pageSize: integer, Maximum number of results to return. If unspecified, defaults to 50. Max allowed value is 1000. pageToken: string, A page token, received from a previous `ListConversations` call. Provide this to retrieve the subsequent page. x__xgafv: string, V1 error format. Allowed values 1 - v1 error format 2 - v2 error format Returns: An object of the form: { # Response for ListConversations method. "conversations": [ # All the Conversations for a given data store. { # External conversation proto definition. "endTime": "A String", # Output only. The time the conversation finished. "messages": [ # Conversation messages. { # Defines a conversation message. "createTime": "A String", # Output only. Message creation timestamp. "reply": { # Defines a reply message to user. # Search reply. "references": [ # References in the reply. { # Defines reference in reply. "anchorText": "A String", # Anchor text. "end": 42, # Anchor text end index. "start": 42, # Anchor text start index. "uri": "A String", # URI link reference. }, ], "reply": "A String", # DEPRECATED: use `summary` instead. Text reply. "summary": { # Summary of the top N search results specified by the summary spec. # Summary based on search results. "safetyAttributes": { # Safety Attribute categories and their associated confidence scores. # A collection of Safety Attribute categories and their associated confidence scores. "categories": [ # The display names of Safety Attribute categories associated with the generated content. Order matches the Scores. "A String", ], "scores": [ # The confidence scores of the each category, higher value means higher confidence. Order matches the Categories. 3.14, ], }, "summarySkippedReasons": [ # Additional summary-skipped reasons. This provides the reason for ignored cases. If nothing is skipped, this field is not set. "A String", ], "summaryText": "A String", # The summary content. "summaryWithMetadata": { # Summary with metadata information. # Summary with metadata information. "citationMetadata": { # Citation metadata. # Citation metadata for given summary. "citations": [ # Citations for segments. { # Citation info for a segment. "endIndex": "A String", # End of the attributed segment, exclusive. "sources": [ # Citation sources for the attributed segment. { # Citation source. "referenceIndex": "A String", # Document reference index from SummaryWithMetadata.references. It is 0-indexed and the value will be zero if the reference_index is not set explicitly. }, ], "startIndex": "A String", # Index indicates the start of the segment, measured in bytes/unicode. }, ], }, "references": [ # Document References. { # Document reference. "chunkContents": [ # List of cited chunk contents derived from document content. { # Chunk content. "content": "A String", # Chunk textual content. "pageIdentifier": "A String", # Page identifier. }, ], "document": "A String", # Required. Document.name of the document. Full resource name of the referenced document, in the format `projects/*/locations/*/collections/*/dataStores/*/branches/*/documents/*`. "title": "A String", # Title of the document. "uri": "A String", # Cloud Storage or HTTP uri for the document. }, ], "summary": "A String", # Summary text with no citation information. }, }, }, "userInput": { # Defines text input. # User text input. "context": { # Defines context of the conversation # Conversation context of the input. "activeDocument": "A String", # The current active document the user opened. It contains the document resource reference. "contextDocuments": [ # The current list of documents the user is seeing. It contains the document resource references. "A String", ], }, "input": "A String", # Text input. }, }, ], "name": "A String", # Immutable. Fully qualified name `projects/{project}/locations/global/collections/{collection}/dataStore/*/conversations/*` or `projects/{project}/locations/global/collections/{collection}/engines/*/conversations/*`. "startTime": "A String", # Output only. The time the conversation started. "state": "A String", # The state of the Conversation. "userPseudoId": "A String", # A unique identifier for tracking users. }, ], "nextPageToken": "A String", # Pagination token, if not returned indicates the last page. }
list_next()
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.
patch(name, body=None, updateMask=None, x__xgafv=None)
Updates a Conversation. Conversation action type cannot be changed. If the Conversation to update does not exist, a NOT_FOUND error is returned. Args: name: string, Immutable. Fully qualified name `projects/{project}/locations/global/collections/{collection}/dataStore/*/conversations/*` or `projects/{project}/locations/global/collections/{collection}/engines/*/conversations/*`. (required) body: object, The request body. The object takes the form of: { # External conversation proto definition. "endTime": "A String", # Output only. The time the conversation finished. "messages": [ # Conversation messages. { # Defines a conversation message. "createTime": "A String", # Output only. Message creation timestamp. "reply": { # Defines a reply message to user. # Search reply. "references": [ # References in the reply. { # Defines reference in reply. "anchorText": "A String", # Anchor text. "end": 42, # Anchor text end index. "start": 42, # Anchor text start index. "uri": "A String", # URI link reference. }, ], "reply": "A String", # DEPRECATED: use `summary` instead. Text reply. "summary": { # Summary of the top N search results specified by the summary spec. # Summary based on search results. "safetyAttributes": { # Safety Attribute categories and their associated confidence scores. # A collection of Safety Attribute categories and their associated confidence scores. "categories": [ # The display names of Safety Attribute categories associated with the generated content. Order matches the Scores. "A String", ], "scores": [ # The confidence scores of the each category, higher value means higher confidence. Order matches the Categories. 3.14, ], }, "summarySkippedReasons": [ # Additional summary-skipped reasons. This provides the reason for ignored cases. If nothing is skipped, this field is not set. "A String", ], "summaryText": "A String", # The summary content. "summaryWithMetadata": { # Summary with metadata information. # Summary with metadata information. "citationMetadata": { # Citation metadata. # Citation metadata for given summary. "citations": [ # Citations for segments. { # Citation info for a segment. "endIndex": "A String", # End of the attributed segment, exclusive. "sources": [ # Citation sources for the attributed segment. { # Citation source. "referenceIndex": "A String", # Document reference index from SummaryWithMetadata.references. It is 0-indexed and the value will be zero if the reference_index is not set explicitly. }, ], "startIndex": "A String", # Index indicates the start of the segment, measured in bytes/unicode. }, ], }, "references": [ # Document References. { # Document reference. "chunkContents": [ # List of cited chunk contents derived from document content. { # Chunk content. "content": "A String", # Chunk textual content. "pageIdentifier": "A String", # Page identifier. }, ], "document": "A String", # Required. Document.name of the document. Full resource name of the referenced document, in the format `projects/*/locations/*/collections/*/dataStores/*/branches/*/documents/*`. "title": "A String", # Title of the document. "uri": "A String", # Cloud Storage or HTTP uri for the document. }, ], "summary": "A String", # Summary text with no citation information. }, }, }, "userInput": { # Defines text input. # User text input. "context": { # Defines context of the conversation # Conversation context of the input. "activeDocument": "A String", # The current active document the user opened. It contains the document resource reference. "contextDocuments": [ # The current list of documents the user is seeing. It contains the document resource references. "A String", ], }, "input": "A String", # Text input. }, }, ], "name": "A String", # Immutable. Fully qualified name `projects/{project}/locations/global/collections/{collection}/dataStore/*/conversations/*` or `projects/{project}/locations/global/collections/{collection}/engines/*/conversations/*`. "startTime": "A String", # Output only. The time the conversation started. "state": "A String", # The state of the Conversation. "userPseudoId": "A String", # A unique identifier for tracking users. } updateMask: string, Indicates which fields in the provided Conversation to update. The following are NOT supported: * Conversation.name If not set or empty, all supported fields are updated. x__xgafv: string, V1 error format. Allowed values 1 - v1 error format 2 - v2 error format Returns: An object of the form: { # External conversation proto definition. "endTime": "A String", # Output only. The time the conversation finished. "messages": [ # Conversation messages. { # Defines a conversation message. "createTime": "A String", # Output only. Message creation timestamp. "reply": { # Defines a reply message to user. # Search reply. "references": [ # References in the reply. { # Defines reference in reply. "anchorText": "A String", # Anchor text. "end": 42, # Anchor text end index. "start": 42, # Anchor text start index. "uri": "A String", # URI link reference. }, ], "reply": "A String", # DEPRECATED: use `summary` instead. Text reply. "summary": { # Summary of the top N search results specified by the summary spec. # Summary based on search results. "safetyAttributes": { # Safety Attribute categories and their associated confidence scores. # A collection of Safety Attribute categories and their associated confidence scores. "categories": [ # The display names of Safety Attribute categories associated with the generated content. Order matches the Scores. "A String", ], "scores": [ # The confidence scores of the each category, higher value means higher confidence. Order matches the Categories. 3.14, ], }, "summarySkippedReasons": [ # Additional summary-skipped reasons. This provides the reason for ignored cases. If nothing is skipped, this field is not set. "A String", ], "summaryText": "A String", # The summary content. "summaryWithMetadata": { # Summary with metadata information. # Summary with metadata information. "citationMetadata": { # Citation metadata. # Citation metadata for given summary. "citations": [ # Citations for segments. { # Citation info for a segment. "endIndex": "A String", # End of the attributed segment, exclusive. "sources": [ # Citation sources for the attributed segment. { # Citation source. "referenceIndex": "A String", # Document reference index from SummaryWithMetadata.references. It is 0-indexed and the value will be zero if the reference_index is not set explicitly. }, ], "startIndex": "A String", # Index indicates the start of the segment, measured in bytes/unicode. }, ], }, "references": [ # Document References. { # Document reference. "chunkContents": [ # List of cited chunk contents derived from document content. { # Chunk content. "content": "A String", # Chunk textual content. "pageIdentifier": "A String", # Page identifier. }, ], "document": "A String", # Required. Document.name of the document. Full resource name of the referenced document, in the format `projects/*/locations/*/collections/*/dataStores/*/branches/*/documents/*`. "title": "A String", # Title of the document. "uri": "A String", # Cloud Storage or HTTP uri for the document. }, ], "summary": "A String", # Summary text with no citation information. }, }, }, "userInput": { # Defines text input. # User text input. "context": { # Defines context of the conversation # Conversation context of the input. "activeDocument": "A String", # The current active document the user opened. It contains the document resource reference. "contextDocuments": [ # The current list of documents the user is seeing. It contains the document resource references. "A String", ], }, "input": "A String", # Text input. }, }, ], "name": "A String", # Immutable. Fully qualified name `projects/{project}/locations/global/collections/{collection}/dataStore/*/conversations/*` or `projects/{project}/locations/global/collections/{collection}/engines/*/conversations/*`. "startTime": "A String", # Output only. The time the conversation started. "state": "A String", # The state of the Conversation. "userPseudoId": "A String", # A unique identifier for tracking users. }