1.0.0-beta87 (latest) 1.0.0-beta86

    public sealed class CountTokensRequest : IMessage<CountTokensRequest>, IEquatable<CountTokensRequest>, IDeepCloneable<CountTokensRequest>, IBufferMessage, IMessage

Reference documentation and code samples for the Vertex AI v1beta1 API class CountTokensRequest.

Request message for
\[PredictionService.CountTokens\]\[google.cloud.aiplatform.v1beta1.PredictionService.CountTokens\].

## Inheritance

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

## Implements

[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[CountTokensRequest](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.AIPlatform.V1Beta1/latest/Google.Cloud.AIPlatform.V1Beta1.CountTokensRequest), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[CountTokensRequest](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.AIPlatform.V1Beta1/latest/Google.Cloud.AIPlatform.V1Beta1.CountTokensRequest), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[CountTokensRequest](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.AIPlatform.V1Beta1/latest/Google.Cloud.AIPlatform.V1Beta1.CountTokensRequest), [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

### CountTokensRequest()

    public CountTokensRequest()

### CountTokensRequest(CountTokensRequest)

    public CountTokensRequest(CountTokensRequest other)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `other` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.AIPlatform.V1Beta1/latest/Google.Cloud.AIPlatform.V1Beta1.CountTokensRequest` |

## Properties

### Contents

    public RepeatedField<Content> Contents { get; }

Optional. Input content.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.Collections.RepeatedField-1.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.AIPlatform.V1Beta1/latest/Google.Cloud.AIPlatform.V1Beta1.Content` |   |

### Endpoint

    public string Endpoint { get; set; }

Required. The name of the Endpoint requested to perform token counting.
Format:
`projects/{project}/locations/{location}/endpoints/{endpoint}`

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

### EndpointAsEndpointName

    public EndpointName EndpointAsEndpointName { get; set; }

[EndpointName](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.AIPlatform.V1Beta1/latest/Google.Cloud.AIPlatform.V1Beta1.EndpointName)-typed view over the [Endpoint](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.AIPlatform.V1Beta1/latest/Google.Cloud.AIPlatform.V1Beta1.CountTokensRequest#Google_Cloud_AIPlatform_V1Beta1_CountTokensRequest_Endpoint) resource name property.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.AIPlatform.V1Beta1/latest/Google.Cloud.AIPlatform.V1Beta1.EndpointName` |   |

### GenerationConfig

    public GenerationConfig GenerationConfig { get; set; }

Optional. Generation config that the model will use to generate the
response.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.AIPlatform.V1Beta1/latest/Google.Cloud.AIPlatform.V1Beta1.GenerationConfig` |   |

### Instances

    public RepeatedField<Value> Instances { get; }

Optional. The instances that are the input to token counting call.
Schema is identical to the prediction schema of the underlying model.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.Collections.RepeatedField-1.htmlhttps://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.WellKnownTypes.Value.html` |   |

### Model

    public string Model { get; set; }

Optional. The name of the publisher model requested to serve the
prediction. Format:
`projects/{project}/locations/{location}/publishers/*/models/*`

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

### SystemInstruction

    public Content SystemInstruction { get; set; }

Optional. The user provided system instructions for the model.
Note: only text should be used in parts and content in each part will be in
a separate paragraph.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.AIPlatform.V1Beta1/latest/Google.Cloud.AIPlatform.V1Beta1.Content` |   |

### Tools

    public RepeatedField<Tool> Tools { get; }

Optional. A list of `Tools` the model may use to generate the next
response.

A `Tool` is a piece of code that enables the system to interact with
external systems to perform an action, or set of actions, outside of
knowledge and scope of the model.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.Collections.RepeatedField-1.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.AIPlatform.V1Beta1/latest/Google.Cloud.AIPlatform.V1Beta1.Tool` |   |