use real context window size
This commit is contained in:
1 parent
af0d2f31a7
commit
22b2e50210
1 file changed
+4
-2
@@ -156,7 +156,8 @@ async function getFileOrFolderContent(mentionPath: string, cwd: string): Promise
|
||||
if (isBinary) {
|
||||
return "(Binary file, unable to display content)"
|
||||
}
|
||||
const content = await extractTextFromFile(absPath, 128_000) // Use standard context window size
|
||||
const contextWindow = this.api.getModel().info.contextWindow || 128_000
|
||||
const content = await extractTextFromFile(absPath, contextWindow)
|
||||
return content
|
||||
} else if (stats.isDirectory()) {
|
||||
const entries = await fs.readdir(absPath, { withFileTypes: true })
|
||||
@@ -177,7 +178,8 @@ async function getFileOrFolderContent(mentionPath: string, cwd: string): Promise
|
||||
if (isBinary) {
|
||||
return undefined
|
||||
}
|
||||
const content = await extractTextFromFile(absoluteFilePath, 128_000) // Use standard context window size
|
||||
const contextWindow = this.api.getModel().info.contextWindow || 128_000
|
||||
const content = await extractTextFromFile(absoluteFilePath, contextWindow)
|
||||
return `<file_content path="${filePath.toPosix()}">\n${content}\n</file_content>`
|
||||
} catch (error) {
|
||||
return undefined
|
||||
|
||||
Reference in new issue
Block a user