Contextualized chunk embedding models
The Voyage contextualized chunk embedding endpoint accepts document chunks—in addition to queries and full documents—and returns a response containing contextualized chunk vector embeddings. These contextualized chunk embeddings capture not only the local details within each chunk but also global, coarse-grained metadata from the entire document.
Request body
Name of the model. Recommended options: voyage-context-3.
Type of the input text. Defaults to null. Other options: query, document. <ul> <li> When input_type is null, the embedding model directly converts the inputs into numerical vectors. For retrieval/search purposes, where a "query" is used to search for relevant information among a collection of data referred to as "documents," we recommend specifying whether your inputs are intended as queries or documents by setting input_type to query or document, respectively. In these cases, Voyage automatically prepends a prompt to your inputs before vectorizing them, creating vectors more tailored for retrieval/search tasks. Embeddings generated with and without the input_type argument are compatible. </li> <li> For transparency, the following prompts are prepended to your input. </li>
<ul> <li> For <code>query</code>, the prompt is <i>"Represent the query for retrieving supporting documents: ".</i> </li> <li> For <code>document</code>, the prompt is <i>"Represent the document for retrieval: ".</i> </li> </ul> <ul> <ul>The number of dimensions for resulting output embeddings. Defaults to null. voyage-context-3 supports the following output_dimension values: 2048, 1024 (default), 512, and 256. If set to null, the model uses the default value of 1024.
The data type for the embeddings to be returned. Defaults to float. Other options: int8, uint8, binary, ubinary. Please see our <a href="https://docs.voyageai.com/docs/flexible-dimensions-and-quantization#quantization" target="_blank">guide</a> for more details about output data types. <ul> <li> float: Each returned embedding is a list of 32-bit (4-byte) <a href="https://en.wikipedia.org/wiki/Single-precision_floating-point_format" target="_blank">single-precision floating-point</a> numbers. This is the default and provides the highest precision / retrieval accuracy. </li> <li> int8 and uint8: Each returned embedding is a list of 8-bit (1-byte) integers ranging from -128 to 127 and 0 to 255, respectively. </li> <li> binary and ubinary: Each returned embedding is a list of 8-bit integers that represent bit-packed, quantized single-bit embedding values: int8 for binary and uint8 for ubinary. The length of the returned list of integers is 1/8 of output_dimension (which is the actual dimension of the embedding). The binary type uses the offset binary method. Please refer to our guide for details on <a href="https://docs.voyageai.com/docs/flexible-dimensions-and-quantization#offset-binary" target="_blank">offset binary</a> and <a href="https://docs.voyageai.com/docs/flexible-dimensions-and-quantization#quantization" target="_blank">binary embeddings</a>. </ul>
Format in which the embeddings are encoded. Defaults to null. Other options: base64. <ul> <li> If null, each embedding is an array of float numbers when output_dtype is set to float and as an array of integers for all other values of output_dtype (int8, uint8, binary, and ubinary). See output_dtype for more details. <li> If base64, the embeddings are represented as a <a href="https://docs.python.org/3/library/base64.html" target="_blank">Base64-encoded</a> NumPy array of: </li>
<ul> <li> Floating-point numbers (<a href="https:/umpy.org/doc/2.1/user/basics.types.html#numerical-data-types" target="_blank">numpy.float32</a>) for <code>output_dtype</code> set to <code>float</code>. </li> <li> Signed integers (<a href="https:/umpy.org/doc/2.1/user/basics.types.html#numerical-data-types" target="_blank">numpy.int8</a>) for <code>output_dtype</code> set to <code>int8</code> or <code>binary</code>. </li> <li> Unsigned integers (<a href="https:/umpy.org/doc/2.1/user/basics.types.html#numerical-data-types" target="_blank">numpy.uint8</a>) for <code>output_dtype</code> set to <code>uint8</code> or <code>ubinary</code>. </li> </ul> </ul>Response
Success.
The object type, which is always list.
Name of the model.