llm-chain-tools

Crates.iollm-chain-tools
lib.rsllm-chain-tools
version0.4.0
sourcesrc
created_at2023-04-07 22:33:28.53086
updated_at2023-04-12 07:49:56.5955
descriptionA library for providing Large Language Models with tools (also known as 'actions') that they can trigger
homepage
repositoryhttps://github.com/sobelio/llm-chain/
max_upload_size
id833259
size31,588
William Hรถgman Rudenmalm (williamhogman)

documentation

README

llm-chain-tools ๐Ÿ› ๏ธ

llm-chain-tools is an extension for the llm-chain crate, providing a collection of tools that can be used to give Large Language Models (LLMs) access to various utilities, such as running Bash commands on your computer or performing web searches.

Examples ๐Ÿ’ก

To help you get started, here is an example demonstrating how to use llm-chain-tools with llm-chain. You can find more examples in the examples folder in the repository.

use llm_chain::Parameters;
use llm_chain_tools::create_tool_prompt_segment;
use llm_chain_tools::tools::BashTool;
use llm_chain_tools::ToolCollection;
use std::boxed::Box;
// A simple example generating a prompt with some tools.

fn main() {
    let tool_collection = ToolCollection::new(vec![Box::new(BashTool::new())]);
    let prompt =
        create_tool_prompt_segment(&tool_collection, "Please perform the following task: {}");
    println!(
        "{}",
        prompt.format(&Parameters::new_with_text(
            "Find the file GOAL.txt and tell me its content."
        ))
    );
}

Features ๐ŸŒŸ

  • Tool management: Easily create and integrated a collection of tools that LLMs can use to perform various tasks.
  • Prompt integration: Seamlessly integrate tool descriptions into LLM prompts for more effective interactions.
  • Pre-defined tools: A submodule providing a variety of pre-defined tools for common tasks, ready for use.
  • Extensibility: Designed with extensibility in mind, making it easy to integrate additional tools as needed.

Getting Started ๐Ÿš€

To start using llm-chain-tools, add it as a dependency in your Cargo.toml:

[dependencies]
llm-chain = "0.1.0"
llm-chain-openai = "0.1.0"
llm-chain-tools = "0.1.0"

Then, refer to the documentation and examples to learn how to create and manage tools, integrate them into prompts, and more.

Commit count: 393

cargo fmt