Starting April 29, 2025, Gemini 1.5 Pro and Gemini 1.5 Flash models are not available in projects that have no prior usage of these models, including new projects. For details, see Model versions and lifecycle.
Constructs an instance of GrpcLlmUtilityServiceStub, using the given settings. This is
protected so that it is easy to make a subclass, but otherwise, the static factory methods
should be preferred.
Constructs an instance of GrpcLlmUtilityServiceStub, using the given settings. This is
protected so that it is easy to make a subclass, but otherwise, the static factory methods
should be preferred.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Class GrpcLlmUtilityServiceStub (1.4.0)\n\n public class GrpcLlmUtilityServiceStub extends LlmUtilityServiceStub\n\ngRPC stub implementation for the LlmUtilityService service API.\n\nThis class is for advanced usage and reflects the underlying API directly. \n\nInheritance\n-----------\n\n[LlmUtilityServiceStub](/vertex-ai/generative-ai/docs/reference/java/1.4.0/com.google.cloud.vertexai.api.stub.LlmUtilityServiceStub) \\\u003e [java.lang.Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \\\u003e GrpcLlmUtilityServiceStub \n\nInherited Members\n-----------------\n\n[LlmUtilityServiceStub.close()](/vertex-ai/generative-ai/docs/reference/java/1.4.0/com.google.cloud.vertexai.api.stub.LlmUtilityServiceStub#com_google_cloud_vertexai_api_stub_LlmUtilityServiceStub_close__) \n[LlmUtilityServiceStub.computeTokensCallable()](/vertex-ai/generative-ai/docs/reference/java/1.4.0/com.google.cloud.vertexai.api.stub.LlmUtilityServiceStub#com_google_cloud_vertexai_api_stub_LlmUtilityServiceStub_computeTokensCallable__) \n[LlmUtilityServiceStub.countTokensCallable()](/vertex-ai/generative-ai/docs/reference/java/1.4.0/com.google.cloud.vertexai.api.stub.LlmUtilityServiceStub#com_google_cloud_vertexai_api_stub_LlmUtilityServiceStub_countTokensCallable__) \n[LlmUtilityServiceStub.getIamPolicyCallable()](/vertex-ai/generative-ai/docs/reference/java/1.4.0/com.google.cloud.vertexai.api.stub.LlmUtilityServiceStub#com_google_cloud_vertexai_api_stub_LlmUtilityServiceStub_getIamPolicyCallable__) \n[LlmUtilityServiceStub.getLocationCallable()](/vertex-ai/generative-ai/docs/reference/java/1.4.0/com.google.cloud.vertexai.api.stub.LlmUtilityServiceStub#com_google_cloud_vertexai_api_stub_LlmUtilityServiceStub_getLocationCallable__) \n[LlmUtilityServiceStub.listLocationsCallable()](/vertex-ai/generative-ai/docs/reference/java/1.4.0/com.google.cloud.vertexai.api.stub.LlmUtilityServiceStub#com_google_cloud_vertexai_api_stub_LlmUtilityServiceStub_listLocationsCallable__) \n[LlmUtilityServiceStub.listLocationsPagedCallable()](/vertex-ai/generative-ai/docs/reference/java/1.4.0/com.google.cloud.vertexai.api.stub.LlmUtilityServiceStub#com_google_cloud_vertexai_api_stub_LlmUtilityServiceStub_listLocationsPagedCallable__) \n[LlmUtilityServiceStub.setIamPolicyCallable()](/vertex-ai/generative-ai/docs/reference/java/1.4.0/com.google.cloud.vertexai.api.stub.LlmUtilityServiceStub#com_google_cloud_vertexai_api_stub_LlmUtilityServiceStub_setIamPolicyCallable__) \n[LlmUtilityServiceStub.testIamPermissionsCallable()](/vertex-ai/generative-ai/docs/reference/java/1.4.0/com.google.cloud.vertexai.api.stub.LlmUtilityServiceStub#com_google_cloud_vertexai_api_stub_LlmUtilityServiceStub_testIamPermissionsCallable__) \n[Object.clone()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--) \n[Object.equals(Object)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-) \n[Object.finalize()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--) \n[Object.getClass()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--) \n[Object.hashCode()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--) \n[Object.notify()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--) \n[Object.notifyAll()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--) \n[Object.toString()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--) \n[Object.wait()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--) \n[Object.wait(long)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-) \n[Object.wait(long,int)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-)\n\nStatic Methods\n--------------\n\n### create(ClientContext clientContext)\n\n public static final GrpcLlmUtilityServiceStub create(ClientContext clientContext)\n\n### create(ClientContext clientContext, GrpcStubCallableFactory callableFactory)\n\n public static final GrpcLlmUtilityServiceStub create(ClientContext clientContext, GrpcStubCallableFactory callableFactory)\n\n### create(LlmUtilityServiceStubSettings settings)\n\n public static final GrpcLlmUtilityServiceStub create(LlmUtilityServiceStubSettings settings)\n\nConstructors\n------------\n\n### GrpcLlmUtilityServiceStub(LlmUtilityServiceStubSettings settings, ClientContext clientContext)\n\n protected GrpcLlmUtilityServiceStub(LlmUtilityServiceStubSettings settings, ClientContext clientContext)\n\nConstructs an instance of GrpcLlmUtilityServiceStub, using the given settings. This is\nprotected so that it is easy to make a subclass, but otherwise, the static factory methods\nshould be preferred.\n\n### GrpcLlmUtilityServiceStub(LlmUtilityServiceStubSettings settings, ClientContext clientContext, GrpcStubCallableFactory callableFactory)\n\n protected GrpcLlmUtilityServiceStub(LlmUtilityServiceStubSettings settings, ClientContext clientContext, GrpcStubCallableFactory callableFactory)\n\nConstructs an instance of GrpcLlmUtilityServiceStub, using the given settings. This is\nprotected so that it is easy to make a subclass, but otherwise, the static factory methods\nshould be preferred.\n\nMethods\n-------\n\n### awaitTermination(long duration, TimeUnit unit)\n\n public boolean awaitTermination(long duration, TimeUnit unit)\n\n### close()\n\n public final void close()\n\n**Overrides** \n[LlmUtilityServiceStub.close()](/vertex-ai/generative-ai/docs/reference/java/1.4.0/com.google.cloud.vertexai.api.stub.LlmUtilityServiceStub#com_google_cloud_vertexai_api_stub_LlmUtilityServiceStub_close__)\n\n### computeTokensCallable()\n\n public UnaryCallable\u003cComputeTokensRequest,ComputeTokensResponse\u003e computeTokensCallable()\n\n**Overrides** \n[LlmUtilityServiceStub.computeTokensCallable()](/vertex-ai/generative-ai/docs/reference/java/1.4.0/com.google.cloud.vertexai.api.stub.LlmUtilityServiceStub#com_google_cloud_vertexai_api_stub_LlmUtilityServiceStub_computeTokensCallable__)\n\n### countTokensCallable()\n\n public UnaryCallable\u003cCountTokensRequest,CountTokensResponse\u003e countTokensCallable()\n\n**Overrides** \n[LlmUtilityServiceStub.countTokensCallable()](/vertex-ai/generative-ai/docs/reference/java/1.4.0/com.google.cloud.vertexai.api.stub.LlmUtilityServiceStub#com_google_cloud_vertexai_api_stub_LlmUtilityServiceStub_countTokensCallable__)\n\n### getIamPolicyCallable()\n\n public UnaryCallable\u003cGetIamPolicyRequest,Policy\u003e getIamPolicyCallable()\n\n**Overrides** \n[LlmUtilityServiceStub.getIamPolicyCallable()](/vertex-ai/generative-ai/docs/reference/java/1.4.0/com.google.cloud.vertexai.api.stub.LlmUtilityServiceStub#com_google_cloud_vertexai_api_stub_LlmUtilityServiceStub_getIamPolicyCallable__)\n\n### getLocationCallable()\n\n public UnaryCallable\u003cGetLocationRequest,Location\u003e getLocationCallable()\n\n**Overrides** \n[LlmUtilityServiceStub.getLocationCallable()](/vertex-ai/generative-ai/docs/reference/java/1.4.0/com.google.cloud.vertexai.api.stub.LlmUtilityServiceStub#com_google_cloud_vertexai_api_stub_LlmUtilityServiceStub_getLocationCallable__)\n\n### getOperationsStub()\n\n public GrpcOperationsStub getOperationsStub()\n\n### isShutdown()\n\n public boolean isShutdown()\n\n### isTerminated()\n\n public boolean isTerminated()\n\n### listLocationsCallable()\n\n public UnaryCallable\u003cListLocationsRequest,ListLocationsResponse\u003e listLocationsCallable()\n\n**Overrides** \n[LlmUtilityServiceStub.listLocationsCallable()](/vertex-ai/generative-ai/docs/reference/java/1.4.0/com.google.cloud.vertexai.api.stub.LlmUtilityServiceStub#com_google_cloud_vertexai_api_stub_LlmUtilityServiceStub_listLocationsCallable__)\n\n### listLocationsPagedCallable()\n\n public UnaryCallable\u003cListLocationsRequest,LlmUtilityServiceClient.ListLocationsPagedResponse\u003e listLocationsPagedCallable()\n\n**Overrides** \n[LlmUtilityServiceStub.listLocationsPagedCallable()](/vertex-ai/generative-ai/docs/reference/java/1.4.0/com.google.cloud.vertexai.api.stub.LlmUtilityServiceStub#com_google_cloud_vertexai_api_stub_LlmUtilityServiceStub_listLocationsPagedCallable__)\n\n### setIamPolicyCallable()\n\n public UnaryCallable\u003cSetIamPolicyRequest,Policy\u003e setIamPolicyCallable()\n\n**Overrides** \n[LlmUtilityServiceStub.setIamPolicyCallable()](/vertex-ai/generative-ai/docs/reference/java/1.4.0/com.google.cloud.vertexai.api.stub.LlmUtilityServiceStub#com_google_cloud_vertexai_api_stub_LlmUtilityServiceStub_setIamPolicyCallable__)\n\n### shutdown()\n\n public void shutdown()\n\n### shutdownNow()\n\n public void shutdownNow()\n\n### testIamPermissionsCallable()\n\n public UnaryCallable\u003cTestIamPermissionsRequest,TestIamPermissionsResponse\u003e testIamPermissionsCallable()\n\n**Overrides** \n[LlmUtilityServiceStub.testIamPermissionsCallable()](/vertex-ai/generative-ai/docs/reference/java/1.4.0/com.google.cloud.vertexai.api.stub.LlmUtilityServiceStub#com_google_cloud_vertexai_api_stub_LlmUtilityServiceStub_testIamPermissionsCallable__)"]]