Skip to content

Commit 2729b0b

Browse files
copybara-service[bot]Zhenyi Qi
andauthored
docs: [vertexai] Update javadoc of VertexAI and Transport. (#10296)
PiperOrigin-RevId: 602404969 Co-authored-by: Zhenyi Qi <[email protected]>
1 parent e87ef32 commit 2729b0b

File tree

2 files changed

+42
-7
lines changed

2 files changed

+42
-7
lines changed

java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/Transport.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@
1818

1919
/** Transport used for sending request. */
2020
public enum Transport {
21+
/** When used, the clients will send REST requests to the backing service. */
2122
REST,
23+
/**
24+
* When used, the clients will send gRPC to the backing service. This is usually more efficient
25+
* and is the default transport.
26+
*/
2227
GRPC
2328
}

java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/VertexAI.java

Lines changed: 37 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -123,27 +123,48 @@ public VertexAI(String projectId, String location, Transport transport, String..
123123
this.transport = transport;
124124
}
125125

126-
/** Returns the default {@link Transport} layer to use to send API requests. */
126+
/**
127+
* Returns the default {@link Transport} layer to use to send API requests.
128+
*
129+
* @return {@link Transport} layer used when sending API requests.
130+
*/
127131
public Transport getTransport() {
128132
return this.transport;
129133
}
130134

131-
/** Returns the default project to use when making API calls. */
135+
/**
136+
* Returns the default project to use when making API calls.
137+
*
138+
* @return Project ID in string format.
139+
*/
132140
public String getProjectId() {
133141
return this.projectId;
134142
}
135143

136-
/** Returns the default location to use when making API calls. */
144+
/**
145+
* Returns the default location to use when making API calls.
146+
*
147+
* @return Location in string format.
148+
*/
137149
public String getLocation() {
138150
return this.location;
139151
}
140152

141-
/** Returns the default endpoint to use when making API calls. */
153+
/**
154+
* Returns the default endpoint to use when making API calls.
155+
*
156+
* @return API endpoint in string format.
157+
*/
142158
public String getApiEndpoint() {
143159
return this.apiEndpoint;
144160
}
145161

146-
/** Returns the default credentials to use when making API calls. */
162+
/**
163+
* Returns the default credentials to use when making API calls.
164+
*
165+
* @return {@link Credentials} if the user has provided either scopes or credentials to the
166+
* VertexAI object.
167+
*/
147168
public Credentials getCredentials() throws IOException {
148169
return credentialsProvider.getCredentials();
149170
}
@@ -211,6 +232,9 @@ public PredictionServiceClient getPredictionServiceClient() throws IOException {
211232
/**
212233
* Returns the {@link PredictionServiceClient} with REST. The client will be instantiated when the
213234
* first prediction API call is made.
235+
*
236+
* @return {@link PredictionServiceClient} that send REST requests to the backing service through
237+
* method calls that map to the API methods.
214238
*/
215239
public PredictionServiceClient getPredictionServiceRestClient() throws IOException {
216240
if (predictionServiceRestClient == null) {
@@ -240,8 +264,11 @@ public PredictionServiceClient getPredictionServiceRestClient() throws IOExcepti
240264
}
241265

242266
/**
243-
* Returns the {@link PredictionServiceClient} with GRPC. The client will be instantiated when the
267+
* Returns the {@link LlmUtilityServiceClient} with GRPC. The client will be instantiated when the
244268
* first prediction API call is made.
269+
*
270+
* @return {@link LlmUtilityServiceClient} that makes gRPC calls to the backing service through
271+
* method calls that map to the API methods.
245272
*/
246273
public LlmUtilityServiceClient getLlmUtilityClient() throws IOException {
247274
if (llmUtilityClient == null) {
@@ -270,8 +297,11 @@ public LlmUtilityServiceClient getLlmUtilityClient() throws IOException {
270297
}
271298

272299
/**
273-
* Returns the {@link PredictionServiceClient} with GRPC. The client will be instantiated when the
300+
* Returns the {@link LlmUtilityServiceClient} with REST. The client will be instantiated when the
274301
* first prediction API call is made.
302+
*
303+
* @return {@link LlmUtilityServiceClient} that makes REST requests to the backing service through
304+
* method calls that map to the API methods.
275305
*/
276306
public LlmUtilityServiceClient getLlmUtilityRestClient() throws IOException {
277307
if (llmUtilityRestClient == null) {

0 commit comments

Comments
 (0)