% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/llama.R
\name{llama_detokenize}
\alias{llama_detokenize}
\title{Detokenize token IDs back to text}
\usage{
llama_detokenize(ctx, tokens)
}
\arguments{
\item{ctx}{Context handle returned by [llama_new_context]}

\item{tokens}{Integer vector of token IDs (as returned by [llama_tokenize])}
}
\value{
A character scalar containing the decoded text.
}
\description{
Detokenize token IDs back to text
}
\examples{
\dontrun{
model <- llama_load_model("model.gguf")
ctx <- llama_new_context(model)

# Round-trip: text -> tokens -> text
original <- "Hello, world!"
tokens <- llama_tokenize(ctx, original, add_special = FALSE)
restored <- llama_detokenize(ctx, tokens)
identical(original, restored)  # TRUE
}
}
