Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@singlestore/elegance-sdk

Package Overview
Dependencies
Maintainers
3
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@singlestore/elegance-sdk - npm Package Compare versions

Comparing version 0.0.13 to 0.0.14

1

dist/index.d.ts

@@ -133,2 +133,3 @@ import * as react from 'react';

query: string;
queryEmbedding?: Embedding;
embeddingField: string;

@@ -135,0 +136,0 @@ limit?: number;

2

package.json
{
"name": "@singlestore/elegance-sdk",
"version": "0.0.13",
"version": "0.0.14",
"license": "Apache-2.0",

@@ -5,0 +5,0 @@ "main": "./dist/index.js",

@@ -167,2 +167,3 @@ import { ClientOptions } from 'openai';

query: string;
queryEmbedding?: Embedding;
embeddingField: string;

@@ -169,0 +170,0 @@ limit?: number;

@@ -408,6 +408,15 @@ 'use strict';

let result = void 0;
const { db, collection, embeddingField, query, minSimilarity = 0, limit, includeEmbedding = false } = body;
const queryEmbedding = (yield ai.createEmbedding(query))[0];
const {
db,
collection,
embeddingField,
query,
queryEmbedding,
minSimilarity = 0,
limit,
includeEmbedding = false
} = body;
const _queryEmbedding = queryEmbedding != null ? queryEmbedding : (yield ai.createEmbedding(query))[0];
if (connection.type === "kai") {
const queryBuffer = ai.embeddingToBuffer(queryEmbedding);
const queryBuffer = ai.embeddingToBuffer(_queryEmbedding);
const query2 = [

@@ -430,3 +439,3 @@ { $addFields: { similarity: { $dotProduct: [`$${embeddingField}`, queryBuffer] } } }

let query2 = `
SELECT *, DOT_PRODUCT(${embeddingField}, JSON_ARRAY_PACK('[${queryEmbedding}]')) AS similarity
SELECT *, DOT_PRODUCT(${embeddingField}, JSON_ARRAY_PACK('[${_queryEmbedding}]')) AS similarity
FROM ${tablePath}

@@ -433,0 +442,0 @@ WHERE similarity > ${minSimilarity}

@@ -169,2 +169,3 @@ import { ClientOptions } from 'openai';

query: string;
queryEmbedding?: Embedding;
embeddingField: string;

@@ -171,0 +172,0 @@ limit?: number;

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc