Skip to main content

Module chatbot_tools

Module chatbot_tools 

Source

Modules§

action_tools
The confirm-and-execute primitive: a client tool whose confirmed answer runs a privileged mutation on the server instead of only rendering data the client already had.
argument_parsing
Shared helpers for parsing model-supplied tool arguments.
client_tools
Tools the client answers on the learner’s behalf, which suspend the turn until it does.
course_scope
Shared course resolution for tools that can act on a course other than the one the chatbot is on.
custom_tools
output_limits
Bounds on how much a tool call may hand back, so that no tool can produce an output the conversation cannot store.
provider_tools
tool_authorization
What a chatbot tool requires of its caller: checked against the turn before the tool is offered to the LLM, and against the call’s own arguments before it runs.
tool_category
Which categories of tools a chatbot configuration offers the LLM, independent of crate::chatbot_tools::tool_authorization::ToolRequirement: a category answers “does this chatbot offer this kind of tool”, not “may this caller use it”.

Macros§

chatbot_tool_registry 🔒
Defines the chatbot tools the LLM can call, split by who produces the output of a call.

Structs§

ActionToolOutcome
What executing a confirmed (or declining an unconfirmed) action tool call produced.
ChatbotToolCallResult
ToolCitation
One page reference a tool call’s output cites, ready to become a headless_lms_models::chatbot_conversation_messages_citations::ChatbotConversationMessageCitation row once the message it was attached beside is stored.
ToolProperties

Enums§

ClientToolAnswer
What a client answered a tool call with.
ClientToolCallRefusal
Why a client tool call cannot go ahead, when the client’s answer to it (or the plan to suspend on it) has to become an explanation for the model rather than an error.
ClientToolName
The name of a client tool, generated into the frontend as a string union so it names one of [ClientChatbotTool::NAME] by construction instead of by a hand-copied literal.

Traits§

ChatbotTool
ChatbotToolDeclaration
What a tool is called and how it is declared to the LLM.
ClientChatbotTool
A tool whose output the client produces instead of server code.

Functions§

call_chatbot_tool
Run the chatbot tool the LLM asked for and return its arguments and its LLM-readable output.
certificate_validation_url 🔒
The public page a certificate’s verification id addresses, which is also where its image is viewed. Kept in sync by hand with certificateValidateRoute in shared-module/packages/common/src/utils/routes.ts.
check_client_tool_call
Checks that a client tool call can go ahead: its arguments parse, and its caller may make it against what those arguments target.
client_answer_data
The data a client answered with, as the tool’s own response shape.
client_tool_answer_output
Turns a client’s answer into the tool output the resumed turn reads.
client_tool_category
The category a client tool (including an action tool) belongs to, or None when no client-answered tool goes by that name.
delimited_tool_output 🔒
Wraps tool output for the LLM so that data from outside the conversation cannot be read as instructions about it, and enforces the one size limit every tool output has to respect.
execute_action_tool
Runs the confirmed (or records the declined) action tool call the LLM asked for.
get_chatbot_tool_definitions
Every tool the server runs, whoever is allowed to use it.
get_client_chatbot_tool_definitions
The client tool definitions this request may offer the LLM.
get_permitted_chatbot_tool_definitions
The server tool definitions this request may offer the LLM.
no_parameters
The parameter schema of a tool the LLM calls without arguments. Azure still requires a strict object schema that forbids additional properties.
search_url 🔒
An absolute {base_url}{path} URL with a single percent-encoded search query parameter. search can contain characters (e.g. a + in an email’s local part) that are not safe to interpolate into a query string directly.
tool_is_answered_by_client
Whether the client answers this tool call instead of server code, which is what decides that the turn suspends rather than answering the call itself.
tool_is_confirmable_action
Whether tool_name is a ConfirmableActionTool rather than a pure ClientChatbotTool: its answer runs a mutation through execute_action_tool instead of being rendered directly by client_tool_answer_output.