# GreedySamplingPipeline
Namespace: LLama.Sampling
A sampling pipeline which always selects the most likely token
```csharp
public class GreedySamplingPipeline : BaseSamplingPipeline, ISamplingPipeline, System.IDisposable
```
Inheritance [Object](https://docs.microsoft.com/en-us/dotnet/api/system.object) → [BaseSamplingPipeline](./llama.sampling.basesamplingpipeline.md) → [GreedySamplingPipeline](./llama.sampling.greedysamplingpipeline.md)
Implements [ISamplingPipeline](./llama.sampling.isamplingpipeline.md), [IDisposable](https://docs.microsoft.com/en-us/dotnet/api/system.idisposable)
## Properties
### **Grammar**
Grammar to constrain valid tokens
```csharp
public SafeLLamaGrammarHandle Grammar { get; set; }
```
#### Property Value
[SafeLLamaGrammarHandle](./llama.native.safellamagrammarhandle.md)
## Constructors
### **GreedySamplingPipeline()**
```csharp
public GreedySamplingPipeline()
```
## Methods
### **ProcessLogits(SafeLLamaContextHandle, Span<Single>, ReadOnlySpan<LLamaToken>)**
```csharp
protected void ProcessLogits(SafeLLamaContextHandle ctx, Span logits, ReadOnlySpan lastTokens)
```
#### Parameters
`ctx` [SafeLLamaContextHandle](./llama.native.safellamacontexthandle.md)
`logits` [Span<Single>](https://docs.microsoft.com/en-us/dotnet/api/system.span-1)
`lastTokens` [ReadOnlySpan<LLamaToken>](https://docs.microsoft.com/en-us/dotnet/api/system.readonlyspan-1)
### **ProcessTokenDataArray(SafeLLamaContextHandle, LLamaTokenDataArray, ReadOnlySpan<LLamaToken>)**
```csharp
protected LLamaToken ProcessTokenDataArray(SafeLLamaContextHandle ctx, LLamaTokenDataArray candidates, ReadOnlySpan lastTokens)
```
#### Parameters
`ctx` [SafeLLamaContextHandle](./llama.native.safellamacontexthandle.md)
`candidates` [LLamaTokenDataArray](./llama.native.llamatokendataarray.md)
`lastTokens` [ReadOnlySpan<LLamaToken>](https://docs.microsoft.com/en-us/dotnet/api/system.readonlyspan-1)
#### Returns
[LLamaToken](./llama.native.llamatoken.md)
### **Clone()**
```csharp
public ISamplingPipeline Clone()
```
#### Returns
[ISamplingPipeline](./llama.sampling.isamplingpipeline.md)