import { BaseToolOptions, BaseToolRunOptions, Tool, StringToolOutput, ToolEmitter, ToolInput } from './base.js'; import { FrameworkError } from '../errors.js'; import { z } from 'zod'; import { CodeInterpreterOptions } from './python/python.js'; import { RunContext } from '../context.js'; import 'ajv'; import '../internals/serializable.js'; import '../internals/types.js'; import '../internals/helpers/guards.js'; import 'promise-based-task'; import '../cache/base.js'; import '../internals/helpers/schema.js'; import 'zod-to-json-schema'; import '../emitter-l0W9gC1A.js'; import '../internals/helpers/promise.js'; import '../llms/base.js'; import '../llms/llm.js'; import '../template.js'; import './python/storage.js'; import 'fs'; import './python/output.js'; import 'node:tls'; /** * Copyright 2025 IBM Corp. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ declare class CustomToolCreateError extends FrameworkError { } declare class CustomToolExecuteError extends FrameworkError { } declare const toolOptionsSchema: z.ZodObject<{ codeInterpreter: z.ZodObject<{ url: z.ZodString; connectionOptions: z.ZodOptional; }, "strip", z.ZodTypeAny, { url: string; connectionOptions?: any; }, { url: string; connectionOptions?: any; }>; sourceCode: z.ZodString; name: z.ZodString; description: z.ZodString; inputSchema: z.ZodAny; }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ codeInterpreter: z.ZodObject<{ url: z.ZodString; connectionOptions: z.ZodOptional; }, "strip", z.ZodTypeAny, { url: string; connectionOptions?: any; }, { url: string; connectionOptions?: any; }>; sourceCode: z.ZodString; name: z.ZodString; description: z.ZodString; inputSchema: z.ZodAny; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ codeInterpreter: z.ZodObject<{ url: z.ZodString; connectionOptions: z.ZodOptional; }, "strip", z.ZodTypeAny, { url: string; connectionOptions?: any; }, { url: string; connectionOptions?: any; }>; sourceCode: z.ZodString; name: z.ZodString; description: z.ZodString; inputSchema: z.ZodAny; }, z.ZodTypeAny, "passthrough">>; type CustomToolEnv = Record; type CustomToolOptions = z.output & BaseToolOptions & { env?: CustomToolEnv; }; type CustomToolRunOptions = Pick & BaseToolRunOptions; declare class CustomTool extends Tool { name: string; description: string; readonly emitter: ToolEmitter, StringToolOutput>; inputSchema(): any; constructor(options: CustomToolOptions); protected _run(input: any, options: Partial, run: RunContext): Promise; loadSnapshot(snapshot: ReturnType): void; static fromSourceCode({ env, ...codeInterpreter }: CodeInterpreterOptions & Pick, sourceCode: string): Promise; } export { CustomTool, CustomToolCreateError, CustomToolExecuteError, type CustomToolOptions, type CustomToolRunOptions };