File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -71,18 +71,18 @@ export function getVertexAI(
7171 */
7272export function getGenerativeModel (
7373 vertexAI : VertexAI ,
74- onCloudOrHybridParams : ModelParams | HybridParams ,
74+ modelParams : ModelParams | HybridParams ,
7575 requestOptions ?: RequestOptions
7676) : GenerativeModel {
77- // Disambiguates onCloudOrHybridParams input.
78- const hybridParams = onCloudOrHybridParams as HybridParams ;
77+ // Uses the existence of HybridParams.mode to clarify the type of the modelParams input.
78+ const hybridParams = modelParams as HybridParams ;
7979 let onCloudParams : ModelParams ;
8080 if ( hybridParams . mode ) {
8181 onCloudParams = hybridParams . onCloudParams || {
8282 model : 'gemini-2.0-flash-lite'
8383 } ;
8484 } else {
85- onCloudParams = onCloudOrHybridParams as ModelParams ;
85+ onCloudParams = modelParams as ModelParams ;
8686 }
8787
8888 if ( ! onCloudParams . model ) {
You can’t perform that action at this time.
0 commit comments