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
additionalContext
string (Additionalcontext) [ 10 .. 2048 ] characters

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

required
Array of DocumentInternalId (object) or DocumentExternalId (object) or DocumentInstanceId (object) (Fileids) [ 1 .. 100 ] items

List of file ids, external ids, or instance ids pointing to PDF documents

ignoreUnknownIds
boolean (Ignoreunknownids)
Default: false

If True, the API will not fail if any documents are missing or not fully processed, but generate an answer based on available documents

language
string (DocumentsQALanguage)
Default: "English"

The language name (ISO 639) of the language that the answer should be in

Enum: "Chinese" "Dutch" "English" "French" "German" "Italian" "Japanese" "Korean" "Latvian" "Norwegian" "Portuguese" "Spanish" "Swedish"
question
required
string (Question) [ 1 .. 2048 ] characters

Question to ask about the documents

Responses
200

Successful Response

400

The response for a failed request.

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