import { BaseToolOptions, Tool, JSONToolOutput, ToolEmitter, ToolInput, BaseToolRunOptions } from '../base.js'; import { AnyToolSchemaLike } from '../../internals/helpers/schema.js'; import { ClientConfig, ShowCollectionsResponse, DescribeCollectionResponse, SearchRes, MilvusClient } from '@zilliz/milvus2-sdk-node'; import { z } from 'zod'; import 'ajv'; import '../../context.js'; import '../../emitter-l0W9gC1A.js'; import '../../internals/types.js'; import '../../internals/helpers/guards.js'; import '../../internals/serializable.js'; import '../../internals/helpers/promise.js'; import '../../errors.js'; import 'promise-based-task'; import '../../cache/base.js'; import 'zod-to-json-schema'; /** * 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. */ interface MilvusToolOptions extends BaseToolOptions { connection: ClientConfig; } type MilvusSearchToolResult = ShowCollectionsResponse | DescribeCollectionResponse | SearchRes; declare enum MilvusAction { ListCollections = "ListCollections", GetCollectionInfo = "GetCollectionInfo", Search = "Search", Insert = "Insert", Delete = "Delete" } declare class MilvusDatabaseTool extends Tool, MilvusToolOptions> { name: string; description: string; inputSchema(): z.ZodObject<{ action: z.ZodNativeEnum; collectionName: z.ZodOptional; vector: z.ZodOptional>; vectors: z.ZodOptional, "many">>; topK: z.ZodOptional>; filter: z.ZodOptional; metadata: z.ZodOptional>; ids: z.ZodOptional, "many">>; searchOutput: z.ZodOptional>; }, "strip", z.ZodTypeAny, { action: MilvusAction; filter?: string | undefined; metadata?: Record | undefined; collectionName?: string | undefined; vector?: number[] | undefined; vectors?: number[][] | undefined; topK?: number | undefined; ids?: (string | number)[] | undefined; searchOutput?: string[] | undefined; }, { action: MilvusAction; filter?: string | undefined; metadata?: Record | undefined; collectionName?: string | undefined; vector?: number[] | undefined; vectors?: number[][] | undefined; topK?: number | undefined; ids?: (string | number)[] | undefined; searchOutput?: string[] | undefined; }>; readonly emitter: ToolEmitter, JSONToolOutput>; protected validateInput(schema: AnyToolSchemaLike, input: unknown): asserts input is ToolInput; protected client(): Promise; protected _run(input: ToolInput, _options: Partial): Promise>; protected listCollections(): Promise; protected getCollectionInfo(collectionName: string): Promise; protected insert(input: ToolInput): Promise; protected search(input: ToolInput): Promise; protected delete(input: ToolInput): Promise; } export { MilvusAction, MilvusDatabaseTool, type MilvusSearchToolResult, type MilvusToolOptions };