A partire dal 29 aprile 2025, i modelli Gemini 1.5 Pro e Gemini 1.5 Flash non sono disponibili nei progetti che non li hanno mai utilizzati, inclusi i nuovi progetti. Per maggiori dettagli, vedi Versioni e ciclo di vita dei modelli.
Obbligatorio. Il nome dell'endpoint per cui è stato richiesto il conteggio dei token.
Formato:
projects/{project}/locations/{location}/endpoints/{endpoint}
Obbligatorio. Il nome dell'endpoint per cui è stato richiesto il conteggio dei token.
Formato:
projects/{project}/locations/{location}/endpoints/{endpoint}
Obbligatorio. Le istanze che costituiscono l'input della chiamata di conteggio dei token.
Lo schema è identico a quello di previsione del modello sottostante.
Obbligatorio. Le istanze che costituiscono l'input della chiamata di conteggio dei token.
Lo schema è identico a quello di previsione del modello sottostante.
Obbligatorio. Le istanze che costituiscono l'input della chiamata di conteggio dei token.
Lo schema è identico a quello di previsione del modello sottostante.
public abstract ValueOrBuilder getInstancesOrBuilder(int index)
Obbligatorio. Le istanze che costituiscono l'input della chiamata di conteggio dei token.
Lo schema è identico a quello di previsione del modello sottostante.
public abstract List<? extends ValueOrBuilder> getInstancesOrBuilderList()
Obbligatorio. Le istanze che costituiscono l'input della chiamata di conteggio dei token.
Lo schema è identico a quello di previsione del modello sottostante.
Obbligatorio. Il nome del modello del publisher richiesto per fornire la previsione. Formato:
projects/{project}/locations/{location}/publishers/*/models/*
string model = 3 [(.google.api.field_behavior) = REQUIRED];
Obbligatorio. Il nome del modello del publisher richiesto per fornire la previsione. Formato:
projects/{project}/locations/{location}/publishers/*/models/*
string model = 3 [(.google.api.field_behavior) = REQUIRED];
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Difficile da capire","hardToUnderstand","thumb-down"],["Informazioni o codice di esempio errati","incorrectInformationOrSampleCode","thumb-down"],["Mancano le informazioni o gli esempi di cui ho bisogno","missingTheInformationSamplesINeed","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2024-05-17 UTC."],[],[],null,["# Interface CountTokensRequestOrBuilder (1.32.0)\n\n public interface CountTokensRequestOrBuilder extends MessageOrBuilder\n\nImplements\n----------\n\n[MessageOrBuilder](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.MessageOrBuilder.html)\n\nMethods\n-------\n\n### getContents(int index)\n\n public abstract Content getContents(int index)\n\nOptional. Input content.\n\n`\nrepeated .google.cloud.vertexai.v1.Content contents = 4 [(.google.api.field_behavior) = OPTIONAL];\n`\n\n### getContentsCount()\n\n public abstract int getContentsCount()\n\nOptional. Input content.\n\n`\nrepeated .google.cloud.vertexai.v1.Content contents = 4 [(.google.api.field_behavior) = OPTIONAL];\n`\n\n### getContentsList()\n\n public abstract List\u003cContent\u003e getContentsList()\n\nOptional. Input content.\n\n`\nrepeated .google.cloud.vertexai.v1.Content contents = 4 [(.google.api.field_behavior) = OPTIONAL];\n`\n\n### getContentsOrBuilder(int index)\n\n public abstract ContentOrBuilder getContentsOrBuilder(int index)\n\nOptional. Input content.\n\n`\nrepeated .google.cloud.vertexai.v1.Content contents = 4 [(.google.api.field_behavior) = OPTIONAL];\n`\n\n### getContentsOrBuilderList()\n\n public abstract List\u003c? extends ContentOrBuilder\u003e getContentsOrBuilderList()\n\nOptional. Input content.\n\n`\nrepeated .google.cloud.vertexai.v1.Content contents = 4 [(.google.api.field_behavior) = OPTIONAL];\n`\n\n### getEndpoint()\n\n public abstract String getEndpoint()\n\nRequired. The name of the Endpoint requested to perform token counting.\nFormat:\n`projects/{project}/locations/{location}/endpoints/{endpoint}`\n\n`\nstring endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }\n`\n\n### getEndpointBytes()\n\n public abstract ByteString getEndpointBytes()\n\nRequired. The name of the Endpoint requested to perform token counting.\nFormat:\n`projects/{project}/locations/{location}/endpoints/{endpoint}`\n\n`\nstring endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }\n`\n\n### getGenerationConfig()\n\n public abstract GenerationConfig getGenerationConfig()\n\nOptional. Generation config that the model will use to generate the\nresponse.\n\n`\noptional .google.cloud.vertexai.v1.GenerationConfig generation_config = 7 [(.google.api.field_behavior) = OPTIONAL];\n`\n\n### getGenerationConfigOrBuilder()\n\n public abstract GenerationConfigOrBuilder getGenerationConfigOrBuilder()\n\nOptional. Generation config that the model will use to generate the\nresponse.\n\n`\noptional .google.cloud.vertexai.v1.GenerationConfig generation_config = 7 [(.google.api.field_behavior) = OPTIONAL];\n`\n\n### getInstances(int index)\n\n public abstract Value getInstances(int index)\n\nOptional. The instances that are the input to token counting call.\nSchema is identical to the prediction schema of the underlying model.\n\n`repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = OPTIONAL];\n`\n\n### getInstancesCount()\n\n public abstract int getInstancesCount()\n\nOptional. The instances that are the input to token counting call.\nSchema is identical to the prediction schema of the underlying model.\n\n`repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = OPTIONAL];\n`\n\n### getInstancesList()\n\n public abstract List\u003cValue\u003e getInstancesList()\n\nOptional. The instances that are the input to token counting call.\nSchema is identical to the prediction schema of the underlying model.\n\n`repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = OPTIONAL];\n`\n\n### getInstancesOrBuilder(int index)\n\n public abstract ValueOrBuilder getInstancesOrBuilder(int index)\n\nOptional. The instances that are the input to token counting call.\nSchema is identical to the prediction schema of the underlying model.\n\n`repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = OPTIONAL];\n`\n\n### getInstancesOrBuilderList()\n\n public abstract List\u003c? extends ValueOrBuilder\u003e getInstancesOrBuilderList()\n\nOptional. The instances that are the input to token counting call.\nSchema is identical to the prediction schema of the underlying model.\n\n`repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = OPTIONAL];\n`\n\n### getModel()\n\n public abstract String getModel()\n\nOptional. The name of the publisher model requested to serve the\nprediction. Format:\n`projects/{project}/locations/{location}/publishers/*/models/*`\n\n`string model = 3 [(.google.api.field_behavior) = OPTIONAL];`\n\n### getModelBytes()\n\n public abstract ByteString getModelBytes()\n\nOptional. The name of the publisher model requested to serve the\nprediction. Format:\n`projects/{project}/locations/{location}/publishers/*/models/*`\n\n`string model = 3 [(.google.api.field_behavior) = OPTIONAL];`\n\n### getSystemInstruction()\n\n public abstract Content getSystemInstruction()\n\nOptional. The user provided system instructions for the model.\nNote: only text should be used in parts and content in each part will be in\na separate paragraph.\n\n`\noptional .google.cloud.vertexai.v1.Content system_instruction = 5 [(.google.api.field_behavior) = OPTIONAL];\n`\n\n### getSystemInstructionOrBuilder()\n\n public abstract ContentOrBuilder getSystemInstructionOrBuilder()\n\nOptional. The user provided system instructions for the model.\nNote: only text should be used in parts and content in each part will be in\na separate paragraph.\n\n`\noptional .google.cloud.vertexai.v1.Content system_instruction = 5 [(.google.api.field_behavior) = OPTIONAL];\n`\n\n### getTools(int index)\n\n public abstract Tool getTools(int index)\n\nOptional. A list of `Tools` the model may use to generate the next\nresponse.\n\nA `Tool` is a piece of code that enables the system to interact with\nexternal systems to perform an action, or set of actions, outside of\nknowledge and scope of the model.\n\n`\nrepeated .google.cloud.vertexai.v1.Tool tools = 6 [(.google.api.field_behavior) = OPTIONAL];\n`\n\n### getToolsCount()\n\n public abstract int getToolsCount()\n\nOptional. A list of `Tools` the model may use to generate the next\nresponse.\n\nA `Tool` is a piece of code that enables the system to interact with\nexternal systems to perform an action, or set of actions, outside of\nknowledge and scope of the model.\n\n`\nrepeated .google.cloud.vertexai.v1.Tool tools = 6 [(.google.api.field_behavior) = OPTIONAL];\n`\n\n### getToolsList()\n\n public abstract List\u003cTool\u003e getToolsList()\n\nOptional. A list of `Tools` the model may use to generate the next\nresponse.\n\nA `Tool` is a piece of code that enables the system to interact with\nexternal systems to perform an action, or set of actions, outside of\nknowledge and scope of the model.\n\n`\nrepeated .google.cloud.vertexai.v1.Tool tools = 6 [(.google.api.field_behavior) = OPTIONAL];\n`\n\n### getToolsOrBuilder(int index)\n\n public abstract ToolOrBuilder getToolsOrBuilder(int index)\n\nOptional. A list of `Tools` the model may use to generate the next\nresponse.\n\nA `Tool` is a piece of code that enables the system to interact with\nexternal systems to perform an action, or set of actions, outside of\nknowledge and scope of the model.\n\n`\nrepeated .google.cloud.vertexai.v1.Tool tools = 6 [(.google.api.field_behavior) = OPTIONAL];\n`\n\n### getToolsOrBuilderList()\n\n public abstract List\u003c? extends ToolOrBuilder\u003e getToolsOrBuilderList()\n\nOptional. A list of `Tools` the model may use to generate the next\nresponse.\n\nA `Tool` is a piece of code that enables the system to interact with\nexternal systems to perform an action, or set of actions, outside of\nknowledge and scope of the model.\n\n`\nrepeated .google.cloud.vertexai.v1.Tool tools = 6 [(.google.api.field_behavior) = OPTIONAL];\n`\n\n### hasGenerationConfig()\n\n public abstract boolean hasGenerationConfig()\n\nOptional. Generation config that the model will use to generate the\nresponse.\n\n`\noptional .google.cloud.vertexai.v1.GenerationConfig generation_config = 7 [(.google.api.field_behavior) = OPTIONAL];\n`\n\n### hasSystemInstruction()\n\n public abstract boolean hasSystemInstruction()\n\nOptional. The user provided system instructions for the model.\nNote: only text should be used in parts and content in each part will be in\na separate paragraph.\n\n`\noptional .google.cloud.vertexai.v1.Content system_instruction = 5 [(.google.api.field_behavior) = OPTIONAL];\n`"]]