GenaiDocumentQuery

The class inherits from the GenaiVectorQuery class. It enables an API caller to perform a vector query that is filtered to include chunks from a single document. The Content Platform Engine server verifies whether the call has VIEW_CONTENT access for the underlying document. The set of document chunks that closely match the input prompt are then returned. For more information, see GenaiDocumentQuery class in the FNCM documentation.

Table 1. GenaiDocumentQuery class properties
Property Data type Description
GenaiLLMPrompt String The input prompt from the user. The maximum length for the value is 4000 characters.
GenaiLLMModelName String An optional watsonx LLM model name. The maximum length for the value is 256 characters.
GenaiLLMResponse String The response from the watsonx LLM.
GenaiLLMMaxOutputTokens Integer If you set this parameter, it overrides the LLM maximum output tokens parameter which has a default value of 512. You cannot set a value less than 10 or greater than 8192.
GenaiVectorChunks String A JSON value that contains the document chunks that the vector search returns. If GenaiPerformLLMQuery is false, then this property holds all the vector query results. If GenaiPerformLLMQuery is true, then this property holds the chunks that were submitted to the LLM as context for the LLM query.
GenaiPerformLLMQuery Boolean If the value is true, the prompt is submitted to an LLM with the vector chunks as context.
GenaiMaxDocumentChunks Integer You can set the maximum number of document chunks that need to be returned in the GenaiVectorChunks property.
GenaiRelevancyScoreFilterLevel Float When you set this parameter, it overrides the LLM relevancy score filter level which has a default value of 0.5. You can set a value between 0.0 and 1.0.
GenaiContextDocument Object The document that is used as context for the query.