(llmConfig: LLMConfig, engineOptions: PythonEngineOptions = {})
| 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]; |
nothing calls this directly
no test coverage detected