@@ -35,25 +35,16 @@ describe('Prompt templates', function () {
3535 describe ( `${ testConfig . toString ( ) } ` , ( ) => {
3636 describe ( 'Generative Model' , ( ) => {
3737 it ( 'successfully generates content' , async ( ) => {
38- const a = new AbortController ( ) ;
3938 const model = getTemplateGenerativeModel ( testConfig . ai , {
4039 baseUrl : STAGING_URL
4140 } ) ;
42- // a.abort();
43- try {
44- await model . generateContent (
45- `sassy-greeting-${ templateBackendSuffix (
46- testConfig . ai . backend . backendType
47- ) } `,
48- { name : 'John' } ,
49- { signal : a . signal , timeout : 100 }
50- ) ;
51- } catch ( e ) {
52- console . error ( e ) ;
53- if ( ( e as DOMException ) . name === 'AbortError' ) {
54- console . log ( 1 ) ;
55- }
56- }
41+ const { response } = await model . generateContent (
42+ `sassy-greeting-${ templateBackendSuffix (
43+ testConfig . ai . backend . backendType
44+ ) } `,
45+ { name : 'John' }
46+ ) ;
47+ expect ( response . text ( ) ) . to . contain ( 'John' ) ; // Template asks to address directly by name
5748 } ) ;
5849 } ) ;
5950 describe ( 'Imagen model' , async ( ) => {
@@ -65,8 +56,7 @@ describe('Prompt templates', function () {
6556 `portrait-${ templateBackendSuffix (
6657 testConfig . ai . backend . backendType
6758 ) } `,
68- { animal : 'Rhino' } ,
69- { timeout : 100 }
59+ { animal : 'Rhino' }
7060 ) ;
7161 expect ( images . length ) . to . equal ( 2 ) ; // We ask for two images in the prompt template
7262 } ) ;
0 commit comments