# ISamplingPipelineExtensions Namespace: LLama.Sampling Extensions methods for ISamplingPipeline ```csharp public static class ISamplingPipelineExtensions ``` Inheritance [Object](https://docs.microsoft.com/en-us/dotnet/api/system.object) → [ISamplingPipelineExtensions](./llama.sampling.isamplingpipelineextensions.md) ## Methods ### **Sample(ISamplingPipeline, SafeLLamaContextHandle, Span<Single>, List<LLamaToken>)** Sample a single token from the given logits ```csharp public static LLamaToken Sample(ISamplingPipeline pipeline, SafeLLamaContextHandle ctx, Span logits, List lastTokens) ``` #### Parameters `pipeline` [ISamplingPipeline](./llama.sampling.isamplingpipeline.md)
`ctx` [SafeLLamaContextHandle](./llama.native.safellamacontexthandle.md)
The context being sampled from `logits` [Span<Single>](https://docs.microsoft.com/en-us/dotnet/api/system.span-1)
The logits produced by the model `lastTokens` [List<LLamaToken>](https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.list-1)
A list of tokens recently returned by the model #### Returns [LLamaToken](./llama.native.llamatoken.md)