-
Notifications
You must be signed in to change notification settings - Fork 923
VinF Hybrid Inference #1: Update the API #8874
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: vertexai-hybridinference-integration
Are you sure you want to change the base?
Changes from all commits
f9faf27
10f99a7
cb88d70
7752cb0
0d628cf
9302d67
eb6ae3c
b4aeabc
2c8915e
ae1c254
559bd13
814a1dc
78fed95
8302584
d8f8fb3
d4ae4e0
3ec2857
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
Project: /docs/reference/js/_project.yaml | ||
Book: /docs/reference/_book.yaml | ||
page_type: reference | ||
|
||
{% comment %} | ||
DO NOT EDIT THIS FILE! | ||
This is generated by the JS SDK team, and any local changes will be | ||
overwritten. Changes should be made in the source code at | ||
https://github.com/firebase/firebase-js-sdk | ||
{% endcomment %} | ||
|
||
# HybridParams interface | ||
Toggles hybrid inference. | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
export interface HybridParams | ||
``` | ||
|
||
## Properties | ||
|
||
| Property | Type | Description | | ||
| --- | --- | --- | | ||
| [inCloudParams](./vertexai.hybridparams.md#hybridparamsincloudparams) | [ModelParams](./vertexai.modelparams.md#modelparams_interface) | Optional. Specifies advanced params for in-cloud inference. | | ||
| [mode](./vertexai.hybridparams.md#hybridparamsmode) | [InferenceMode](./vertexai.md#inferencemode) | Specifies on-device or in-cloud inference. Defaults to prefer on-device. | | ||
| [onDeviceParams](./vertexai.hybridparams.md#hybridparamsondeviceparams) | AILanguageModelCreateOptionsWithSystemPrompt | Optional. Specifies advanced params for on-device inference. | | ||
|
||
## HybridParams.inCloudParams | ||
|
||
Optional. Specifies advanced params for in-cloud inference. | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
inCloudParams?: ModelParams; | ||
``` | ||
|
||
## HybridParams.mode | ||
|
||
Specifies on-device or in-cloud inference. Defaults to prefer on-device. | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
mode: InferenceMode; | ||
``` | ||
|
||
## HybridParams.onDeviceParams | ||
|
||
Optional. Specifies advanced params for on-device inference. | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
onDeviceParams?: AILanguageModelCreateOptionsWithSystemPrompt; | ||
``` |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -213,3 +213,28 @@ export interface FunctionCallingConfig { | |
mode?: FunctionCallingMode; | ||
allowedFunctionNames?: string[]; | ||
} | ||
|
||
/** | ||
* Toggles hybrid inference. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you add the |
||
*/ | ||
export interface HybridParams { | ||
/** | ||
* Specifies on-device or in-cloud inference. Defaults to prefer on-device. | ||
*/ | ||
mode: InferenceMode; | ||
/** | ||
* Optional. Specifies advanced params for on-device inference. | ||
*/ | ||
onDeviceParams?: AILanguageModelCreateOptionsWithSystemPrompt; | ||
/** | ||
* Optional. Specifies advanced params for in-cloud inference. | ||
*/ | ||
inCloudParams?: ModelParams; | ||
} | ||
/** | ||
* Determines whether inference happens on-device or in-cloud. | ||
*/ | ||
export type InferenceMode = | ||
| 'prefer_on_device' | ||
| 'only_on_device' | ||
| 'only_in_cloud'; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,8 @@ | |
"strict": true, | ||
"outDir": "dist", | ||
"lib": [ | ||
"ESNext" | ||
"ESNext", | ||
"dom" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is this file changed? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Without this, adding the @types/dom-chromium-ai dependency causes the postsubmit script to fail. I'll try reproing the issue on a stand-alone branch. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Created PR #8916 to repro in CI env. |
||
], | ||
"module": "CommonJS", | ||
"moduleResolution": "node", | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we avoid defining a default model? If this model string is deprecated in the future, and a user is using an old version of the SDK, would using this default result in an error?