Abraxas-365 / Abraxas-365/langchain-rust

Simpler way to add tools

Offen
#228 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Rust
Sterne
1.3k
Forks
177
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

**Describe the solution you'd like**

Would be nice if you could use some macros to help define tools:

```
#[toolbox] // this makes the MyToolChest struct into a toolbox giving it the `get_impl_json` associated function
impl MyToolChest {
#[add_to_toolbox("tightens a bolt")] // this adds the following function to the toolbox with the description "tightens a bolt"
/// `bolt_location` - Location of bolt in need of tightening
pub fn bolt_tightener(bolt_location: String) -> Result {
// TODO add bolt tightening logic
Ok(format!("I might have tightend the bolt located here: {}", bolt_location))
}
}
```

This idea comes from: https://github.com/rseymour/func_me

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.