Skip to content

find "tool" #34

@DavidSouther

Description

@DavidSouther

#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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions