Skip to contents

cb_register_tool registers a single cb_tool with an ellmer chat object. cb_register_tools is a convenience wrapper that registers all built-in tools at once.

Usage

cb_register_tool(chat, tool)

cb_register_tools(chat, cohort)

Arguments

chat

An ellmer chat object (e.g. from ellmer::chat_openai()).

tool

A cb_tool object.

cohort

A Cohort object.

Value

The chat object, invisibly (for piping).

Examples

if (FALSE) { # \dontrun{
source <- set_source(tblist(iris = iris)) |> autofilter(attach_as = "meta")
coh <- cohort(source)
chat <- ellmer::chat_openai()
chat |> cb_register_tools(coh)
chat$chat("Show me the available filters")
} # }