1.0.0-beta87 (latest) 1.0.0-beta86

    public sealed class SpeculativeDecodingSpec.Types.NgramSpeculation : IMessage<SpeculativeDecodingSpec.Types.NgramSpeculation>, IEquatable<SpeculativeDecodingSpec.Types.NgramSpeculation>, IDeepCloneable<SpeculativeDecodingSpec.Types.NgramSpeculation>, IBufferMessage, IMessage

Reference documentation and code samples for the Vertex AI v1beta1 API class SpeculativeDecodingSpec.Types.NgramSpeculation.

N-Gram speculation works by trying to find matching tokens in the
previous prompt sequence and use those as speculation for generating
new tokens.

## Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) \> SpeculativeDecodingSpec.Types.NgramSpeculation

## Implements

[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[SpeculativeDecodingSpec](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.AIPlatform.V1Beta1/latest/Google.Cloud.AIPlatform.V1Beta1.SpeculativeDecodingSpec)[Types](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.AIPlatform.V1Beta1/latest/Google.Cloud.AIPlatform.V1Beta1.SpeculativeDecodingSpec.Types)[NgramSpeculation](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.AIPlatform.V1Beta1/latest/Google.Cloud.AIPlatform.V1Beta1.SpeculativeDecodingSpec.Types.NgramSpeculation), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[SpeculativeDecodingSpec](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.AIPlatform.V1Beta1/latest/Google.Cloud.AIPlatform.V1Beta1.SpeculativeDecodingSpec)[Types](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.AIPlatform.V1Beta1/latest/Google.Cloud.AIPlatform.V1Beta1.SpeculativeDecodingSpec.Types)[NgramSpeculation](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.AIPlatform.V1Beta1/latest/Google.Cloud.AIPlatform.V1Beta1.SpeculativeDecodingSpec.Types.NgramSpeculation), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[SpeculativeDecodingSpec](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.AIPlatform.V1Beta1/latest/Google.Cloud.AIPlatform.V1Beta1.SpeculativeDecodingSpec)[Types](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.AIPlatform.V1Beta1/latest/Google.Cloud.AIPlatform.V1Beta1.SpeculativeDecodingSpec.Types)[NgramSpeculation](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.AIPlatform.V1Beta1/latest/Google.Cloud.AIPlatform.V1Beta1.SpeculativeDecodingSpec.Types.NgramSpeculation), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html)

## Inherited Members

[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Namespace

[Google.Cloud.AIPlatform.V1Beta1](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.AIPlatform.V1Beta1/latest/Google.Cloud.AIPlatform.V1Beta1)

## Assembly

Google.Cloud.AIPlatform.V1Beta1.dll

## Constructors

### NgramSpeculation()

    public NgramSpeculation()

### NgramSpeculation(NgramSpeculation)

    public NgramSpeculation(SpeculativeDecodingSpec.Types.NgramSpeculation other)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `other` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.AIPlatform.V1Beta1/latest/Google.Cloud.AIPlatform.V1Beta1.SpeculativeDecodingSpechttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.AIPlatform.V1Beta1/latest/Google.Cloud.AIPlatform.V1Beta1.SpeculativeDecodingSpec.Typeshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.AIPlatform.V1Beta1/latest/Google.Cloud.AIPlatform.V1Beta1.SpeculativeDecodingSpec.Types.NgramSpeculation` |

## Properties

### NgramSize

    public int NgramSize { get; set; }

The number of last N input tokens used as ngram to search/match
against the previous prompt sequence.
This is equal to the N in N-Gram.
The default value is 3 if not specified.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.int32` |   |