Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/core/src/codewhispererChat/tools/toolShared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import path from 'path'
import fs from '../../shared/fs/fs'

export const maxToolResponseSize = 800_000
export const maxToolResponseSize = 200_000

export enum OutputKind {
Text = 'text',
Expand Down
6 changes: 5 additions & 1 deletion packages/core/src/codewhispererChat/tools/tool_index.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"type": "string"
},
"readRange": {
"description": "Optional parameter when reading files.\n * If none is given, the full file is shown. If provided, the file will be shown in the indicated line number range, e.g. [11, 12] will show lines 11 and 12. Indexing at 1 to start. Setting `[startLine, -1]` shows all lines from `startLine` to the end of the file.",
"description": "Optional parameter when reading files.\n * If none is given, the full file is shown. If provided, the file will be shown in the indicated line number range, e.g. [11, 12] will show lines 11 and 12. Indexing at 1 to start. Setting `[startLine, -1]` shows all lines from `startLine` to the end of the file. If the whole file is too large, try reading 4000 lines at once, for example: after reading [1, 4000], read [4000, 8000] next and repeat.",
"items": {
"type": "integer"
},
Expand All @@ -26,6 +26,10 @@
"inputSchema": {
"type": "object",
"properties": {
"explanation": {
"description": "One sentence explanation as to why this tool is being used, and how it contributes to the goal.",
"type": "string"
},
"command": {
"type": "string",
"enum": ["create", "strReplace", "insert", "append"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ describe('ToolUtils', function () {
const output: InvokeOutput = {
output: {
kind: OutputKind.Text,
content: 'a'.repeat(700_000),
content: 'a'.repeat(150_000),
},
}
assert.doesNotThrow(() => ToolUtils.validateOutput(output))
Expand All @@ -171,12 +171,12 @@ describe('ToolUtils', function () {
const output: InvokeOutput = {
output: {
kind: OutputKind.Text,
content: 'a'.repeat(900_000), // 900,000 characters
content: 'a'.repeat(200_001), // 200,001 characters
},
}
assert.throws(() => ToolUtils.validateOutput(output), {
name: 'Error',
message: 'Tool output exceeds maximum character limit of 800000',
message: 'Tool output exceeds maximum character limit of 200000',
})
})
})
Expand Down