% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/llama.R
\name{llama_gen_end}
\alias{llama_gen_end}
\title{Finish a streaming generation}
\usage{
llama_gen_end(state)
}
\arguments{
\item{state}{Generation state handle from [llama_gen_begin].}
}
\value{
A length-1 UTF-8 character vector with any remaining buffered text
  (often \code{""}).
}
\description{
Marks the generation done and returns any bytes still held in the internal
UTF-8 carry buffer (the tail of an unfinished character, if generation
stopped mid-character). Concatenating every [llama_gen_next] chunk followed
by the \code{llama_gen_end} result reproduces the full [llama_generate]
output for the same seed and parameters. Safe to call more than once.
}
\seealso{
[llama_gen_begin], [llama_gen_next]
}
