mirror of
				https://github.com/MindWorkAI/AI-Studio.git
				synced 2025-10-31 16:00:21 +00:00 
			
		
		
		
	Save the selected provider for all assistants when converting to chats
This commit is contained in:
		
							parent
							
								
									e29efaa2db
								
							
						
					
					
						commit
						9656a61adf
					
				| @ -166,6 +166,7 @@ public abstract partial class AssistantBase : ComponentBase, IMessageBusReceiver | |||||||
|     { |     { | ||||||
|         this.chatThread = new() |         this.chatThread = new() | ||||||
|         { |         { | ||||||
|  |             SelectedProvider = this.providerSettings.Id, | ||||||
|             WorkspaceId = Guid.Empty, |             WorkspaceId = Guid.Empty, | ||||||
|             ChatId = Guid.NewGuid(), |             ChatId = Guid.NewGuid(), | ||||||
|             Name = string.Empty, |             Name = string.Empty, | ||||||
| @ -185,6 +186,7 @@ public abstract partial class AssistantBase : ComponentBase, IMessageBusReceiver | |||||||
|         var chatId = Guid.NewGuid(); |         var chatId = Guid.NewGuid(); | ||||||
|         this.chatThread = new() |         this.chatThread = new() | ||||||
|         { |         { | ||||||
|  |             SelectedProvider = this.providerSettings.Id, | ||||||
|             WorkspaceId = workspaceId, |             WorkspaceId = workspaceId, | ||||||
|             ChatId = chatId, |             ChatId = chatId, | ||||||
|             Name = name, |             Name = name, | ||||||
| @ -235,8 +237,13 @@ public abstract partial class AssistantBase : ComponentBase, IMessageBusReceiver | |||||||
|             Role = ChatRole.AI, |             Role = ChatRole.AI, | ||||||
|             Content = aiText, |             Content = aiText, | ||||||
|         }; |         }; | ||||||
|          | 
 | ||||||
|         this.chatThread?.Blocks.Add(this.resultingContentBlock); |         if (this.chatThread is not null) | ||||||
|  |         { | ||||||
|  |             this.chatThread.Blocks.Add(this.resultingContentBlock); | ||||||
|  |             this.chatThread.SelectedProvider = this.providerSettings.Id; | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|         this.isProcessing = true; |         this.isProcessing = true; | ||||||
|         this.StateHasChanged(); |         this.StateHasChanged(); | ||||||
|          |          | ||||||
| @ -284,7 +291,9 @@ public abstract partial class AssistantBase : ComponentBase, IMessageBusReceiver | |||||||
|         switch (destination) |         switch (destination) | ||||||
|         { |         { | ||||||
|             case Tools.Components.CHAT: |             case Tools.Components.CHAT: | ||||||
|                 MessageBus.INSTANCE.DeferMessage(this, sendToData.Event, this.ConvertToChatThread); |                 var convertedChatThread = this.ConvertToChatThread; | ||||||
|  |                 convertedChatThread = convertedChatThread with { SelectedProvider = this.providerSettings.Id }; | ||||||
|  |                 MessageBus.INSTANCE.DeferMessage(this, sendToData.Event, convertedChatThread); | ||||||
|                 break; |                 break; | ||||||
|              |              | ||||||
|             default: |             default: | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user