接口的使用
com.agentsflex.core.model.chat.ChatInterceptor
使用ChatInterceptor的程序包
-
com.agentsflex.core.model.chat中ChatInterceptor的使用
类型参数类型为ChatInterceptor的com.agentsflex.core.model.chat中的字段修饰符和类型字段说明private static final List<ChatInterceptor>GlobalChatInterceptors.GLOBAL_INTERCEPTORS全局拦截器列表,使用 synchronized 保证线程安全private final List<ChatInterceptor>BaseChatModel.interceptors拦截器链,按执行顺序存储(可观测性 → 全局 → 用户)返回变量类型为ChatInterceptor的类型的com.agentsflex.core.model.chat中的方法修饰符和类型方法说明private List<ChatInterceptor>BaseChatModel.buildInterceptorChain(List<ChatInterceptor> userInterceptors) 构建完整的拦截器链。BaseChatModel.getInterceptors()static List<ChatInterceptor>GlobalChatInterceptors.getInterceptors()获取当前注册的全局拦截器列表的不可变视图。修饰符和类型方法说明voidBaseChatModel.addInterceptor(int index, ChatInterceptor interceptor) voidBaseChatModel.addInterceptor(ChatInterceptor interceptor) 动态添加拦截器。static voidGlobalChatInterceptors.addInterceptor(ChatInterceptor interceptor) 注册一个全局拦截器。类型变量类型为ChatInterceptor的com.agentsflex.core.model.chat中的方法参数修饰符和类型方法说明static voidGlobalChatInterceptors.addInterceptors(List<ChatInterceptor> interceptors) 批量注册多个全局拦截器。private List<ChatInterceptor>BaseChatModel.buildInterceptorChain(List<ChatInterceptor> userInterceptors) 构建完整的拦截器链。类型变量类型为ChatInterceptor的com.agentsflex.core.model.chat中的构造器参数限定符构造器说明BaseChatModel(T config, List<ChatInterceptor> userInterceptors) 构造一个聊天模型实例,并指定实例级拦截器。OpenAICompatibleChatModel(T config, List<ChatInterceptor> userInterceptors) 构造一个聊天模型实例,并指定实例级拦截器。