Skip to content

Commit ae1c254

Browse files
committed
Use in-cloud phrasing
1 parent 2c8915e commit ae1c254

File tree

4 files changed

+15
-15
lines changed

4 files changed

+15
-15
lines changed

packages/vertexai/src/api.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,8 @@ describe('Top level API', () => {
108108
});
109109
it('getGenerativeModel with HybridParams sets the model', () => {
110110
const genModel = getGenerativeModel(fakeVertexAI, {
111-
mode: InferenceMode.ONLY_ON_CLOUD,
112-
onCloudParams: { model: 'my-model' }
111+
mode: InferenceMode.ONLY_IN_CLOUD,
112+
inCloudParams: { model: 'my-model' }
113113
});
114114
expect(genModel.model).to.equal('publishers/google/models/my-model');
115115
});

packages/vertexai/src/api.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,22 +76,22 @@ export function getGenerativeModel(
7676
): GenerativeModel {
7777
// Uses the existence of HybridParams.mode to clarify the type of the modelParams input.
7878
const hybridParams = modelParams as HybridParams;
79-
let onCloudParams: ModelParams;
79+
let inCloudParams: ModelParams;
8080
if (hybridParams.mode) {
81-
onCloudParams = hybridParams.onCloudParams || {
81+
inCloudParams = hybridParams.inCloudParams || {
8282
model: 'gemini-2.0-flash-lite'
8383
};
8484
} else {
85-
onCloudParams = modelParams as ModelParams;
85+
inCloudParams = modelParams as ModelParams;
8686
}
8787

88-
if (!onCloudParams.model) {
88+
if (!inCloudParams.model) {
8989
throw new VertexAIError(
9090
VertexAIErrorCode.NO_MODEL,
9191
`Must provide a model name. Example: getGenerativeModel({ model: 'my-model-name' })`
9292
);
9393
}
94-
return new GenerativeModel(vertexAI, onCloudParams, requestOptions);
94+
return new GenerativeModel(vertexAI, inCloudParams, requestOptions);
9595
}
9696

9797
/**

packages/vertexai/src/types/enums.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -242,12 +242,12 @@ export enum Modality {
242242
}
243243

244244
/**
245-
* Determines whether inference happens on-device or on-cloud.
245+
* Determines whether inference happens on-device or in-cloud.
246246
* @public
247247
*/
248248
export enum InferenceMode {
249249
/**
250-
* Uses the on-device model if available, or falls back to the on-cloud model.
250+
* Uses the on-device model if available, or falls back to the in-cloud model.
251251
*/
252252
PREFER_ON_DEVICE = 'PREFER_ON_DEVICE',
253253

@@ -257,7 +257,7 @@ export enum InferenceMode {
257257
ONLY_ON_DEVICE = 'ONLY_ON_DEVICE',
258258

259259
/**
260-
* Exclusively uses the on-cloud model.
260+
* Exclusively uses the in-cloud model.
261261
*/
262-
ONLY_ON_CLOUD = 'ONLY_ON_CLOUD'
262+
ONLY_IN_CLOUD = 'ONLY_IN_CLOUD'
263263
}

packages/vertexai/src/types/requests.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -216,20 +216,20 @@ export interface FunctionCallingConfig {
216216
}
217217

218218
/**
219-
* Configures on-device and on-cloud inference.
219+
* Configures on-device and in-cloud inference.
220220
* @public
221221
*/
222222
export interface HybridParams {
223223
/**
224-
* Optional. Specifies on-device or on-cloud inference. Defaults to prefer on-device.
224+
* Optional. Specifies on-device or in-cloud inference. Defaults to prefer on-device.
225225
*/
226226
mode?: InferenceMode;
227227
/**
228228
* Optional. Specifies advanced params for on-device inference.
229229
*/
230230
onDeviceParams?: AILanguageModelCreateOptionsWithSystemPrompt;
231231
/**
232-
* Optional. Specifies advanced params for on-cloud inference.
232+
* Optional. Specifies advanced params for in-cloud inference.
233233
*/
234-
onCloudParams?: ModelParams;
234+
inCloudParams?: ModelParams;
235235
}

0 commit comments

Comments
 (0)