Developer Knowledge API . v1alpha

Instance Methods

answerQuery(body=None, x__xgafv=None)

Answers a query using grounded generation.

close()

Close httplib2 connections.

Method Details

answerQuery(body=None, x__xgafv=None)
Answers a query using grounded generation.

Args:
  body: object, The request body.
    The object takes the form of:

{ # Request message for DeveloperKnowledge.AnswerQuery.
  "query": "A String", # Required. The query to answer.
}

  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 DeveloperKnowledge.AnswerQuery.
  "answer": { # An answer to a query. # The answer to the query.
    "answerText": "A String", # Contains the text of the answer.
    "citations": [ # Output only. Contains citations for the answer.
      { # Citation info for a segment.
        "endIndex": 42, # Output only. Indicates the end of the segment, measured in bytes (UTF-8 unicode), exclusive. If there are multi-byte characters, such as non-ASCII characters, the index measurement is longer than the string length.
        "sources": [ # Output only. Contains citation sources for the attributed segment.
          { # Citation source.
            "referenceIndex": 42, # Output only. Contains the index of the Answer.AnswerReference in the `references` repeated field.
          },
        ],
        "startIndex": 42, # Output only. Indicates the start of the segment, measured in bytes (UTF-8 unicode), inclusive. If there are multi-byte characters, such as non-ASCII characters, the index measurement is longer than the string length.
      },
    ],
    "references": [ # Output only. Contains references for the answer.
      { # Represents a reference to a source.
        "documentReference": { # Represents a reference to a document. # Output only. The reference document.
          "documentChunk": { # A DocumentChunk represents a piece of content from a Document in the DeveloperKnowledge corpus. To fetch the entire document content, pass the `parent` to DeveloperKnowledge.GetDocument or DeveloperKnowledge.BatchGetDocuments. # Output only. Contains the document chunk. The `document_chunk.id` field is not set and will be empty.
            "content": "A String", # Output only. Contains the content of the document chunk.
            "document": { # A Document represents a piece of content from the Developer Knowledge corpus. # Output only. Represents metadata about the Document this chunk is from. The DocumentView of this Document message will be set to `DOCUMENT_VIEW_BASIC`. It is included here for convenience so that clients do not need to call DeveloperKnowledge.GetDocument or DeveloperKnowledge.BatchGetDocuments if they only need the metadata fields. Otherwise, clients should use DeveloperKnowledge.GetDocument or DeveloperKnowledge.BatchGetDocuments to fetch the full document content.
              "content": "A String", # Output only. Contains the full content of the document in Markdown format.
              "dataSource": "A String", # Output only. Specifies the data source of the document. Example data source: `firebase.google.com`
              "description": "A String", # Output only. Provides a description of the document.
              "name": "A String", # Identifier. Contains the resource name of the document. Format: `documents/{uri_without_scheme}` Example: `documents/docs.cloud.google.com/storage/docs/creating-buckets`
              "title": "A String", # Output only. Provides the title of the document.
              "updateTime": "A String", # Output only. Represents the timestamp when the content or metadata of the document was last updated.
              "uri": "A String", # Output only. Provides the URI of the content, such as `docs.cloud.google.com/storage/docs/creating-buckets`.
              "view": "A String", # Output only. Specifies the DocumentView of the document.
            },
            "id": "A String", # Output only. Specifies the ID of this chunk within the document. The chunk ID is unique within a document, but not globally unique across documents. The chunk ID is not stable and may change over time.
            "parent": "A String", # Output only. Contains the resource name of the document this chunk is from. Format: `documents/{uri_without_scheme}` Example: `documents/docs.cloud.google.com/storage/docs/creating-buckets`
          },
        },
      },
    ],
  },
}
close()
Close httplib2 connections.