UNPKG

@mastra/core

Version:

The core foundation of the Mastra framework, providing essential components and interfaces for building AI-powered applications.

40 lines (36 loc) 1.26 kB
'use strict'; var chunkD63P5O4Q_cjs = require('./chunk-D63P5O4Q.cjs'); // src/vector/vector.ts var MastraVector = class extends chunkD63P5O4Q_cjs.MastraBase { constructor() { super({ name: "MastraVector", component: "VECTOR" }); } baseKeys = { query: ["queryVector", "topK", "filter", "includeVector"], upsert: ["vectors", "metadata", "ids"], createIndex: ["dimension", "metric"] }; normalizeArgs(method, [first, ...rest], extendedKeys = []) { if (typeof first === "object") { return first; } this.logger.warn( `Deprecation Warning: Passing individual arguments to ${method}() is deprecated. Please use an object parameter instead. Individual arguments will be removed on May 20th.` ); const baseKeys = this.baseKeys[method] || []; const paramKeys = [...baseKeys, ...extendedKeys].slice(0, rest.length); return { indexName: first, ...Object.fromEntries(paramKeys.map((key, i) => [key, rest[i]])) }; } async updateIndexById(_indexName, _id, _update) { throw new Error("updateIndexById is not implemented yet"); } async deleteIndexById(_indexName, _id) { throw new Error("deleteById is not implemented yet"); } }; exports.MastraVector = MastraVector;