Method
getRelevantSnippets POST
Copy POST

Retrieves snippets relevant to a given query from specified documents. This function supports flexible input options,

Arguments:

REQUIRED KEY TYPE DESCRIPTION
No docIds List[str] A list of document store IDs to retrieve the snippets from.
No blobs dict A dictionary mapping document names to the blob data.
No query str Query string to find relevant snippets in the documents.
No documentRetrieverConfig DocumentRetrieverConfig If provided, used to configure the retrieval steps like chunking for embeddings.
KEY TYPE Description
chunkSize int The size of chunks for vector store, i.e., maximum number of words in the chunk.
chunkOverlapFraction float The fraction of overlap between two consecutive chunks.
textEncoder str The text encoder used to encode texts in the vector store.
scoreMultiplierColumn str The values in this metadata column are used to modify the relevance scores of returned chunks.
pruneVectors bool Corpus specific transformation of vectors that applies dimensional reduction techniques to strip common components from the vectors.
indexMetadataColumns bool If True, metadata columns of the FG will also be used for indexing and querying.
useDocumentSummary bool If True, uses the summary of the document in addition to chunks of the document for indexing and querying.
summaryInstructions str Instructions for the LLM to generate the document summary.
No honorSentenceBoundary bool If provided, will honor sentence boundary when returning the snippets.
No numRetrievalMarginWords int If provided, will add this number of words from left and right of the returned snippets.
No maxWordsPerSnippet int If provided, will limit the number of words in each snippet to the value specified.
No maxSnippetsPerDocument int If provided, will limit the number of snippets retrieved from each document to the value specified.
No startWordIndex int If provided, will start the snippet at the index (of words in the document) specified.
No endWordIndex int If provided, will end the snippet at the index of (of words in the document) specified.
No includingBoundingBoxes bool If true, will include the bounding boxes of the snippets if they are available.
No text str Plain text from which to retrieve snippets.
Note: The arguments for the API methods follow camelCase but for Python SDK underscore_case is followed.

Response:

KEY TYPE DESCRIPTION
success Boolean true if the call succeeded, false if there was an error
result list[DocumentRetrieverLookupResult]

Exceptions:

TYPE WHEN
DataNotFoundError

docIds is not found.

Language: