diff --git a/packages/components/nodes/chatmodels/ChatAnthropic/ChatAnthropic.ts b/packages/components/nodes/chatmodels/ChatAnthropic/ChatAnthropic.ts index b65c7bd89a0..63343450520 100644 --- a/packages/components/nodes/chatmodels/ChatAnthropic/ChatAnthropic.ts +++ b/packages/components/nodes/chatmodels/ChatAnthropic/ChatAnthropic.ts @@ -137,8 +137,8 @@ class ChatAnthropic_ChatModels implements INode { } if (maxTokensToSample) obj.maxTokensToSample = parseInt(maxTokensToSample, 10) - if (topP) obj.topP = parseInt(topP, 10) - if (topK) obj.topK = parseInt(topK, 10) + if (topP) obj.topP = parseFloat(topP) + if (topK) obj.topK = parseFloat(topK) const model = new ChatAnthropic(obj) return model diff --git a/packages/components/nodes/chatmodels/ChatHuggingFace/ChatHuggingFace.ts b/packages/components/nodes/chatmodels/ChatHuggingFace/ChatHuggingFace.ts index d92dd1e0470..943af587992 100644 --- a/packages/components/nodes/chatmodels/ChatHuggingFace/ChatHuggingFace.ts +++ b/packages/components/nodes/chatmodels/ChatHuggingFace/ChatHuggingFace.ts @@ -101,8 +101,8 @@ class ChatHuggingFace_ChatModels implements INode { if (temperature) obj.temperature = parseFloat(temperature) if (maxTokens) obj.maxTokens = parseInt(maxTokens, 10) - if (topP) obj.topP = parseInt(topP, 10) - if (hfTopK) obj.topK = parseInt(hfTopK, 10) + if (topP) obj.topP = parseFloat(topP) + if (hfTopK) obj.topK = parseFloat(hfTopK) if (frequencyPenalty) obj.frequencyPenalty = parseInt(frequencyPenalty, 10) if (endpoint) obj.endpoint = endpoint diff --git a/packages/components/nodes/chatmodels/ChatLocalAI/ChatLocalAI.ts b/packages/components/nodes/chatmodels/ChatLocalAI/ChatLocalAI.ts index c5860b2420c..ffe2e7692cb 100644 --- a/packages/components/nodes/chatmodels/ChatLocalAI/ChatLocalAI.ts +++ b/packages/components/nodes/chatmodels/ChatLocalAI/ChatLocalAI.ts @@ -80,7 +80,7 @@ class ChatLocalAI_ChatModels implements INode { } if (maxTokens) obj.maxTokens = parseInt(maxTokens, 10) - if (topP) obj.topP = parseInt(topP, 10) + if (topP) obj.topP = parseFloat(topP) if (timeout) obj.timeout = parseInt(timeout, 10) const model = new OpenAIChat(obj, { basePath }) diff --git a/packages/components/nodes/chatmodels/ChatOpenAI/ChatOpenAI.ts b/packages/components/nodes/chatmodels/ChatOpenAI/ChatOpenAI.ts index 955563ffeb4..bd9080c9475 100644 --- a/packages/components/nodes/chatmodels/ChatOpenAI/ChatOpenAI.ts +++ b/packages/components/nodes/chatmodels/ChatOpenAI/ChatOpenAI.ts @@ -139,7 +139,7 @@ class ChatOpenAI_ChatModels implements INode { } if (maxTokens) obj.maxTokens = parseInt(maxTokens, 10) - if (topP) obj.topP = parseInt(topP, 10) + if (topP) obj.topP = parseFloat(topP) if (frequencyPenalty) obj.frequencyPenalty = parseInt(frequencyPenalty, 10) if (presencePenalty) obj.presencePenalty = parseInt(presencePenalty, 10) if (timeout) obj.timeout = parseInt(timeout, 10) diff --git a/packages/components/nodes/llms/Azure OpenAI/AzureOpenAI.ts b/packages/components/nodes/llms/Azure OpenAI/AzureOpenAI.ts index 130eed339e0..263dbe332ab 100644 --- a/packages/components/nodes/llms/Azure OpenAI/AzureOpenAI.ts +++ b/packages/components/nodes/llms/Azure OpenAI/AzureOpenAI.ts @@ -181,7 +181,7 @@ class AzureOpenAI_LLMs implements INode { } if (maxTokens) obj.maxTokens = parseInt(maxTokens, 10) - if (topP) obj.topP = parseInt(topP, 10) + if (topP) obj.topP = parseFloat(topP) if (frequencyPenalty) obj.frequencyPenalty = parseInt(frequencyPenalty, 10) if (presencePenalty) obj.presencePenalty = parseInt(presencePenalty, 10) if (timeout) obj.timeout = parseInt(timeout, 10) diff --git a/packages/components/nodes/llms/HuggingFaceInference/HuggingFaceInference.ts b/packages/components/nodes/llms/HuggingFaceInference/HuggingFaceInference.ts index 92eb46d50a8..33eedf2f595 100644 --- a/packages/components/nodes/llms/HuggingFaceInference/HuggingFaceInference.ts +++ b/packages/components/nodes/llms/HuggingFaceInference/HuggingFaceInference.ts @@ -101,8 +101,8 @@ class HuggingFaceInference_LLMs implements INode { if (temperature) obj.temperature = parseFloat(temperature) if (maxTokens) obj.maxTokens = parseInt(maxTokens, 10) - if (topP) obj.topP = parseInt(topP, 10) - if (hfTopK) obj.topK = parseInt(hfTopK, 10) + if (topP) obj.topP = parseFloat(topP) + if (hfTopK) obj.topK = parseFloat(hfTopK) if (frequencyPenalty) obj.frequencyPenalty = parseInt(frequencyPenalty, 10) if (endpoint) obj.endpoint = endpoint diff --git a/packages/components/nodes/llms/OpenAI/OpenAI.ts b/packages/components/nodes/llms/OpenAI/OpenAI.ts index b0af867d6c0..1bf7486e81f 100644 --- a/packages/components/nodes/llms/OpenAI/OpenAI.ts +++ b/packages/components/nodes/llms/OpenAI/OpenAI.ts @@ -139,7 +139,7 @@ class OpenAI_LLMs implements INode { } if (maxTokens) obj.maxTokens = parseInt(maxTokens, 10) - if (topP) obj.topP = parseInt(topP, 10) + if (topP) obj.topP = parseFloat(topP) if (frequencyPenalty) obj.frequencyPenalty = parseInt(frequencyPenalty, 10) if (presencePenalty) obj.presencePenalty = parseInt(presencePenalty, 10) if (timeout) obj.timeout = parseInt(timeout, 10) diff --git a/packages/components/nodes/vectorstores/Chroma_Existing/Chroma_Existing.ts b/packages/components/nodes/vectorstores/Chroma_Existing/Chroma_Existing.ts index 3ce93e87279..e5dfe03e1b1 100644 --- a/packages/components/nodes/vectorstores/Chroma_Existing/Chroma_Existing.ts +++ b/packages/components/nodes/vectorstores/Chroma_Existing/Chroma_Existing.ts @@ -69,7 +69,7 @@ class Chroma_Existing_VectorStores implements INode { const chromaURL = nodeData.inputs?.chromaURL as string const output = nodeData.outputs?.output as string const topK = nodeData.inputs?.topK as string - const k = topK ? parseInt(topK, 10) : 4 + const k = topK ? parseFloat(topK) : 4 const obj: { collectionName: string diff --git a/packages/components/nodes/vectorstores/Chroma_Upsert/Chroma_Upsert.ts b/packages/components/nodes/vectorstores/Chroma_Upsert/Chroma_Upsert.ts index f32fbb6712e..26f3c222833 100644 --- a/packages/components/nodes/vectorstores/Chroma_Upsert/Chroma_Upsert.ts +++ b/packages/components/nodes/vectorstores/Chroma_Upsert/Chroma_Upsert.ts @@ -78,7 +78,7 @@ class ChromaUpsert_VectorStores implements INode { const chromaURL = nodeData.inputs?.chromaURL as string const output = nodeData.outputs?.output as string const topK = nodeData.inputs?.topK as string - const k = topK ? parseInt(topK, 10) : 4 + const k = topK ? parseFloat(topK) : 4 const flattenDocs = docs && docs.length ? flatten(docs) : [] const finalDocs = [] diff --git a/packages/components/nodes/vectorstores/Faiss_Existing/Faiss_Existing.ts b/packages/components/nodes/vectorstores/Faiss_Existing/Faiss_Existing.ts index 6dd18594814..f3030305e5c 100644 --- a/packages/components/nodes/vectorstores/Faiss_Existing/Faiss_Existing.ts +++ b/packages/components/nodes/vectorstores/Faiss_Existing/Faiss_Existing.ts @@ -64,7 +64,7 @@ class Faiss_Existing_VectorStores implements INode { const basePath = nodeData.inputs?.basePath as string const output = nodeData.outputs?.output as string const topK = nodeData.inputs?.topK as string - const k = topK ? parseInt(topK, 10) : 4 + const k = topK ? parseFloat(topK) : 4 const vectorStore = await FaissStore.load(basePath, embeddings) diff --git a/packages/components/nodes/vectorstores/Faiss_Upsert/Faiss_Upsert.ts b/packages/components/nodes/vectorstores/Faiss_Upsert/Faiss_Upsert.ts index 5e5f9028c5f..e0fd9a52503 100644 --- a/packages/components/nodes/vectorstores/Faiss_Upsert/Faiss_Upsert.ts +++ b/packages/components/nodes/vectorstores/Faiss_Upsert/Faiss_Upsert.ts @@ -73,7 +73,7 @@ class FaissUpsert_VectorStores implements INode { const output = nodeData.outputs?.output as string const basePath = nodeData.inputs?.basePath as string const topK = nodeData.inputs?.topK as string - const k = topK ? parseInt(topK, 10) : 4 + const k = topK ? parseFloat(topK) : 4 const flattenDocs = docs && docs.length ? flatten(docs) : [] const finalDocs = [] diff --git a/packages/components/nodes/vectorstores/InMemory/InMemoryVectorStore.ts b/packages/components/nodes/vectorstores/InMemory/InMemoryVectorStore.ts index 32a785a5f39..ac6ed0b2a88 100644 --- a/packages/components/nodes/vectorstores/InMemory/InMemoryVectorStore.ts +++ b/packages/components/nodes/vectorstores/InMemory/InMemoryVectorStore.ts @@ -64,7 +64,7 @@ class InMemoryVectorStore_VectorStores implements INode { const embeddings = nodeData.inputs?.embeddings as Embeddings const output = nodeData.outputs?.output as string const topK = nodeData.inputs?.topK as string - const k = topK ? parseInt(topK, 10) : 4 + const k = topK ? parseFloat(topK) : 4 const flattenDocs = docs && docs.length ? flatten(docs) : [] const finalDocs = [] diff --git a/packages/components/nodes/vectorstores/OpenSearch_Existing/OpenSearch_existing.ts b/packages/components/nodes/vectorstores/OpenSearch_Existing/OpenSearch_existing.ts index 7aeac91928c..e0f05aade66 100644 --- a/packages/components/nodes/vectorstores/OpenSearch_Existing/OpenSearch_existing.ts +++ b/packages/components/nodes/vectorstores/OpenSearch_Existing/OpenSearch_existing.ts @@ -70,7 +70,7 @@ class OpenSearch_Existing_VectorStores implements INode { const indexName = nodeData.inputs?.indexName as string const output = nodeData.outputs?.output as string const topK = nodeData.inputs?.topK as string - const k = topK ? parseInt(topK, 10) : 4 + const k = topK ? parseFloat(topK) : 4 const client = new Client({ nodes: [opensearchURL] diff --git a/packages/components/nodes/vectorstores/OpenSearch_Upsert/OpenSearch_Upsert.ts b/packages/components/nodes/vectorstores/OpenSearch_Upsert/OpenSearch_Upsert.ts index 8d54392b0e7..c225f74ac30 100644 --- a/packages/components/nodes/vectorstores/OpenSearch_Upsert/OpenSearch_Upsert.ts +++ b/packages/components/nodes/vectorstores/OpenSearch_Upsert/OpenSearch_Upsert.ts @@ -79,7 +79,7 @@ class OpenSearchUpsert_VectorStores implements INode { const indexName = nodeData.inputs?.indexName as string const output = nodeData.outputs?.output as string const topK = nodeData.inputs?.topK as string - const k = topK ? parseInt(topK, 10) : 4 + const k = topK ? parseFloat(topK) : 4 const flattenDocs = docs && docs.length ? flatten(docs) : [] const finalDocs = [] diff --git a/packages/components/nodes/vectorstores/Pinecone_Existing/Pinecone_Existing.ts b/packages/components/nodes/vectorstores/Pinecone_Existing/Pinecone_Existing.ts index e57da39621a..39e9f4414fb 100644 --- a/packages/components/nodes/vectorstores/Pinecone_Existing/Pinecone_Existing.ts +++ b/packages/components/nodes/vectorstores/Pinecone_Existing/Pinecone_Existing.ts @@ -92,7 +92,7 @@ class Pinecone_Existing_VectorStores implements INode { const embeddings = nodeData.inputs?.embeddings as Embeddings const output = nodeData.outputs?.output as string const topK = nodeData.inputs?.topK as string - const k = topK ? parseInt(topK, 10) : 4 + const k = topK ? parseFloat(topK) : 4 const client = new PineconeClient() await client.init({ diff --git a/packages/components/nodes/vectorstores/Pinecone_Upsert/Pinecone_Upsert.ts b/packages/components/nodes/vectorstores/Pinecone_Upsert/Pinecone_Upsert.ts index ad1767c25be..136ccec21ec 100644 --- a/packages/components/nodes/vectorstores/Pinecone_Upsert/Pinecone_Upsert.ts +++ b/packages/components/nodes/vectorstores/Pinecone_Upsert/Pinecone_Upsert.ts @@ -93,7 +93,7 @@ class PineconeUpsert_VectorStores implements INode { const embeddings = nodeData.inputs?.embeddings as Embeddings const output = nodeData.outputs?.output as string const topK = nodeData.inputs?.topK as string - const k = topK ? parseInt(topK, 10) : 4 + const k = topK ? parseFloat(topK) : 4 const client = new PineconeClient() await client.init({ diff --git a/packages/components/nodes/vectorstores/Qdrant_Existing/Qdrant_Existing.ts b/packages/components/nodes/vectorstores/Qdrant_Existing/Qdrant_Existing.ts index f1eef8f9027..2dea97253e5 100644 --- a/packages/components/nodes/vectorstores/Qdrant_Existing/Qdrant_Existing.ts +++ b/packages/components/nodes/vectorstores/Qdrant_Existing/Qdrant_Existing.ts @@ -85,7 +85,7 @@ class Qdrant_Existing_VectorStores implements INode { const embeddings = nodeData.inputs?.embeddings as Embeddings const output = nodeData.outputs?.output as string const topK = nodeData.inputs?.topK as string - const k = topK ? parseInt(topK, 10) : 4 + const k = topK ? parseFloat(topK) : 4 // connect to Qdrant Cloud const client = new QdrantClient({ diff --git a/packages/components/nodes/vectorstores/Qdrant_Upsert/Qdrant_Upsert.ts b/packages/components/nodes/vectorstores/Qdrant_Upsert/Qdrant_Upsert.ts index dae1d31d688..4f1ce91b1d9 100644 --- a/packages/components/nodes/vectorstores/Qdrant_Upsert/Qdrant_Upsert.ts +++ b/packages/components/nodes/vectorstores/Qdrant_Upsert/Qdrant_Upsert.ts @@ -86,7 +86,7 @@ class QdrantUpsert_VectorStores implements INode { const embeddings = nodeData.inputs?.embeddings as Embeddings const output = nodeData.outputs?.output as string const topK = nodeData.inputs?.topK as string - const k = topK ? parseInt(topK, 10) : 4 + const k = topK ? parseFloat(topK) : 4 // connect to Qdrant Cloud const client = new QdrantClient({ diff --git a/packages/components/nodes/vectorstores/Singlestore_Existing/Singlestore_Existing.ts b/packages/components/nodes/vectorstores/Singlestore_Existing/Singlestore_Existing.ts index 1b37a4008ec..25be06e7bff 100644 --- a/packages/components/nodes/vectorstores/Singlestore_Existing/Singlestore_Existing.ts +++ b/packages/components/nodes/vectorstores/Singlestore_Existing/Singlestore_Existing.ts @@ -121,7 +121,7 @@ class SingleStoreExisting_VectorStores implements INode { const embeddings = nodeData.inputs?.embeddings as Embeddings const output = nodeData.outputs?.output as string const topK = nodeData.inputs?.topK as string - const k = topK ? parseInt(topK, 10) : 4 + const k = topK ? parseFloat(topK) : 4 let vectorStore: SingleStoreVectorStore diff --git a/packages/components/nodes/vectorstores/Singlestore_Upsert/Singlestore_Upsert.ts b/packages/components/nodes/vectorstores/Singlestore_Upsert/Singlestore_Upsert.ts index eb00381d201..8847552969c 100644 --- a/packages/components/nodes/vectorstores/Singlestore_Upsert/Singlestore_Upsert.ts +++ b/packages/components/nodes/vectorstores/Singlestore_Upsert/Singlestore_Upsert.ts @@ -130,7 +130,7 @@ class SingleStoreUpsert_VectorStores implements INode { const embeddings = nodeData.inputs?.embeddings as Embeddings const output = nodeData.outputs?.output as string const topK = nodeData.inputs?.topK as string - const k = topK ? parseInt(topK, 10) : 4 + const k = topK ? parseFloat(topK) : 4 const flattenDocs = docs && docs.length ? flatten(docs) : [] const finalDocs = [] diff --git a/packages/components/nodes/vectorstores/Supabase_Existing/Supabase_Exisiting.ts b/packages/components/nodes/vectorstores/Supabase_Existing/Supabase_Exisiting.ts index 173660caef0..08cf7ce4882 100644 --- a/packages/components/nodes/vectorstores/Supabase_Existing/Supabase_Exisiting.ts +++ b/packages/components/nodes/vectorstores/Supabase_Existing/Supabase_Exisiting.ts @@ -89,7 +89,7 @@ class Supabase_Existing_VectorStores implements INode { const supabaseMetadataFilter = nodeData.inputs?.supabaseMetadataFilter const output = nodeData.outputs?.output as string const topK = nodeData.inputs?.topK as string - const k = topK ? parseInt(topK, 10) : 4 + const k = topK ? parseFloat(topK) : 4 const client = createClient(supabaseProjUrl, supabaseApiKey) diff --git a/packages/components/nodes/vectorstores/Supabase_Upsert/Supabase_Upsert.ts b/packages/components/nodes/vectorstores/Supabase_Upsert/Supabase_Upsert.ts index 69997a56345..92398476cba 100644 --- a/packages/components/nodes/vectorstores/Supabase_Upsert/Supabase_Upsert.ts +++ b/packages/components/nodes/vectorstores/Supabase_Upsert/Supabase_Upsert.ts @@ -90,7 +90,7 @@ class SupabaseUpsert_VectorStores implements INode { const embeddings = nodeData.inputs?.embeddings as Embeddings const output = nodeData.outputs?.output as string const topK = nodeData.inputs?.topK as string - const k = topK ? parseInt(topK, 10) : 4 + const k = topK ? parseFloat(topK) : 4 const client = createClient(supabaseProjUrl, supabaseApiKey) diff --git a/packages/components/nodes/vectorstores/Weaviate_Existing/Weaviate_Existing.ts b/packages/components/nodes/vectorstores/Weaviate_Existing/Weaviate_Existing.ts index 595691bdc4a..0fa89e494f4 100644 --- a/packages/components/nodes/vectorstores/Weaviate_Existing/Weaviate_Existing.ts +++ b/packages/components/nodes/vectorstores/Weaviate_Existing/Weaviate_Existing.ts @@ -114,7 +114,7 @@ class Weaviate_Existing_VectorStores implements INode { const embeddings = nodeData.inputs?.embeddings as Embeddings const output = nodeData.outputs?.output as string const topK = nodeData.inputs?.topK as string - const k = topK ? parseInt(topK, 10) : 4 + const k = topK ? parseFloat(topK) : 4 const clientConfig: any = { scheme: weaviateScheme, diff --git a/packages/components/nodes/vectorstores/Weaviate_Upsert/Weaviate_Upsert.ts b/packages/components/nodes/vectorstores/Weaviate_Upsert/Weaviate_Upsert.ts index 061374263f3..9565d8a2beb 100644 --- a/packages/components/nodes/vectorstores/Weaviate_Upsert/Weaviate_Upsert.ts +++ b/packages/components/nodes/vectorstores/Weaviate_Upsert/Weaviate_Upsert.ts @@ -123,7 +123,7 @@ class WeaviateUpsert_VectorStores implements INode { const embeddings = nodeData.inputs?.embeddings as Embeddings const output = nodeData.outputs?.output as string const topK = nodeData.inputs?.topK as string - const k = topK ? parseInt(topK, 10) : 4 + const k = topK ? parseFloat(topK) : 4 const clientConfig: any = { scheme: weaviateScheme,