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

Method load

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

Source from the content-addressed store, hash-verified

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