Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@jjuliano
Copy link
Member

@jjuliano jjuliano commented May 16, 2025

This PR introduces a feature that allows open-source LLMs to autonomously run scripts, akin to MCP or A2A.

LLM can choose multiple tools, and each tool output can influence the input of the next tool chain execution.

Tools can be defined in the LLM resource in the tools {} block, and can be triggered by the prompt, i.e. perform: @(request.params("q"))

For example:

tools {
        new {
                name = "add_two_numbers"
                script = "@(data.filepath("tools/1.0.0", "add_two_numbers.py"))"
                description = "add two integers and return the new number"
                parameters {
                        ["a"] { required = true; type = "integer"; description = "The first number" }
                        ["b"] { required = true; type = "integer"; description = "The second number" }
                }
        }
        new {
                name = "count_file_lines"
                script = "@(data.filepath("tools/1.0.0", "count_file_lines.py"))"
                description = "Count the number of lines in a file"
                parameters {
                        ["file_path"] { required = true; type = "string"; description = "Path to the file" }
                }
        }
}

the script = setting can take in file location of the script, or an inline shell script. It supports running python, ruby, typeScript, javascript, and shell-script based on file extension.

@jjuliano jjuliano merged commit a06715a into main May 16, 2025
6 checks passed
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

Successfully merging this pull request may close these issues.

2 participants