MCPcopy Create free account
hub / github.com/ChatLab/ChatLab / extractChartPayloads

Function extractChartPayloads

src/stores/aiChatChartBlocks.ts:118–131  ·  view source on GitHub ↗
(toolResult: unknown)

Source from the content-addressed store, hash-verified

116}
117
118export function extractChartPayloads(toolResult: unknown): ChartPayload[] {
119 if (!isRecord(toolResult)) return []
120 const details = isRecord(toolResult.details) ? toolResult.details : toolResult
121 const charts: ChartPayload[] = []
122
123 if (isChartPayload(details.chart)) charts.push(details.chart)
124 if (Array.isArray(details.charts)) {
125 for (const chart of details.charts) {
126 if (isChartPayload(chart)) charts.push(chart)
127 }
128 }
129
130 return charts
131}
132
133export function toPersistedChartPayload(chart: ChartPayload): ChartPayload {
134 return {

Callers 4

sendMessageFunction · 0.90
editCurrentRoundOnlyFunction · 0.90

Calls 2

isRecordFunction · 0.70
isChartPayloadFunction · 0.70

Tested by

no test coverage detected