% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/llama.R
\name{llama_memory_seq_add}
\alias{llama_memory_seq_add}
\title{Shift token positions in a sequence}
\usage{
llama_memory_seq_add(ctx, seq_id, p0, p1, delta)
}
\arguments{
\item{ctx}{Context handle returned by [llama_new_context]}

\item{seq_id}{Sequence ID}

\item{p0}{Start position (inclusive)}

\item{p1}{End position (exclusive)}

\item{delta}{Position shift amount (can be negative)}
}
\value{
No return value, called for side effects.
}
\description{
Adds a position delta to all tokens in the given sequence within [p0, p1).
This is useful for implementing context shifting (sliding window).
}
\examples{
\dontrun{
# Shift positions left by 100 for context window management
llama_memory_seq_add(ctx, seq_id = 0L, p0 = 100L, p1 = -1L, delta = -100L)
}
}
