% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/llama.R
\name{llama_get_embeddings_seq}
\alias{llama_get_embeddings_seq}
\title{Get pooled embeddings for a sequence}
\usage{
llama_get_embeddings_seq(ctx, seq_id)
}
\arguments{
\item{ctx}{Context handle returned by [llama_new_context] with
\code{embedding = TRUE}}

\item{seq_id}{Integer sequence ID (0-based)}
}
\value{
A numeric vector of length \code{n_embd}.
}
\description{
Returns the pooled embedding vector for a given sequence ID after a batch
decode. Only works when the model supports pooling (embedding models).
}
\examples{
\dontrun{
# Get pooled embedding for sequence 0 (requires embedding context)
model <- llama_load_model("nomic-embed.gguf")
ctx <- llama_new_context(model, embedding = TRUE)
mat <- llama_embed_batch(ctx, "Hello world")
emb <- llama_get_embeddings_seq(ctx, 0L)
cat("Pooled embedding dim:", length(emb), "\n")
}
}
