UNPKG

@pinecone-database/pinecone

Version:

This is the official Node.js SDK for [Pinecone](https://www.pinecone.io), written in TypeScript.

89 lines 3.67 kB
"use strict"; /* tslint:disable */ /* eslint-disable */ /** * Pinecone Control Plane API * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. * * The version of the OpenAPI document: 2025-04 * Contact: support@pinecone.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); exports.IndexModelToJSON = exports.IndexModelFromJSONTyped = exports.IndexModelFromJSON = exports.instanceOfIndexModel = exports.IndexModelMetricEnum = void 0; const runtime_1 = require("../runtime"); const DeletionProtection_1 = require("./DeletionProtection"); const IndexModelSpec_1 = require("./IndexModelSpec"); const IndexModelStatus_1 = require("./IndexModelStatus"); const ModelIndexEmbed_1 = require("./ModelIndexEmbed"); /** * @export */ exports.IndexModelMetricEnum = { Cosine: 'cosine', Euclidean: 'euclidean', Dotproduct: 'dotproduct' }; /** * Check if a given object implements the IndexModel interface. */ function instanceOfIndexModel(value) { let isInstance = true; isInstance = isInstance && "name" in value; isInstance = isInstance && "metric" in value; isInstance = isInstance && "host" in value; isInstance = isInstance && "spec" in value; isInstance = isInstance && "status" in value; isInstance = isInstance && "vectorType" in value; return isInstance; } exports.instanceOfIndexModel = instanceOfIndexModel; function IndexModelFromJSON(json) { return IndexModelFromJSONTyped(json, false); } exports.IndexModelFromJSON = IndexModelFromJSON; function IndexModelFromJSONTyped(json, ignoreDiscriminator) { if ((json === undefined) || (json === null)) { return json; } return { 'name': json['name'], 'dimension': !(0, runtime_1.exists)(json, 'dimension') ? undefined : json['dimension'], 'metric': json['metric'], 'host': json['host'], 'privateHost': !(0, runtime_1.exists)(json, 'private_host') ? undefined : json['private_host'], 'deletionProtection': !(0, runtime_1.exists)(json, 'deletion_protection') ? undefined : (0, DeletionProtection_1.DeletionProtectionFromJSON)(json['deletion_protection']), 'tags': !(0, runtime_1.exists)(json, 'tags') ? undefined : json['tags'], 'embed': !(0, runtime_1.exists)(json, 'embed') ? undefined : (0, ModelIndexEmbed_1.ModelIndexEmbedFromJSON)(json['embed']), 'spec': (0, IndexModelSpec_1.IndexModelSpecFromJSON)(json['spec']), 'status': (0, IndexModelStatus_1.IndexModelStatusFromJSON)(json['status']), 'vectorType': json['vector_type'], }; } exports.IndexModelFromJSONTyped = IndexModelFromJSONTyped; function IndexModelToJSON(value) { if (value === undefined) { return undefined; } if (value === null) { return null; } return { 'name': value.name, 'dimension': value.dimension, 'metric': value.metric, 'host': value.host, 'private_host': value.privateHost, 'deletion_protection': (0, DeletionProtection_1.DeletionProtectionToJSON)(value.deletionProtection), 'tags': value.tags, 'embed': (0, ModelIndexEmbed_1.ModelIndexEmbedToJSON)(value.embed), 'spec': (0, IndexModelSpec_1.IndexModelSpecToJSON)(value.spec), 'status': (0, IndexModelStatus_1.IndexModelStatusToJSON)(value.status), 'vector_type': value.vectorType, }; } exports.IndexModelToJSON = IndexModelToJSON; //# sourceMappingURL=IndexModel.js.map