extractCitations

Normalize Citations out of a message's additional_kwargs (reading citations or sources). Exposed for advanced consumers building custom adapters or bridging non-LangGraph message shapes into the neutral Citation[] form.

import { extractCitations } from '@threadplane/langgraph';

Declaration · overload 1

export declare function extractCitations(msg: KwargsLike): Citation[] | undefined;

Parameters

msg · required
KwargsLike

Any object with an additional_kwargs bag (e.g. a LangChain message).

Returns

Citation[] | undefined

The normalized citations, or undefined when none are present.

Examples

const citations = extractCitations(lcMessage);