API

instrukt.agent: Agents

Base instrukt agents API

Classes

agent.base.InstruktAgent

Instrukt agents need to satisfy this base class.

agent.manager.AgentManager(ctx)

AgentManager handles loading and switching between agents.

agent.state.StateObserver(*args, **kwargs)

agent.state.AgentStateSubject()

agent.state.AgentStateMachine()

Agent state machine.

agent.loading.ModuleManager()

agent.events.AgentEvents(value)

An enumeration.

agent.callback.InstruktCallbackHandler

Create a new model by parsing and validating input data from keyword arguments.

instrukt.indexes: Indexes

schema.Index

Base Instrukt Index class.

schema.Collection(id, name, metadata)

An index collection

schema.EmbeddingDetails(embedding_fn_cls[, ...])

Details about an embedding

chroma.ChromaWrapper(client, collection_name)

Wrapper around Chroma DB.

manager.IndexManager

Helper to access chroma indexes.

loaders.AutoDirLoader(path[, glob, exclude, ...])

AutoDirLoader is a mix of Langchain's DirectoryLoader and GenericLoader.

instrukt.commands: REPL Commands

Instrukt commands.

Commands are created with the Command class and registered using a Route.

RootCmd is the root of all command routes.

# Defining new commands:

To define new commands use the @RootCmd.command decorator. If you add a command on a separate module, make sure to only export the decorated functions with __all__

command.Command(name, callback, ...)

A command class representing a command that can be executed in the REPL.

command.CmdGroup(name, description[, parent])

A class representing a group of commands.

command.CmdLog(msg)

Arbitrary log from a command execution.