Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

find "tool" #34

Open
DavidSouther opened this issue Apr 9, 2024 · 0 comments
Open

find "tool" #34

DavidSouther opened this issue Apr 9, 2024 · 0 comments

Comments

@DavidSouther
Copy link
Owner

#18 describes an edit mode using lines. But which lines? Most authors can read line numbers in their editor, but that's a PITA.

Add a find "tool" (not an LLM tool as in requested by the LLM itself, but maybe it could be in the future) that "finds" a section of the input document based on a natural language query. It would return the lines to edit for edit mode.

ailly --find hello.js --prompt "the method whizbang"

Haiku prompt:

Human: The text of hello.js
Assistant: ...
Human: Examples of tree sitter scripts
Assistant:
Human: Write a tree sitter script for this question: the method whizbang

Possible reply:

(
            (comment)*
            .
            [
                (function_declaration name: (identifier) @name (#eq? @name "{whizbang}"))
                (assignment_expression
                    left: (identifier) @name (#eq? @name "{whizbang}")
                    right: (arrow_function)
                )
            ]
            )
            @fn

Then execute this against hello.js and get line numbers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant