@@ -84,7 +84,7 @@ internal void Initialize()
8484 return ;
8585 }
8686 var apikey = "" ;
87- if ( supplier . IsFree )
87+ if ( supplier . Free )
8888 {
8989 logname = "AI-Free" ;
9090 if ( IsFreeAiUser ( fxb ) )
@@ -111,7 +111,7 @@ internal void Initialize()
111111 chatHistory = new ChatMessageHistory ( panAiConversation , supplier ? . Name , model ? . Endpoint , model ? . Name , apikey , fxb . settings . AiSettings . MyName ) ;
112112 metaAttributes . Clear ( ) ;
113113 SetTitle ( ) ;
114- if ( supplier . IsFree && ! IsFreeAiUser ( fxb ) )
114+ if ( supplier . Free && ! IsFreeAiUser ( fxb ) )
115115 {
116116 chatHistory . Add ( ChatRole . Assistant , @"To use the free AI provider, you have to fill in a form.
117117Please click the button (the three dots down-right) and select 'Ask for Free AI'.
@@ -165,7 +165,7 @@ internal static void PromptToUseForFree(PluginControlBase tool)
165165
166166 private void SetTitle ( )
167167 {
168- Text = $ "AI Chat - { supplier ? . Name ?? "<no provider>" } - { model ? . Name ?? "<no model>" } ";
168+ Text = $ "AI Chat - { supplier ? . ToString ( ) ?? "<no provider>" } - { model ? . Name ?? "<no model>" } ";
169169 TabText = Text ;
170170 }
171171
@@ -286,7 +286,7 @@ private void SendChatToAI(object sender, EventArgs e = null)
286286 }
287287 catch ( Exception ex )
288288 {
289- fxb . LogError ( $ "communicating with { supplier . Name } \n { ex . ExceptionDetails ( ) } \n { ex . StackTrace } ") ;
289+ fxb . LogError ( $ "Communicating with { supplier } : \n { ex . ExceptionDetails ( ) } \n { ex . StackTrace } ") ;
290290 fxb . ShowErrorDialog ( ex , "AI Chat" , "An error occurred while trying to communicate with the AI." ) ;
291291 }
292292 txtAiChat . Clear ( ) ;
@@ -420,9 +420,12 @@ private void PopupMessageIfRelevant()
420420 {
421421 var supporting = Supporting . IsMonetarySupporting ( fxb ) || Supporting . IsPending ( fxb ) ;
422422 if ( OnlineSettings . Instance . AiSupport . PopupByCallNos
423- . FirstOrDefault ( p => p . TimeToPopup ( fxb . settings . AiSettings . Calls , supporting ) ) is PopupByCallNo popup )
423+ . FirstOrDefault ( p => p . TimeToPopup ( fxb . settings . AiSettings . Calls , supporting , supplier . Free ) ) is PopupByCallNo popup )
424424 {
425- var message = popup . Message . Replace ( "{calls}" , fxb . settings . AiSettings . Calls . ToString ( ) ) ;
425+ var message = popup . Message
426+ . Replace ( "{calls}" , fxb . settings . AiSettings . Calls . ToString ( ) )
427+ . Replace ( "{provider}" , supplier . ToString ( ) )
428+ . Replace ( "{model}" , model . Name ) ;
426429 if ( popup . SuggestsSupporting )
427430 {
428431 if ( MessageBoxEx . Show ( fxb , message , "AI Chat" , MessageBoxButtons . OKCancel , MessageBoxIcon . Information ) == DialogResult . OK )
0 commit comments