@@ -14,6 +14,7 @@ import { ToolkitError } from '../../../../shared/errors'
1414import { createCodeWhispererChatStreamingClient } from '../../../../shared/clients/codewhispererChatClient'
1515import { createQDeveloperStreamingClient } from '../../../../shared/clients/qDeveloperChatClient'
1616import { UserWrittenCodeTracker } from '../../../../codewhisperer/tracker/userWrittenCodeTracker'
17+ import { PromptMessage } from '../../../controllers/chat/model'
1718
1819export class ChatSession {
1920 private sessionId ?: string
@@ -22,12 +23,14 @@ export class ChatSession {
2223 * _filePath = The path helps the system locate exactly where to make the necessary changes in the project structure
2324 * _tempFilePath = Used to show the code diff view in the editor including LLM changes.
2425 * _showDiffOnFileWrite = Controls whether to show diff view (true) or file context view (false) to the user
26+ * _context = Additional context to be passed to the LLM for generating the response
2527 */
2628 private _readFiles : string [ ] = [ ]
2729 private _filePath : string | undefined
2830 private _tempFilePath : string | undefined
2931 private _toolUse : ToolUse | undefined
3032 private _showDiffOnFileWrite : boolean = false
33+ private _context : PromptMessage [ 'context' ]
3134
3235 contexts : Map < string , { first : number ; second : number } [ ] > = new Map ( )
3336 // TODO: doesn't handle the edge case when two files share the same relativePath string but from different root
@@ -45,6 +48,14 @@ export class ChatSession {
4548 this . _toolUse = toolUse
4649 }
4750
51+ public get context ( ) : PromptMessage [ 'context' ] {
52+ return this . _context
53+ }
54+
55+ public setContext ( context : PromptMessage [ 'context' ] ) {
56+ this . _context = context
57+ }
58+
4859 public tokenSource ! : vscode . CancellationTokenSource
4960
5061 constructor ( ) {
0 commit comments