1+ import ChatContextCollector
12import ChatService
23import ChatTab
4+ import CodableWrappers
35import Combine
46import ComposableArchitecture
57import Foundation
@@ -21,6 +23,7 @@ public class ChatGPTChatTab: ChatTab {
2123 var configuration : OverridingChatGPTConfiguration . Overriding
2224 var systemPrompt : String
2325 var extraSystemPrompt : String
26+ var defaultScopes : Set < ChatContext . Scope > ?
2427 }
2528
2629 struct Builder : ChatTabBuilder {
@@ -65,7 +68,8 @@ public class ChatGPTChatTab: ChatTab {
6568 history: await service. memory. history,
6669 configuration: service. configuration. overriding,
6770 systemPrompt: service. systemPrompt,
68- extraSystemPrompt: service. extraSystemPrompt
71+ extraSystemPrompt: service. extraSystemPrompt,
72+ defaultScopes: service. defaultScopes
6973 )
7074 return ( try ? JSONEncoder ( ) . encode ( state) ) ?? Data ( )
7175 }
@@ -79,6 +83,9 @@ public class ChatGPTChatTab: ChatTab {
7983 tab. service. configuration. overriding = state. configuration
8084 tab. service. mutateSystemPrompt ( state. systemPrompt)
8185 tab. service. mutateExtraSystemPrompt ( state. extraSystemPrompt)
86+ if let scopes = state. defaultScopes {
87+ tab. service. defaultScopes = scopes
88+ }
8289 await tab. service. memory. mutateHistory { history in
8390 history = state. history
8491 }
0 commit comments