/** * LangChain.js callback handler that fires AgentGuard spend checks before * every LLM call. * * Install: `npm install @agentguard-run/spend @langchain/core` * * @example * import { ChatOpenAI } from '@langchain/openai'; * import { AgentGuardSpendCallbackHandler } from '@agentguard-run/spend/dist/integrations/langchain-callback'; * * const handler = new AgentGuardSpendCallbackHandler({ * dailyCapDollars: 20, * agentId: 'my-langchain-agent', * }); * const llm = new ChatOpenAI({ callbacks: [handler] }); * await llm.invoke('hello'); // throws AgentGuardBlockedError if cap exceeded */ export interface AgentGuardSpendCallbackHandlerOptions { dailyCapDollars: number; agentId?: string; tenantId?: string; softCapDollars?: number; downgradeTo?: string; perMinuteCapDollars?: number; } /** * LangChain.js BaseCallbackHandler-compatible class. We declare it without * extending the real BaseCallbackHandler (which would require a peer-dep * import at module load), and let LangChain duck-type it via the standard * callback method names. */ export declare class AgentGuardSpendCallbackHandler { name: string; private policy; private scope; private spendStore; constructor(opts: AgentGuardSpendCallbackHandlerOptions); handleChatModelStart(llm: any, messages: any[][], _runId: string, _parentRunId: string | undefined, extraParams?: Record): Promise; handleLLMStart(_llm: any, prompts: string[], _runId: string, _parentRunId: string | undefined, extraParams?: Record): Promise; private preflight; } //# sourceMappingURL=langchain-callback.d.ts.map