citationsWithToolSources

Unpublished development API. This package is under development and is not available as a published release.

A message's citations plus the sources its tool activities declare, for an application that renders its own Sources panel. Pass the result to Citations and set sources="panel" on the activity so the sources are not repeated as links. A source the message already cites is not added again; snapshot also counts the answer's Markdown source definitions. Returns citations itself when nothing is added.

import { citationsWithToolSources } from '@threadplane/react/chat';

Declaration · overload 1

export declare function citationsWithToolSources(citations: readonly Citation[], activities: readonly ToolActivityInfo[], snapshot?: MarkdownSnapshot): readonly Citation[];

Parameters

citations · required
readonly Citation[]
activities · required
readonly ToolActivityInfo[]
snapshot · optional
MarkdownSnapshot

Returns

readonly Citation[]