Skip to content
Open
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
4 changes: 2 additions & 2 deletions plugins/AI-Agent-Local/src/main/assets/prompts/tools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ tool_call_format:
examples:
- purpose: Greeting / question you can answer -> respond
call: '<tool_call>{"tool":"respond","args":{"message":"Hi! What would you like to build?"}}</tool_call>'
- purpose: Open a file (a bare name is fine here) -> open_file
call: '<tool_call>{"tool":"open_file","args":{"file_path":"{{EXAMPLE_FILE_NAME}}"}}</tool_call>'
- purpose: Show or read a file (source, build.gradle, strings.xml; a bare name is fine) -> read_file
call: '<tool_call>{"tool":"read_file","args":{"file_path":"{{EXAMPLE_FILE_NAME}}"}}</tool_call>'
- purpose: Change one line of a file -> edit_file
call: '<tool_call>{"tool":"edit_file","args":{"file_path":"{{EXAMPLE_FILE_PATH}}","old_string":"setTitle(\"Old\")","new_string":"setTitle(\"New\")"}}</tool_call>'
- purpose: Change two lines (note the \n, never a real line break) -> edit_file
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,15 @@ class LocalSystemPromptTest {
assertTrue(prompt.contains(""""query":"Foo""""))
}

@Test
fun givenTheShippedExamples_whenBuilding_thenOneShowsHowToReadAFile() {
// "Show me app/build.gradle" went to search_project while the prompt had no read_file example.
assertTrue(
prompt(examplePath = "src/Foo.kt")
.contains("""<tool_call>{"tool":"read_file","args":{"file_path":"Foo.kt"}}</tool_call>""")
)
}

@Test
fun givenADotfileExamplePath_whenBuilding_thenTheStemIsItsWholeName() {
assertTrue(prompt(examplePath = "app/.gitignore").contains(""""query":".gitignore""""))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ built_in_tools:
arguments:
file_path: Project-relative path of the file to open.
read_build_output:
description: Read the current build output and status
description: Read the log of the last build and whether it passed; to read build.gradle or any other file, use read_file
create_file:
description: Create a new file with given content
arguments:
Expand Down
Loading