File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -156,7 +156,8 @@ async function getFileOrFolderContent(mentionPath: string, cwd: string): Promise
156156 if ( isBinary ) {
157157 return "(Binary file, unable to display content)"
158158 }
159- const content = await extractTextFromFile ( absPath , 128_000 ) // Use standard context window size
159+ const contextWindow = this . api . getModel ( ) . info . contextWindow || 128_000
160+ const content = await extractTextFromFile ( absPath , contextWindow )
160161 return content
161162 } else if ( stats . isDirectory ( ) ) {
162163 const entries = await fs . readdir ( absPath , { withFileTypes : true } )
@@ -177,7 +178,8 @@ async function getFileOrFolderContent(mentionPath: string, cwd: string): Promise
177178 if ( isBinary ) {
178179 return undefined
179180 }
180- const content = await extractTextFromFile ( absoluteFilePath , 128_000 ) // Use standard context window size
181+ const contextWindow = this . api . getModel ( ) . info . contextWindow || 128_000
182+ const content = await extractTextFromFile ( absoluteFilePath , contextWindow )
181183 return `<file_content path="${ filePath . toPosix ( ) } ">\n${ content } \n</file_content>`
182184 } catch ( error ) {
183185 return undefined
You can’t perform that action at this time.
0 commit comments