MCPcopy Create free account
hub / github.com/antvis/AVA / load

Method load

src/interpreter/javascript/engine.ts:41–53  ·  view source on GitHub ↗
(configs: DataSourceConfig | DataSourceConfig[])

Source from the content-addressed store, hash-verified

39 }
40
41 async load(configs: DataSourceConfig | DataSourceConfig[]): Promise<void> {
42 const sources = Array.isArray(configs) ? configs : [configs];
43 if (sources.length !== 1) {
44 throw new Error(`JavaScriptEngine currently supports exactly one data source, received ${sources.length}`);
45 }
46 this.data = null;
47 const config = sourceInputSchema.parse(sources[0]);
48 if (config.type !== 'csv' && config.type !== 'json' && config.type !== 'text') {
49 throw new Error(`JavaScriptEngine only supports csv/json/text sources, got: ${config.type}`);
50 }
51
52 this.data = await loadSource(config, this.llmConfig);
53 }
54
55 async schema(): Promise<Schema> {
56 if (!this.data) throw new Error('No data loaded. Please call source() first.');

Callers

nothing calls this directly

Calls 1

loadSourceFunction · 0.90

Tested by

no test coverage detected