UNPKG

@langchain/langgraph

Version:

LangGraph

1 lines 4.6 kB
{"version":3,"file":"runnable_types.d.cts","names":["RunnableConfig","RunnableInterface","BaseStore","RunnableFunc","RunInput","CallOptions","RunOutput","Promise","RunnableMapLike","K","RunnableLike","IsEqual","T","U","Runtime","Record","ContextType","WriterType","InterruptType","AbortSignal","LangGraphRunnableConfig","Partial"],"sources":["../../src/pregel/runnable_types.d.ts"],"sourcesContent":["import { RunnableConfig, RunnableInterface } from \"@langchain/core/runnables\";\nimport { BaseStore } from \"@langchain/langgraph-checkpoint\";\ntype RunnableFunc<RunInput, RunOutput, CallOptions extends RunnableConfig = RunnableConfig> = (input: RunInput, \n// eslint-disable-next-line @typescript-eslint/no-explicit-any\noptions: CallOptions) => RunOutput | Promise<RunOutput>;\ntype RunnableMapLike<RunInput, RunOutput> = {\n [K in keyof RunOutput]: RunnableLike<RunInput, RunOutput[K]>;\n};\nexport type RunnableLike<RunInput, RunOutput, CallOptions extends RunnableConfig = RunnableConfig> = RunnableInterface<RunInput, RunOutput, CallOptions> | RunnableFunc<RunInput, RunOutput, CallOptions> | RunnableMapLike<RunInput, RunOutput>;\ntype IsEqual<T, U> = [T] extends [U] ? ([U] extends [T] ? true : false) : false;\nexport interface Runtime<ContextType = Record<string, unknown>, InterruptType = unknown, WriterType = unknown> {\n configurable?: ContextType;\n /** User provided context */\n context?: ContextType;\n /** Persistent key-value store */\n store?: BaseStore;\n /** Callback to send custom data chunks via the `custom` stream mode */\n writer: IsEqual<WriterType, unknown> extends true ? (chunk: unknown) => void : WriterType;\n /**\n * Interrupts the execution of a graph node.\n *\n * This function can be used to pause execution of a node, and return the value of the `resume`\n * input when the graph is re-invoked using `Command`.\n * Multiple interrupts can be called within a single node, and each will be handled sequentially.\n *\n * When an interrupt is called:\n * 1. If there's a `resume` value available (from a previous `Command`), it returns that value.\n * 2. Otherwise, it throws a `GraphInterrupt` with the provided value\n * 3. The graph can be resumed by passing a `Command` with a `resume` value\n *\n * Because the `interrupt` function propagates by throwing a special `GraphInterrupt` error,\n * you should avoid using `try/catch` blocks around the `interrupt` function,\n * or if you do, ensure that the `GraphInterrupt` error is thrown again within your `catch` block.\n *\n * @param value - The value to include in the interrupt.\n * @returns The `resume` value provided when the graph is re-invoked with a Command.\n */\n interrupt: IsEqual<InterruptType, unknown> extends true ? (value: unknown) => unknown : InterruptType;\n /** Abort signal to cancel the run. */\n signal: AbortSignal;\n}\nexport interface LangGraphRunnableConfig<\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nContextType extends Record<string, any> = Record<string, any>\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\n> extends RunnableConfig<ContextType>, Partial<Runtime<ContextType, unknown, unknown>> {\n}\nexport {};\n"],"mappings":";;;;KAEKG,wDAAsDH,iBAAiBA,0BAA0BI;;AAD1C,OACvDD,EAEIE,WAFJF,EAAY,GAEQG,SAFR,GAEoBC,OAFpB,CAE4BD,SAF5B,CAAA;KAGZE,eAHY,CAAA,QAAA,EAAA,SAAA,CAAA,GAAA,QAA0CR,MAI3CM,SAJ2CN,GAI/BU,cAJ+BV,CAIlBI,QAJkBJ,EAIRM,SAJQN,CAIES,CAJFT,CAAAA,CAAAA;AAA2CI,KAM1FM,cAN0FN,CAAAA,QAAAA,EAAAA,SAAAA,EAAAA,oBAMpCJ,cANoCI,GAMnBJ,cANmBI,CAAAA,GAMDH,iBANCG,CAMiBA,QANjBA,EAM2BE,SAN3BF,EAMsCC,WANtCD,CAAAA,GAMqDD,cANrDC,CAMkEA,QANlEA,EAM4EE,SAN5EF,EAMuFC,WANvFD,CAAAA,GAMsGI,eANtGJ,CAMsHA,QANtHA,EAMgIE,SANhIF,CAAAA;KAOjGO,OALIN,CAAAA,CAAAA,EAAAA,CAAAA,CAAAA,GAAAA,CAKaO,CALbP,CAAAA,SAAAA,CAKyBQ,CALzBR,CAAAA,GAAAA,CAAAA,CAKgCQ,CALhCR,CAAAA,SAAAA,CAK4CO,CAL5CP,CAAAA,GAAAA,IAAAA,GAAA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