import type { ManagedReActAgentInterceptor } from '../managed-interceptor'; /** * 环境信息配置项 */ export type EnvironmentItem = { /** 环境信息内容(字符串或返回字符串的函数,函数形式支持延迟求值) */ content: string | (() => string); /** * 注入位置 * - 'system': 注入到 system 消息(静态信息,享受 prefix caching) * - 'user': 通过 system-reminder 注入到 user 消息(动态信息) */ position: 'system' | 'user'; /** 优先级(仅 user 模式有效,数值越小越靠前,默认 50) */ priority?: number; }; export type EnvironmentInjectInterceptorOptions = { /** * 环境信息配置。 * - EnvironmentItem:单项配置 * - Array:多项配置 */ environment: EnvironmentItem | Array; }; /** * 环境信息注入拦截器 * * 采用分层注入策略: * - system 模式:静态环境信息直接追加到 system 消息(享受 prefix caching) * - user 模式:动态环境信息通过 addSystemReminder 注册,由 SystemReminderInterceptor 统一注入 * * 环境信息只存在于发给模型的上下文中,不会被持久化到 MessageStore。 */ export declare const createEnvironmentInjectInterceptor: ({ environment, }: EnvironmentInjectInterceptorOptions) => ManagedReActAgentInterceptor;