Skip to main content

Crate synaptic_middleware

Crate synaptic_middleware 

Source

Structs§

BaseChatModelCaller
Wraps a ChatModel into a ModelCaller.
ContextEditingMiddleware
Manages conversation context by trimming or filtering messages before each model invocation.
HumanInTheLoopMiddleware
Pauses tool execution to request human approval.
MiddlewareChain
A chain of middlewares that executes them in order.
ModelCallLimitMiddleware
Limits the number of model invocations during a single agent run.
ModelFallbackMiddleware
Falls back to alternative models when the primary model fails.
ModelRequest
A model invocation request visible to middleware.
ModelResponse
A model invocation response visible to middleware.
SummarizationMiddleware
Automatically summarizes conversation history when it exceeds a token limit.
TodoListMiddleware
Adds task-planning capability to an agent by injecting a todo list into the system prompt.
ToolCallLimitMiddleware
Limits the number of tool invocations during a single agent run.
ToolCallRequest
A single tool call request visible to middleware.
ToolRetryMiddleware
Retries failed tool calls with configurable attempts and backoff.

Enums§

ContextStrategy
Strategy for editing context before model calls.

Traits§

AgentMiddleware
Middleware that can intercept and modify agent lifecycle events.
ApprovalCallback
A callback that decides whether a tool call should proceed.
ModelCaller
Trait representing the next step in the model call chain.
ToolCaller
Trait representing the next step in the tool call chain.