gaunt-sloth-assistant
Version:
[](https://github.com/Galvanized-Pukeko/gaunt-sloth-assistant/actions/workflows/unit-tests.yml) [ • 1.71 kB
TypeScript
/**
* @packageDocumentation
* Middleware registry for Gaunt Sloth Assistant.
*
* This module provides factory functions for creating predefined middleware instances
* and a resolver to convert middleware configurations into middleware objects.
*/
import type { GthConfig } from '#src/config.js';
import type { AnthropicPromptCachingConfig, MiddlewareConfig, SummarizationConfig } from '#src/middleware/types.js';
import { type AgentMiddleware } from 'langchain';
/**
* Create Anthropic prompt caching middleware.
* This middleware adds cache control headers to reduce API costs.
*
* @param config - Configuration for the middleware
* @param gthConfig - Full Gaunt Sloth configuration
* @returns Middleware object
*/
export declare function createAnthropicPromptCachingMiddleware(config: AnthropicPromptCachingConfig, _: GthConfig): Promise<AgentMiddleware>;
/**
* Create summarization middleware.
* This middleware automatically condenses conversation history when approaching token limits.
*
* @param config - Configuration for the middleware
* @param gthConfig - Full Gaunt Sloth configuration
* @returns Middleware object
*/
export declare function createSummarizationMiddleware(config: SummarizationConfig, gthConfig: GthConfig): Promise<AgentMiddleware>;
/**
* Resolve middleware configuration into middleware instances.
* Converts string identifiers and config objects into actual middleware.
*
* @param configs - Array of middleware configurations
* @param gthConfig - Full Gaunt Sloth configuration
* @returns Array of middleware instances
*/
export declare function resolveMiddleware(configs: MiddlewareConfig[] | undefined, gthConfig: GthConfig): Promise<AgentMiddleware[]>;