Ask questions about one or more documents

This API endpoint uses an LLM to answer questions about documents. Given a question in natural language, and a list of files, this API returns a multi-part answer with references to the locations in the given documents which were used to build the answer.

Securityoidc-token or oauth2-client-credentials or oauth2-open-industrial-data or oauth2-auth-code
Request
path Parameters
projectName
required
string

The CDF project name, equal to the project variable in the server URL.

Example: publicdata
header Parameters
content-type
required
string (Content-Type)
cdf-version
string

cdf version header. Use this to specify the requested CDF release.

Example: alpha
Request Body schema: application/json
required
question
required
string (Question) [ 10 .. 2048 ] characters

Question to ask about the documents

additionalContext
string (Additionalcontext) [ 10 .. 2048 ] characters

Optional additional context that the model can use to improve its answer

required
Array of FileId (object) or FileExternalId (object) (Fileids) [ 1 .. 100 ] items

List of file ids or external ids

Responses
200

Successful Response

400

The response for a failed request.

post/api/v1/projects/{projectName}/ai/tools/documents/ask
Request samples
application/json
{
  • "question": "stringstri",
  • "additionalContext": "stringstri",
  • "fileIds": [
    • {
      }
    ]
}
Response samples
application/json
{
  • "content": [
    • {
      }
    ]
}