GenaiVectorQuery class

The GenaiVectorQuery class inherits from the GenaiBaseQuery class. It enables an API caller to perform a vector query across the vector index for an entire object store. Before any of the document chunks are used for LLM inferencing, or returned to the caller, the Content Platform Engine server verifies whether the caller has VIEW_CONTENT permissions for the underlying documents. The set of documents that most closely match the input prompt are then returned.

Table 1. GenaiVectorQuery 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 4096. You cannot set a value less than 10 or greater than 8192.
GenaiPromptTemplate String An optional parameter that specifies the prompt template for your query operation. If you set this parameter, the template that you pass overrides all the default prompt templates that are already configured in Content Platform Engine.
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.
GenaiRelevancyFilterLevel 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.