embeddings_contextualized
Generate context-aware embeddings for document chunks by considering surrounding text, improving retrieval-augmented generation (RAG) accuracy.
Instructions
Generate context-aware embeddings for document chunks (POST /v1/contextualizedembeddings). Unlike standard embeddings, each chunk's vector is influenced by surrounding chunks in the same document, producing better representations for RAG. Input is an array of arrays: each inner array is a document's chunks.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"input": "<input>"
},
"name": "embeddings_contextualized"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| input | Yes | Array of documents, each being an array of text chunks. Example: [['chunk1 of doc1', 'chunk2 of doc1'], ['chunk1 of doc2']] | |
| model | No | Contextualized embedding model. | pplx-embed-context-v1-0.6b |
| dimensions | No | Output vector dimensions (128-2560). | |
| encoding_format | No | Encoding format for the returned embedding vectors. |