Skip to content

Commit 42228fd

Browse files
committed
Update the relevant files instruction format to include an explanation in panel responses
- when requesting 'relevant files' in browser attach instruction for the model for it to explain decision below the list of files, like you do with code at cursor. Note, we don't want this behavior when run from `apps/editor/src/views/panel/backend/message-handlers/handle-find-relevant-files.ts`
1 parent 34e2823 commit 42228fd

2 files changed

Lines changed: 15 additions & 2 deletions

File tree

‎apps/editor/src/constants/instructions.ts‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,22 @@ Your response must begin with "**Relevant files:**", then list paths one under a
3636
3737
**Relevant files:**
3838
39+
- \`src/index.ts\`
3940
- \`src/hello.ts\`
4041
- \`src/welcome.ts\`
4142
</system>`
4243

44+
export const find_relevant_files_format_for_panel = `<system>
45+
Your response must begin with "**Relevant files:**", then list paths one under another, followed by a brief explanation. Example:
46+
47+
**Relevant files:**
48+
49+
- \`src/index.ts\`
50+
- \`src/hello.ts\`
51+
- \`src/welcome.ts\`
52+
53+
These files contain the core greeting logic and module exports.
54+
</system>`
55+
4356
export const voice_input_instructions =
4457
'Respond with a transcription of the following audio recording or text "(inaudible)", and nothing else.'

‎apps/editor/src/views/panel/backend/message-handlers/handle-send-to-browser.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import { replace_fragment_symbol } from '../utils/replace-fragment-symbol'
1616
import {
1717
code_at_cursor_instructions_for_panel,
1818
find_relevant_files_instructions_prefix,
19-
find_relevant_files_format
19+
find_relevant_files_format_for_panel
2020
} from '@/constants/instructions'
2121
import {
2222
get_recently_used_presets_or_groups_key,
@@ -332,7 +332,7 @@ export const handle_send_to_browser = async (params: {
332332
const instructions_to_use =
333333
config_find_relevant_files_instructions_prefix ||
334334
find_relevant_files_instructions_prefix
335-
system_instructions_xml = `${instructions_to_use}\n${find_relevant_files_format}`
335+
system_instructions_xml = `${instructions_to_use}\n${find_relevant_files_format_for_panel}`
336336
}
337337

338338
return {

0 commit comments

Comments
 (0)