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

Method constructor

src/interpreter/python/engine.ts:39–55  ·  view source on GitHub ↗
(llmConfig: LLMConfig, engineOptions: PythonEngineOptions = {})

Source from the content-addressed store, hash-verified

37 private readonly executor: ReturnType<typeof createPythonExecutor>;
38
39 constructor(llmConfig: LLMConfig, engineOptions: PythonEngineOptions = {}) {
40 if (engineOptions.execute !== undefined && typeof engineOptions.execute !== 'function') {
41 throw new Error('Python execute must be a function');
42 }
43 this.timeoutMs = z
44 .number()
45 .int()
46 .positive()
47 .max(2_147_483_647)
48 .parse(engineOptions.queryTimeoutMs ?? DEFAULT_QUERY_TIMEOUT_MS);
49 this.executor = engineOptions.execute ?? createPythonExecutor(this.timeoutMs);
50 this.dialect = new PythonDialect(llmConfig, (script) =>
51 runWithTimeout(this.executor(script, 64 * 1024), this.timeoutMs, {
52 onTimeout: () => new Error(`Python validation timed out after ${this.timeoutMs}ms`),
53 })
54 );
55 }
56
57 async load(configs: DataSourceConfig | DataSourceConfig[]): Promise<void> {
58 const sources = Array.isArray(configs) ? configs : [configs];

Callers

nothing calls this directly

Calls 2

createPythonExecutorFunction · 0.90
runWithTimeoutFunction · 0.90

Tested by

no test coverage detected