Abraxas-365 / Abraxas-365/langchain-rust
Simpler way to add tools
- 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
Bewertung
Dieses Issue wurde noch nicht bewertet.