File tree Expand file tree Collapse file tree 3 files changed +8
-18
lines changed
Tool/Sources/ChatContextCollector Expand file tree Collapse file tree 3 files changed +8
-18
lines changed Original file line number Diff line number Diff line change @@ -97,9 +97,9 @@ final class DynamicContextController {
9797 . filter { !$0. isEmpty }
9898 . joined ( separator: " \n \n " )
9999
100- let contextPrompts = contexts
100+ let retrievedContent = contexts
101101 . flatMap ( \. retrievedContent)
102- . filter { !$0. content. isEmpty }
102+ . filter { !$0. document . content. isEmpty }
103103 . sorted { $0. priority > $1. priority }
104104
105105 let contextualSystemPrompt = """
@@ -108,17 +108,7 @@ final class DynamicContextController {
108108 """
109109 await memory. mutateSystemPrompt ( contextualSystemPrompt)
110110 await memory. mutateContextSystemPrompt ( contextSystemPrompt)
111- await memory. mutateRetrievedContent ( contextPrompts. map {
112- . init(
113- title: " " ,
114- subTitle: " " ,
115- uri: " " ,
116- content: $0. content,
117- startLine: nil ,
118- endLine: nil ,
119- metadata: [ : ]
120- )
121- } )
111+ await memory. mutateRetrievedContent ( retrievedContent. map ( \. document) )
122112 functionProvider. append ( functions: contexts. flatMap ( \. functions) )
123113 }
124114}
Original file line number Diff line number Diff line change @@ -12,11 +12,11 @@ public struct ChatContext {
1212 }
1313
1414 public struct RetrievedContent {
15- public var content : String
15+ public var document : ChatMessage . Reference
1616 public var priority : Int
17-
18- public init ( content : String , priority: Int ) {
19- self . content = content
17+
18+ public init ( document : ChatMessage . Reference , priority: Int ) {
19+ self . document = document
2020 self . priority = priority
2121 }
2222 }
You can’t perform that action at this time.
0 commit comments