@threadplane/langgraph 0.0.51 → 0.0.52
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -351,8 +351,13 @@ interface AgentConfig<T = Record<string, unknown>, _Bag extends BagTemplate = Ba
|
|
|
351
351
|
* config is known up front. Pass a `() => AgentConfig` factory when the config
|
|
352
352
|
* depends on runtime/DI state — the factory runs inside an Angular injection
|
|
353
353
|
* context, so it may call `inject()` to read services, route params, or
|
|
354
|
-
* component-scoped signals
|
|
354
|
+
* component-scoped signals.
|
|
355
355
|
*
|
|
356
|
+
* **Typed state via AgentRef.** Pass a typed ref as the first argument to flow
|
|
357
|
+
* the state shape from `provideAgent` to `injectAgent` without repeating the
|
|
358
|
+
* generic at every call site.
|
|
359
|
+
*
|
|
360
|
+
* @example Factory config reading route params
|
|
356
361
|
* ```ts
|
|
357
362
|
* providers: [
|
|
358
363
|
* provideAgent(() => {
|
|
@@ -361,11 +366,7 @@ interface AgentConfig<T = Record<string, unknown>, _Bag extends BagTemplate = Ba
|
|
|
361
366
|
* }),
|
|
362
367
|
* ];
|
|
363
368
|
* ```
|
|
364
|
-
*
|
|
365
|
-
* **Typed state via AgentRef.** Pass a typed ref as the first argument to flow
|
|
366
|
-
* the state shape from `provideAgent` to `injectAgent` without repeating the
|
|
367
|
-
* generic at every call site:
|
|
368
|
-
*
|
|
369
|
+
* @example Typed state via AgentRef
|
|
369
370
|
* ```ts
|
|
370
371
|
* export const TRIP = createAgentRef<TripState>('trip');
|
|
371
372
|
* // app.config.ts:
|
|
@@ -388,13 +389,13 @@ declare function provideAgent<T = Record<string, unknown>>(configOrFactory: Agen
|
|
|
388
389
|
*
|
|
389
390
|
* **Typed state via AgentRef.** Pass the same ref that was supplied to
|
|
390
391
|
* `provideAgent(ref, …)` to carry the state type through DI without repeating
|
|
391
|
-
* the generic at every call site
|
|
392
|
+
* the generic at every call site. The no-arg form defaults to
|
|
393
|
+
* `LangGraphAgent<Record<string, unknown>>`.
|
|
392
394
|
*
|
|
395
|
+
* @example Typed state via AgentRef
|
|
393
396
|
* ```ts
|
|
394
397
|
* const agent = injectAgent(TRIP); // LangGraphAgent<TripState>
|
|
395
398
|
* ```
|
|
396
|
-
*
|
|
397
|
-
* The no-arg form defaults to `LangGraphAgent<Record<string, unknown>>`.
|
|
398
399
|
*/
|
|
399
400
|
declare function injectAgent(): LangGraphAgent<Record<string, unknown>>;
|
|
400
401
|
declare function injectAgent<T, ResolvedBag extends BagTemplate = BagTemplate>(ref: AgentRef<T>): LangGraphAgent<T, ResolvedBag>;
|
|
@@ -598,6 +599,19 @@ declare class FakeStreamTransport implements AgentTransport {
|
|
|
598
599
|
interface KwargsLike {
|
|
599
600
|
additional_kwargs?: Record<string, unknown> | undefined;
|
|
600
601
|
}
|
|
602
|
+
/**
|
|
603
|
+
* Normalize {@link Citation}s out of a message's `additional_kwargs` (reading
|
|
604
|
+
* `citations` or `sources`). Exposed for advanced consumers building custom
|
|
605
|
+
* adapters or bridging non-LangGraph message shapes into the neutral
|
|
606
|
+
* `Citation[]` form.
|
|
607
|
+
*
|
|
608
|
+
* @param msg Any object with an `additional_kwargs` bag (e.g. a LangChain message).
|
|
609
|
+
* @returns The normalized citations, or `undefined` when none are present.
|
|
610
|
+
* @example
|
|
611
|
+
* ```ts
|
|
612
|
+
* const citations = extractCitations(lcMessage);
|
|
613
|
+
* ```
|
|
614
|
+
*/
|
|
601
615
|
declare function extractCitations(msg: KwargsLike): Citation[] | undefined;
|
|
602
616
|
|
|
603
617
|
/**
|