Class CountTokensRequest

java.lang.Object
com.google.protobuf.AbstractMessageLite
com.google.protobuf.AbstractMessage
com.google.protobuf.GeneratedMessage
com.google.cloud.aiplatform.v1.CountTokensRequest
All Implemented Interfaces:
CountTokensRequestOrBuilder, com.google.protobuf.Message, com.google.protobuf.MessageLite, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Serializable

@Generated public final class CountTokensRequest extends com.google.protobuf.GeneratedMessage implements CountTokensRequestOrBuilder
 Request message for [PredictionService.CountTokens][].
 
Protobuf type google.cloud.aiplatform.v1.CountTokensRequest
See Also:
  • Field Details

    • ENDPOINT_FIELD_NUMBER

      public static final int ENDPOINT_FIELD_NUMBER
      See Also:
    • MODEL_FIELD_NUMBER

      public static final int MODEL_FIELD_NUMBER
      See Also:
    • INSTANCES_FIELD_NUMBER

      public static final int INSTANCES_FIELD_NUMBER
      See Also:
    • CONTENTS_FIELD_NUMBER

      public static final int CONTENTS_FIELD_NUMBER
      See Also:
    • SYSTEM_INSTRUCTION_FIELD_NUMBER

      public static final int SYSTEM_INSTRUCTION_FIELD_NUMBER
      See Also:
    • TOOLS_FIELD_NUMBER

      public static final int TOOLS_FIELD_NUMBER
      See Also:
    • GENERATION_CONFIG_FIELD_NUMBER

      public static final int GENERATION_CONFIG_FIELD_NUMBER
      See Also:
  • Method Details

    • getDescriptor

      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
    • internalGetFieldAccessorTable

      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
      Specified by:
      internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessage
    • getEndpoint

      public String getEndpoint()
       Required. The name of the Endpoint requested to perform token counting.
       Format:
       `projects/{project}/locations/{location}/endpoints/{endpoint}`
       
      string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
      Specified by:
      getEndpoint in interface CountTokensRequestOrBuilder
      Returns:
      The endpoint.
    • getEndpointBytes

      public com.google.protobuf.ByteString getEndpointBytes()
       Required. The name of the Endpoint requested to perform token counting.
       Format:
       `projects/{project}/locations/{location}/endpoints/{endpoint}`
       
      string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
      Specified by:
      getEndpointBytes in interface CountTokensRequestOrBuilder
      Returns:
      The bytes for endpoint.
    • getModel

      public String getModel()
       Optional. The name of the publisher model requested to serve the
       prediction. Format:
       `projects/{project}/locations/{location}/publishers/*/models/*`
       
      string model = 3 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getModel in interface CountTokensRequestOrBuilder
      Returns:
      The model.
    • getModelBytes

      public com.google.protobuf.ByteString getModelBytes()
       Optional. The name of the publisher model requested to serve the
       prediction. Format:
       `projects/{project}/locations/{location}/publishers/*/models/*`
       
      string model = 3 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getModelBytes in interface CountTokensRequestOrBuilder
      Returns:
      The bytes for model.
    • getInstancesList

      public List<com.google.protobuf.Value> getInstancesList()
       Optional. The instances that are the input to token counting call.
       Schema is identical to the prediction schema of the underlying model.
       
      repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getInstancesList in interface CountTokensRequestOrBuilder
    • getInstancesOrBuilderList

      public List<? extends com.google.protobuf.ValueOrBuilder> getInstancesOrBuilderList()
       Optional. The instances that are the input to token counting call.
       Schema is identical to the prediction schema of the underlying model.
       
      repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getInstancesOrBuilderList in interface CountTokensRequestOrBuilder
    • getInstancesCount

      public int getInstancesCount()
       Optional. The instances that are the input to token counting call.
       Schema is identical to the prediction schema of the underlying model.
       
      repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getInstancesCount in interface CountTokensRequestOrBuilder
    • getInstances

      public com.google.protobuf.Value getInstances(int index)
       Optional. The instances that are the input to token counting call.
       Schema is identical to the prediction schema of the underlying model.
       
      repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getInstances in interface CountTokensRequestOrBuilder
    • getInstancesOrBuilder

      public com.google.protobuf.ValueOrBuilder getInstancesOrBuilder(int index)
       Optional. The instances that are the input to token counting call.
       Schema is identical to the prediction schema of the underlying model.
       
      repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getInstancesOrBuilder in interface CountTokensRequestOrBuilder
    • getContentsList

      public List<Content> getContentsList()
       Optional. Input content.
       
      repeated .google.cloud.aiplatform.v1.Content contents = 4 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getContentsList in interface CountTokensRequestOrBuilder
    • getContentsOrBuilderList

      public List<? extends ContentOrBuilder> getContentsOrBuilderList()
       Optional. Input content.
       
      repeated .google.cloud.aiplatform.v1.Content contents = 4 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getContentsOrBuilderList in interface CountTokensRequestOrBuilder
    • getContentsCount

      public int getContentsCount()
       Optional. Input content.
       
      repeated .google.cloud.aiplatform.v1.Content contents = 4 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getContentsCount in interface CountTokensRequestOrBuilder
    • getContents

      public Content getContents(int index)
       Optional. Input content.
       
      repeated .google.cloud.aiplatform.v1.Content contents = 4 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getContents in interface CountTokensRequestOrBuilder
    • getContentsOrBuilder

      public ContentOrBuilder getContentsOrBuilder(int index)
       Optional. Input content.
       
      repeated .google.cloud.aiplatform.v1.Content contents = 4 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getContentsOrBuilder in interface CountTokensRequestOrBuilder
    • hasSystemInstruction

      public boolean hasSystemInstruction()
       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.
       
      optional .google.cloud.aiplatform.v1.Content system_instruction = 5 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      hasSystemInstruction in interface CountTokensRequestOrBuilder
      Returns:
      Whether the systemInstruction field is set.
    • getSystemInstruction

      public Content getSystemInstruction()
       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.
       
      optional .google.cloud.aiplatform.v1.Content system_instruction = 5 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getSystemInstruction in interface CountTokensRequestOrBuilder
      Returns:
      The systemInstruction.
    • getSystemInstructionOrBuilder

      public ContentOrBuilder getSystemInstructionOrBuilder()
       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.
       
      optional .google.cloud.aiplatform.v1.Content system_instruction = 5 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getSystemInstructionOrBuilder in interface CountTokensRequestOrBuilder
    • getToolsList

      public List<Tool> getToolsList()
       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.
       
      repeated .google.cloud.aiplatform.v1.Tool tools = 6 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getToolsList in interface CountTokensRequestOrBuilder
    • getToolsOrBuilderList

      public List<? extends ToolOrBuilder> getToolsOrBuilderList()
       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.
       
      repeated .google.cloud.aiplatform.v1.Tool tools = 6 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getToolsOrBuilderList in interface CountTokensRequestOrBuilder
    • getToolsCount

      public int getToolsCount()
       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.
       
      repeated .google.cloud.aiplatform.v1.Tool tools = 6 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getToolsCount in interface CountTokensRequestOrBuilder
    • getTools

      public Tool getTools(int index)
       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.
       
      repeated .google.cloud.aiplatform.v1.Tool tools = 6 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getTools in interface CountTokensRequestOrBuilder
    • getToolsOrBuilder

      public ToolOrBuilder getToolsOrBuilder(int index)
       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.
       
      repeated .google.cloud.aiplatform.v1.Tool tools = 6 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getToolsOrBuilder in interface CountTokensRequestOrBuilder
    • hasGenerationConfig

      public boolean hasGenerationConfig()
       Optional. Generation config that the model will use to generate the
       response.
       
      optional .google.cloud.aiplatform.v1.GenerationConfig generation_config = 7 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      hasGenerationConfig in interface CountTokensRequestOrBuilder
      Returns:
      Whether the generationConfig field is set.
    • getGenerationConfig

      public GenerationConfig getGenerationConfig()
       Optional. Generation config that the model will use to generate the
       response.
       
      optional .google.cloud.aiplatform.v1.GenerationConfig generation_config = 7 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getGenerationConfig in interface CountTokensRequestOrBuilder
      Returns:
      The generationConfig.
    • getGenerationConfigOrBuilder

      public GenerationConfigOrBuilder getGenerationConfigOrBuilder()
       Optional. Generation config that the model will use to generate the
       response.
       
      optional .google.cloud.aiplatform.v1.GenerationConfig generation_config = 7 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getGenerationConfigOrBuilder in interface CountTokensRequestOrBuilder
    • isInitialized

      public final boolean isInitialized()
      Specified by:
      isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
      Overrides:
      isInitialized in class com.google.protobuf.GeneratedMessage
    • writeTo

      public void writeTo(com.google.protobuf.CodedOutputStream output) throws IOException
      Specified by:
      writeTo in interface com.google.protobuf.MessageLite
      Overrides:
      writeTo in class com.google.protobuf.GeneratedMessage
      Throws:
      IOException
    • getSerializedSize

      public int getSerializedSize()
      Specified by:
      getSerializedSize in interface com.google.protobuf.MessageLite
      Overrides:
      getSerializedSize in class com.google.protobuf.GeneratedMessage
    • equals

      public boolean equals(Object obj)
      Specified by:
      equals in interface com.google.protobuf.Message
      Overrides:
      equals in class com.google.protobuf.AbstractMessage
    • hashCode

      public int hashCode()
      Specified by:
      hashCode in interface com.google.protobuf.Message
      Overrides:
      hashCode in class com.google.protobuf.AbstractMessage
    • parseFrom

      public static CountTokensRequest parseFrom(ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static CountTokensRequest parseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static CountTokensRequest parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static CountTokensRequest parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static CountTokensRequest parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static CountTokensRequest parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static CountTokensRequest parseFrom(InputStream input) throws IOException
      Throws:
      IOException
    • parseFrom

      public static CountTokensRequest parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Throws:
      IOException
    • parseDelimitedFrom

      public static CountTokensRequest parseDelimitedFrom(InputStream input) throws IOException
      Throws:
      IOException
    • parseDelimitedFrom

      public static CountTokensRequest parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Throws:
      IOException
    • parseFrom

      public static CountTokensRequest parseFrom(com.google.protobuf.CodedInputStream input) throws IOException
      Throws:
      IOException
    • parseFrom

      public static CountTokensRequest parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Throws:
      IOException
    • newBuilderForType

      public CountTokensRequest.Builder newBuilderForType()
      Specified by:
      newBuilderForType in interface com.google.protobuf.Message
      Specified by:
      newBuilderForType in interface com.google.protobuf.MessageLite
    • newBuilder

      public static CountTokensRequest.Builder newBuilder()
    • newBuilder

      public static CountTokensRequest.Builder newBuilder(CountTokensRequest prototype)
    • toBuilder

      public CountTokensRequest.Builder toBuilder()
      Specified by:
      toBuilder in interface com.google.protobuf.Message
      Specified by:
      toBuilder in interface com.google.protobuf.MessageLite
    • newBuilderForType

      protected CountTokensRequest.Builder newBuilderForType(com.google.protobuf.AbstractMessage.BuilderParent parent)
      Overrides:
      newBuilderForType in class com.google.protobuf.AbstractMessage
    • getDefaultInstance

      public static CountTokensRequest getDefaultInstance()
    • parser

      public static com.google.protobuf.Parser<CountTokensRequest> parser()
    • getParserForType

      public com.google.protobuf.Parser<CountTokensRequest> getParserForType()
      Specified by:
      getParserForType in interface com.google.protobuf.Message
      Specified by:
      getParserForType in interface com.google.protobuf.MessageLite
      Overrides:
      getParserForType in class com.google.protobuf.GeneratedMessage
    • getDefaultInstanceForType

      public CountTokensRequest getDefaultInstanceForType()
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder