@@ -6,6 +6,7 @@ import type {
66 PregelOptions ,
77} from "@langchain/langgraph" ;
88import type { BaseMessage } from "@langchain/core/messages" ;
9+ import type { BaseCallbackConfig } from "@langchain/core/callbacks/manager" ;
910
1011import type { ResponseFormatUndefined } from "./responses.js" ;
1112
@@ -152,17 +153,24 @@ export type InvokeConfiguration<ContextSchema extends Record<string, any>> =
152153 * If the context schema is a default object, `context` can be optional
153154 */
154155 ContextSchema extends InteropZodDefault < any >
155- ? Partial < Pick < PregelOptions < any , any , any > , CreateAgentPregelOptions > > & {
156- context ?: Partial < ContextSchema > ;
157- }
156+ ? BaseCallbackConfig &
157+ Partial <
158+ Pick < PregelOptions < any , any , any > , CreateAgentPregelOptions >
159+ > & {
160+ context ?: Partial < ContextSchema > ;
161+ }
158162 : /**
159163 * If the context schema is all optional, `context` can be optional
160164 */
161165 IsAllOptional < ContextSchema > extends true
162- ? Partial < Pick < PregelOptions < any , any , any > , CreateAgentPregelOptions > > & {
163- context ?: Partial < ContextSchema > ;
164- }
165- : Partial < Pick < PregelOptions < any , any , any > , CreateAgentPregelOptions > > &
166+ ? BaseCallbackConfig &
167+ Partial <
168+ Pick < PregelOptions < any , any , any > , CreateAgentPregelOptions >
169+ > & {
170+ context ?: Partial < ContextSchema > ;
171+ }
172+ : BaseCallbackConfig &
173+ Partial < Pick < PregelOptions < any , any , any > , CreateAgentPregelOptions > > &
166174 WithMaybeContext < ContextSchema > ;
167175
168176export type StreamConfiguration < ContextSchema extends Record < string , any > > =
0 commit comments