File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change 1414 * See the License for the specific language governing permissions and
1515 * limitations under the License.
1616 */
17- import { ImagenModelParams , ModelParams , VertexAIErrorCode } from './types' ;
17+ import {
18+ ImagenModelParams ,
19+ InferenceMode ,
20+ ModelParams ,
21+ VertexAIErrorCode
22+ } from './types' ;
1823import { VertexAIError } from './errors' ;
1924import { ImagenModel , getGenerativeModel , getImagenModel } from './api' ;
2025import { expect } from 'chai' ;
@@ -112,6 +117,13 @@ describe('Top level API', () => {
112117 ) ;
113118 }
114119 } ) ;
120+ it ( 'getGenerativeModel with HybridParams sets the model' , ( ) => {
121+ const genModel = getGenerativeModel ( fakeVertexAI , {
122+ mode : InferenceMode . ONLY_ON_CLOUD ,
123+ onCloudParams : { model : 'my-model' }
124+ } ) ;
125+ expect ( genModel . model ) . to . equal ( 'publishers/google/models/my-model' ) ;
126+ } ) ;
115127 it ( 'getImagenModel throws if no apiKey is provided' , ( ) => {
116128 const fakeVertexNoApiKey = {
117129 ...fakeVertexAI ,
You can’t perform that action at this time.
0 commit comments