🔄 Big News! bazed.ai is now sagentic.ai. Same vision, new name!

Skip to content

Framework Reference ​

Enumerations ​

EnumerationDescription
MessageRoleRole of a message
ModelTypeAvailable model types

Classes ​

ClassDescription
BaseAgentBaseAgent is the base class for all agents.
It implements the basic agent lifecycle and convenience functions.
It also implements thread management.
This class is not directly usable and will throw unimplemented.
To implement a custom agent, extend this class (see initialize, finalize and step methods).
ClientOpenAI Client wrapper
ClientMuxClientMux is a multiplexer for clients of multiple OpenAI models.
FunctionToolTool is a spicy function that can describe itself with OpenAI compatible JSON schema.
InteractionInteraction is a single interaction in a conversation.
An interaction is a pair of messages, one from us to OpenAI and one from OpenAI to us.
The messages can be either text or tool calls or responses to tool calls.
Interactions are chained together to form a thread in a form of linked list.
An Interaction can be complete or incomplete.
An interaction is complete if we have received a response from OpenAI completing the interaction.
This means that if the last message in the interaction is from us, the interaction is not complete.
LedgerLedger tracks LLM invocations and associated token counts and costs
OneShotAgentBaseAgent is the base class for all agents.
It implements the basic agent lifecycle and convenience functions.
It also implements thread management.
This class is not directly usable and will throw unimplemented.
To implement a custom agent, extend this class (see initialize, finalize and step methods).
PCTPCT stands for prompt, completion and total quantities
ReactiveAgentReactiveAgent is a base class for agents that are defined in terms of reactions to structured messages.
SessionSession is the main bus for information exchange between threads and agents.
It also tallies the costs and manages the LLM invocations using supplied clients.
ThreadThread is a single thread of conversation.
In practice Thread just points to the last interaction in the thread.
Threads are only partially mutable, meaning that appending messages to a
thread creates a new thread if the last interaction tn the thread is complete.
TimingTiming holds start and end time.

Interfaces ​

InterfaceDescription
AgentEventsAgent events
AgentOptionsBasic options for an agent
ChildOf-
ConclusibleConclusible must be implemented by classes that can be concluded
IdentifiedIdentified must be implemented by classes containing Metadata
ImageContentPart-
ImageEmbed-
ImageUserContent-
LedgerEntryLedgerEntry represents a single LLM invocation
LedgerEventsEvents emitted by the Ledger
LoggerProvider-
MessageMessage sent in a conversation
MetadataMetadata is used to identify an object in the system and keep track of object hierarchy.
It is useful for logging, debugging and building object hierarchies.
ModelPricingDescribes model pricing and limits
ParentOf-
Reaction-
SessionEventsSession events
SessionOptionsSessionOptions is used to create a new session
SessionReportSessionReport is a report of the costs of the session
and the performance of the models used.
TextAssistantContent-
TextContentPart-
TextUserContent-
Tool-
ToolAssistantContent-
ToolCallToolCall is a call to a tool
ToolResultToolResult is a result of a tool call
ToolUserContent-
ToolableToolable is a mixin for agent classes that can be used as tools.

Type Aliases ​

Type aliasDescription
AgentAgent is the interface for all agents
AssistantContent-
Constructor-
ContentPart-
IDUsed to identify objects
LogID-
LoggerFunction-
ModelInvocationOptions-
ToolLike-
ToolSpec-
UserContent-

Variables ​

VariableDescription
availableModelsList of available models
pricingPricing and limits for each model

Functions ​

FunctionDescription
assertAsserts that a condition is true, otherwise throws an AssertionError.
countTokensCounts the number of tokens in a string
delayWaits for given number of milliseconds
getToolInterfaceGet the tool interface of a toolable.
isToolDecorator for agent classes that can be used as tools.
jsonSchema-
metaConstructs new Metadata and starts its timing.
otherwiseDecorator for defining the default reaction to unstructured messages.
parseDurationUse to parse time durations coming in from OpenAI in headers
parseMultipleObjects-
text-
toToolConvert a toolable to a tool.
uniqueIDGenerates a unique ID with a prefix
whenDecorator for defining reactions to structured messages.