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

Method constructor

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

runScriptMethod · 0.95
operationSignalMethod · 0.95
createPythonExecutorFunction · 0.90

Tested by

no test coverage detected