Crate sapiens

Source
Expand description

Sapiens library

Sapiens uses tools to interact with the world.

An experiment with handing over the tools to the machine.

§Overview

This library is the core of Sapiens. It contains the logic for the interaction between the user, the language model and the tools.

§More information

See https://github.com/ssoudan/sapiens/tree/main/sapiens_cli for an example of usage or https://github.com/ssoudan/sapiens/tree/main/sapiens_bot for a Discord bot.

https://github.com/ssoudan/sapiens/tree/main/sapiens_exp is a framework to run experiments and collect traces of the interactions between the language model and the tools to accomplish a task.

A collection of tools is defined in https://github.com/ssoudan/sapiens/tree/main/sapiens_tools.

Modules§

chains
Execution chains
context
Maintain the context for the bot.
models
Language models
prompt
Prompt generation logic
tools
Toolbox for sapiens

Structs§

InvalidInvocationNotification
Invalid invocation notification
InvocationFailureNotification
Invocation failure notification
InvocationSuccessNotification
Invocation success notification
MessageNotification
A message from a scheduler
ModelNotification
An update from the model
SapiensConfig
Configuration for the bot
Step
A step in the task
Stop
The task is done
TerminationNotification
Termination notification
VoidTaskProgressUpdateObserver
A void observer

Enums§

ChainType
Type of chain to use
Error
The error type for the bot
InvocationResultNotification
Notification of the result of a tool invocation
TaskState
The state machine of a task

Traits§

RuntimeObserver
Observer for the step progresses

Functions§

run_to_the_end
Run until the task is done or the maximum number of steps is reached
wrap_observer
Wrap an observer into the a StrongRuntimeObserver<O> = Arc<Mutex<O>>

Type Aliases§

StrongRuntimeObserver
A strong reference to the observer
WeakRuntimeObserver
A weak reference to the observer