This plugin allows the Cheshire Cat to use tools written in R language
(and to run R code, in general)
- Just download the
cc_Rtools
folder intocheshire-cat/core/cat/plugins
in your machine.
Simply add to the cat's default docker-compose.yml the following code:
r-env:
build: https://github.com/dejan94it/cc_Rtools.git#main:plumber_container
container_name: r_env
expose:
- "5079:5000"
restart: unless-stopped
and obviously run docker compose up
again, to add the new container to the network.
You can look at the whole docker.compose.yaml
as example. You can also use it directly, but be sure that the original one is the same for the core part.
- Write a
yourscript.R
file and put it intocc_Rtools
folder. - Add a @tool in
Rtools.py
usingrun_Rtool(R_url, "yourscript.R")
in it.
You can look at the example of today.R
tool, already present in the folder.
- You can install all the R packages you need to run your custom tools, just modifying the Dockerfile.
- You can add other endpoints (and documentation) in
plumber.R
file.
Enjoy, and obviously, contribute! :)
Ciao Piero ❤️