Skip to main content

Crate toolapi

Crate toolapi 

Source

Re-exports§

pub use value::Value;

Modules§

value
The structured types exist to give values that could be expressed with [Dict]s and [List]s a known structure and meaning that tools / scripts can rely on. The number of these types is kept low to improve reuseability. They are useful to force tools / scripts to decide on one specific structure and to increase compatibility. They also increase maintenance burden, which means that for niche applications it is preferred that tool + script agree on a structure and use dynamic types instead of extending the toolapi.

Enums§

AbortReason
Sent over the server <-> tool channel to communicate an abort
ConnectionError
Returned by the WebSocket impls when trying to connect, send, recv
ExtractionError
Exclusively used by the Values struct when looking up a value
LookupError
Exclusively used by the Values struct when looking up a value
ParseError
Created during Message (de)serialization, part of ConnectionError
ToolCallError
Returned by the call() function running on the client
ToolError
Returned by the tool in the final result() call as reason if no value was computed. It is seriazable since it is the only error that ist actually sent over the WebSocket connection.

Functions§

call
Execute a tool hosted at url addr with inputs input.
run_server
Starts a server, running tool in parallel for every requesting client.

Type Aliases§

MessageFn
Function which prints a message, sends it to the client, and returns weather the client requested to abort the running tool.
ToolFn
Signature of tool functions passed to run_server.