@@ -96,7 +96,7 @@ And some sample html:
9696 } ,
9797] ;
9898
99- const draftMessage = { text : 'Hi' } ;
99+ // const draftMessage = { text: 'Hi' };
100100
101101const userMessages : any [ ] = [ ] ;
102102
@@ -146,7 +146,11 @@ const _customRenderer = {
146146const ai_chat_options = {
147147 headerText : 'Chat' ,
148148 inputPlaceholder : 'Type your message here...' ,
149- suggestions : [ 'Hello' , 'Hi' , 'Generate an image of a pig!' ] ,
149+ suggestions : [
150+ 'Hello' ,
151+ 'What is triskaidekaphobia?' ,
152+ 'Show me very short sample typescript code' ,
153+ ] ,
150154 templates : {
151155 // messageActionsTemplate: messageActionsTemplate,
152156 // typingIndicatorTemplate: _typingIndicatorTemplate,
@@ -365,7 +369,7 @@ async function handleAIMessageSend(e: CustomEvent) {
365369
366370 if ( newMessage . text . includes ( 'image' ) ) {
367371 response = await ai . models . generateContent ( {
368- model : 'gemini-2.5 -flash-preview-image-generation' ,
372+ model : 'gemini-2.0 -flash-preview-image-generation' ,
369373 contents : userMessages ,
370374 config : {
371375 responseModalities : [ Modality . TEXT , Modality . IMAGE ] ,
@@ -422,6 +426,7 @@ async function handleAIMessageSend(e: CustomEvent) {
422426 } ;
423427 chat . messages = [ ...chat . messages ] ;
424428 }
429+ chat . options = { ...ai_chat_options , suggestions : [ ] , isTyping : false } ;
425430
426431 const messagesForSuggestions = [
427432 ...chat . messages ,
@@ -441,15 +446,14 @@ async function handleAIMessageSend(e: CustomEvent) {
441446 const matches : IterableIterator < RegExpMatchArray > =
442447 responseText . matchAll ( regex ) ;
443448
444- const suggestions : string [ ] = Array . from (
449+ const suggestionsFromResponse : string [ ] = Array . from (
445450 matches ,
446451 ( match : RegExpMatchArray ) => match [ 1 ]
447452 ) ;
448453
449454 chat . options = {
450455 ...ai_chat_options ,
451- suggestions : suggestions ,
452- isTyping : false ,
456+ suggestions : suggestionsFromResponse ,
453457 } ;
454458 }
455459 }
@@ -492,7 +496,6 @@ export const AI: Story = {
492496 render : ( ) => html `
493497 < igc-chat
494498 style ="--igc-chat-height: calc(100vh - 32px); "
495- .draftMessage =${ draftMessage }
496499 .options =${ ai_chat_options }
497500 @igcMessageCreated =${ handleAIMessageSend }
498501 >
0 commit comments