UNPKG

@pinecone-database/pinecone

Version:

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

56 lines 1.99 kB
"use strict"; /* tslint:disable */ /* eslint-disable */ /** * Pinecone Data 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.SearchUsageToJSON = exports.SearchUsageFromJSONTyped = exports.SearchUsageFromJSON = exports.instanceOfSearchUsage = void 0; const runtime_1 = require("../runtime"); /** * Check if a given object implements the SearchUsage interface. */ function instanceOfSearchUsage(value) { let isInstance = true; isInstance = isInstance && "readUnits" in value; return isInstance; } exports.instanceOfSearchUsage = instanceOfSearchUsage; function SearchUsageFromJSON(json) { return SearchUsageFromJSONTyped(json, false); } exports.SearchUsageFromJSON = SearchUsageFromJSON; function SearchUsageFromJSONTyped(json, ignoreDiscriminator) { if ((json === undefined) || (json === null)) { return json; } return { 'readUnits': json['read_units'], 'embedTotalTokens': !(0, runtime_1.exists)(json, 'embed_total_tokens') ? undefined : json['embed_total_tokens'], 'rerankUnits': !(0, runtime_1.exists)(json, 'rerank_units') ? undefined : json['rerank_units'], }; } exports.SearchUsageFromJSONTyped = SearchUsageFromJSONTyped; function SearchUsageToJSON(value) { if (value === undefined) { return undefined; } if (value === null) { return null; } return { 'read_units': value.readUnits, 'embed_total_tokens': value.embedTotalTokens, 'rerank_units': value.rerankUnits, }; } exports.SearchUsageToJSON = SearchUsageToJSON; //# sourceMappingURL=SearchUsage.js.map