File tree 1 file changed +4
-4
lines changed 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -71,18 +71,18 @@ export function getVertexAI(
71
71
*/
72
72
export function getGenerativeModel (
73
73
vertexAI : VertexAI ,
74
- onCloudOrHybridParams : ModelParams | HybridParams ,
74
+ modelParams : ModelParams | HybridParams ,
75
75
requestOptions ?: RequestOptions
76
76
) : 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 ;
79
79
let onCloudParams : ModelParams ;
80
80
if ( hybridParams . mode ) {
81
81
onCloudParams = hybridParams . onCloudParams || {
82
82
model : 'gemini-2.0-flash-lite'
83
83
} ;
84
84
} else {
85
- onCloudParams = onCloudOrHybridParams as ModelParams ;
85
+ onCloudParams = modelParams as ModelParams ;
86
86
}
87
87
88
88
if ( ! onCloudParams . model ) {
You can’t perform that action at this time.
0 commit comments