Ask Document Question

The "Ask Document Question" endpoint allows you to ask specific questions about a document stored in Google Drive. By specifying the document ID and providing a question prompt, the AI will analyze the content of the document and return an answer based on the information within.

Endpoint

POST /v1/drive/document-question

Parameters

  • document_id (required, string): The ID of the document you want to query. This ID can be obtained from the Document Index or directly from the Google Drive URL.

    Example URL: https://drive.google.com/file/d/1X2Y3Z4A5B6C7D8E9F/view

    In this example, the document ID is 1X2Y3Z4A5B6C7D8E9F.

  • question (required, string): The specific question you want to ask about the document (e.g., "What are the key financial highlights in this report?").

Note: The user must be logged in with an account that is authorized to access the specified document in Google Drive.

Example Request

POST /v1/drive/document-question
{
  "document_id": "1X2Y3Z4A5B6C7D8E9F",
  "question": "What are the key financial highlights in this report?"
}

Example Response

jsonCopy code{
  "document_id": "1X2Y3Z4A5B6C7D8E9F",
  "question": "What are the key financial highlights in this report?",
  "answer": "The key financial highlights in this report include a 10% increase in revenue, a 5% reduction in operational costs, and a 15% year-over-year growth in net profit."
}

Usage Notes

  • Document ID Retrieval: You can obtain the document ID from the Google Drive URL or through the Document Index endpoint.

  • Question Prompt: Be specific in your question to receive the most accurate and relevant information from the document.

  • Authorization: Ensure that you are logged in with an account that has access to the document you are querying.

Example Use Case: Due Diligence Document Query

During a due diligence process, it may be necessary to extract specific pieces of information from lengthy reports or agreements. By using the "Ask Document Question" endpoint, you can quickly retrieve targeted answers from documents stored in Google Drive, saving time and ensuring accuracy in your review process.

Last updated