mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-28 13:00:56 +03:00
Merge branch 'main' into FEATURE/Vision
# Conflicts: # packages/components/nodes/chains/ConversationChain/ConversationChain.ts # packages/server/src/index.ts # packages/server/src/utils/index.ts
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
PORT=3000
|
||||
# CORS_ORIGINS="*"
|
||||
# IFRAME_ORIGINS="*"
|
||||
# DATABASE_PATH=/your_database_path/.flowise
|
||||
# APIKEY_PATH=/your_api_key_path/.flowise
|
||||
# SECRETKEY_PATH=/your_api_key_path/.flowise
|
||||
@@ -13,6 +15,7 @@ PORT=3000
|
||||
# DATABASE_USER=""
|
||||
# DATABASE_PASSWORD=""
|
||||
# DATABASE_SSL=true
|
||||
# DATABASE_SSL_KEY_BASE64=<Self signed certificate in BASE64>
|
||||
|
||||
# FLOWISE_USERNAME=user
|
||||
# FLOWISE_PASSWORD=1234
|
||||
@@ -26,3 +29,5 @@ PORT=3000
|
||||
# LANGCHAIN_ENDPOINT=https://api.smith.langchain.com
|
||||
# LANGCHAIN_API_KEY=your_api_key
|
||||
# LANGCHAIN_PROJECT=your_project
|
||||
|
||||
# DISABLE_FLOWISE_TELEMETRY=true
|
||||
@@ -88,7 +88,7 @@
|
||||
"data": {
|
||||
"id": "chatOpenAI_1",
|
||||
"label": "ChatOpenAI",
|
||||
"version": 2,
|
||||
"version": 3,
|
||||
"name": "chatOpenAI",
|
||||
"type": "ChatOpenAI",
|
||||
"baseClasses": ["ChatOpenAI", "BaseChatModel", "BaseLanguageModel"],
|
||||
@@ -111,6 +111,22 @@
|
||||
"label": "gpt-4",
|
||||
"name": "gpt-4"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-turbo-preview",
|
||||
"name": "gpt-4-turbo-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-0125-preview",
|
||||
"name": "gpt-4-0125-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-1106-preview",
|
||||
"name": "gpt-4-1106-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-vision-preview",
|
||||
"name": "gpt-4-vision-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-0613",
|
||||
"name": "gpt-4-0613"
|
||||
@@ -127,6 +143,10 @@
|
||||
"label": "gpt-3.5-turbo",
|
||||
"name": "gpt-3.5-turbo"
|
||||
},
|
||||
{
|
||||
"label": "gpt-3.5-turbo-1106",
|
||||
"name": "gpt-3.5-turbo-1106"
|
||||
},
|
||||
{
|
||||
"label": "gpt-3.5-turbo-0613",
|
||||
"name": "gpt-3.5-turbo-0613"
|
||||
@@ -407,7 +427,7 @@
|
||||
"data": {
|
||||
"id": "chatOpenAI_2",
|
||||
"label": "ChatOpenAI",
|
||||
"version": 2,
|
||||
"version": 3,
|
||||
"name": "chatOpenAI",
|
||||
"type": "ChatOpenAI",
|
||||
"baseClasses": ["ChatOpenAI", "BaseChatModel", "BaseLanguageModel"],
|
||||
@@ -430,6 +450,22 @@
|
||||
"label": "gpt-4",
|
||||
"name": "gpt-4"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-turbo-preview",
|
||||
"name": "gpt-4-turbo-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-0125-preview",
|
||||
"name": "gpt-4-0125-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-1106-preview",
|
||||
"name": "gpt-4-1106-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-vision-preview",
|
||||
"name": "gpt-4-vision-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-0613",
|
||||
"name": "gpt-4-0613"
|
||||
@@ -446,6 +482,10 @@
|
||||
"label": "gpt-3.5-turbo",
|
||||
"name": "gpt-3.5-turbo"
|
||||
},
|
||||
{
|
||||
"label": "gpt-3.5-turbo-1106",
|
||||
"name": "gpt-3.5-turbo-1106"
|
||||
},
|
||||
{
|
||||
"label": "gpt-3.5-turbo-0613",
|
||||
"name": "gpt-3.5-turbo-0613"
|
||||
|
||||
@@ -396,7 +396,7 @@
|
||||
"data": {
|
||||
"id": "chatOpenAI_2",
|
||||
"label": "ChatOpenAI",
|
||||
"version": 2,
|
||||
"version": 3,
|
||||
"name": "chatOpenAI",
|
||||
"type": "ChatOpenAI",
|
||||
"baseClasses": ["ChatOpenAI", "BaseChatModel", "BaseLanguageModel"],
|
||||
@@ -419,6 +419,22 @@
|
||||
"label": "gpt-4",
|
||||
"name": "gpt-4"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-turbo-preview",
|
||||
"name": "gpt-4-turbo-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-0125-preview",
|
||||
"name": "gpt-4-0125-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-1106-preview",
|
||||
"name": "gpt-4-1106-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-vision-preview",
|
||||
"name": "gpt-4-vision-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-0613",
|
||||
"name": "gpt-4-0613"
|
||||
@@ -435,6 +451,10 @@
|
||||
"label": "gpt-3.5-turbo",
|
||||
"name": "gpt-3.5-turbo"
|
||||
},
|
||||
{
|
||||
"label": "gpt-3.5-turbo-1106",
|
||||
"name": "gpt-3.5-turbo-1106"
|
||||
},
|
||||
{
|
||||
"label": "gpt-3.5-turbo-0613",
|
||||
"name": "gpt-3.5-turbo-0613"
|
||||
@@ -567,7 +587,7 @@
|
||||
"data": {
|
||||
"id": "chatOpenAI_1",
|
||||
"label": "ChatOpenAI",
|
||||
"version": 2,
|
||||
"version": 3,
|
||||
"name": "chatOpenAI",
|
||||
"type": "ChatOpenAI",
|
||||
"baseClasses": ["ChatOpenAI", "BaseChatModel", "BaseLanguageModel"],
|
||||
@@ -590,6 +610,22 @@
|
||||
"label": "gpt-4",
|
||||
"name": "gpt-4"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-turbo-preview",
|
||||
"name": "gpt-4-turbo-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-0125-preview",
|
||||
"name": "gpt-4-0125-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-1106-preview",
|
||||
"name": "gpt-4-1106-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-vision-preview",
|
||||
"name": "gpt-4-vision-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-0613",
|
||||
"name": "gpt-4-0613"
|
||||
@@ -606,6 +642,10 @@
|
||||
"label": "gpt-3.5-turbo",
|
||||
"name": "gpt-3.5-turbo"
|
||||
},
|
||||
{
|
||||
"label": "gpt-3.5-turbo-1106",
|
||||
"name": "gpt-3.5-turbo-1106"
|
||||
},
|
||||
{
|
||||
"label": "gpt-3.5-turbo-0613",
|
||||
"name": "gpt-3.5-turbo-0613"
|
||||
@@ -738,7 +778,7 @@
|
||||
"data": {
|
||||
"id": "chatOpenAI_3",
|
||||
"label": "ChatOpenAI",
|
||||
"version": 2,
|
||||
"version": 3,
|
||||
"name": "chatOpenAI",
|
||||
"type": "ChatOpenAI",
|
||||
"baseClasses": ["ChatOpenAI", "BaseChatModel", "BaseLanguageModel"],
|
||||
@@ -761,6 +801,22 @@
|
||||
"label": "gpt-4",
|
||||
"name": "gpt-4"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-turbo-preview",
|
||||
"name": "gpt-4-turbo-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-0125-preview",
|
||||
"name": "gpt-4-0125-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-1106-preview",
|
||||
"name": "gpt-4-1106-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-vision-preview",
|
||||
"name": "gpt-4-vision-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-0613",
|
||||
"name": "gpt-4-0613"
|
||||
@@ -777,6 +833,10 @@
|
||||
"label": "gpt-3.5-turbo",
|
||||
"name": "gpt-3.5-turbo"
|
||||
},
|
||||
{
|
||||
"label": "gpt-3.5-turbo-1106",
|
||||
"name": "gpt-3.5-turbo-1106"
|
||||
},
|
||||
{
|
||||
"label": "gpt-3.5-turbo-0613",
|
||||
"name": "gpt-3.5-turbo-0613"
|
||||
|
||||
@@ -175,7 +175,7 @@
|
||||
"data": {
|
||||
"id": "chatOpenAI_0",
|
||||
"label": "ChatOpenAI",
|
||||
"version": 2,
|
||||
"version": 3,
|
||||
"name": "chatOpenAI",
|
||||
"type": "ChatOpenAI",
|
||||
"baseClasses": ["ChatOpenAI", "BaseChatModel", "BaseLanguageModel"],
|
||||
@@ -198,6 +198,22 @@
|
||||
"label": "gpt-4",
|
||||
"name": "gpt-4"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-turbo-preview",
|
||||
"name": "gpt-4-turbo-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-0125-preview",
|
||||
"name": "gpt-4-0125-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-1106-preview",
|
||||
"name": "gpt-4-1106-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-vision-preview",
|
||||
"name": "gpt-4-vision-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-0613",
|
||||
"name": "gpt-4-0613"
|
||||
@@ -214,6 +230,10 @@
|
||||
"label": "gpt-3.5-turbo",
|
||||
"name": "gpt-3.5-turbo"
|
||||
},
|
||||
{
|
||||
"label": "gpt-3.5-turbo-1106",
|
||||
"name": "gpt-3.5-turbo-1106"
|
||||
},
|
||||
{
|
||||
"label": "gpt-3.5-turbo-0613",
|
||||
"name": "gpt-3.5-turbo-0613"
|
||||
@@ -381,13 +401,23 @@
|
||||
"type": "BaseLLMOutputParser",
|
||||
"optional": true,
|
||||
"id": "llmChain_0-input-outputParser-BaseLLMOutputParser"
|
||||
},
|
||||
{
|
||||
"label": "Input Moderation",
|
||||
"description": "Detect text that could generate harmful output and prevent it from being sent to the language model",
|
||||
"name": "inputModeration",
|
||||
"type": "Moderation",
|
||||
"optional": true,
|
||||
"list": true,
|
||||
"id": "llmChain_0-input-inputModeration-Moderation"
|
||||
}
|
||||
],
|
||||
"inputs": {
|
||||
"model": "{{chatOpenAI_0.data.instance}}",
|
||||
"prompt": "{{fewShotPromptTemplate_1.data.instance}}",
|
||||
"outputParser": "",
|
||||
"chainName": ""
|
||||
"chainName": "",
|
||||
"inputModeration": ""
|
||||
},
|
||||
"outputAnchors": [
|
||||
{
|
||||
|
||||
@@ -251,7 +251,7 @@
|
||||
"data": {
|
||||
"id": "chatOpenAI_0",
|
||||
"label": "ChatOpenAI",
|
||||
"version": 2,
|
||||
"version": 3,
|
||||
"name": "chatOpenAI",
|
||||
"type": "ChatOpenAI",
|
||||
"baseClasses": ["ChatOpenAI", "BaseChatModel", "BaseLanguageModel"],
|
||||
@@ -274,6 +274,22 @@
|
||||
"label": "gpt-4",
|
||||
"name": "gpt-4"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-turbo-preview",
|
||||
"name": "gpt-4-turbo-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-0125-preview",
|
||||
"name": "gpt-4-0125-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-1106-preview",
|
||||
"name": "gpt-4-1106-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-vision-preview",
|
||||
"name": "gpt-4-vision-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-0613",
|
||||
"name": "gpt-4-0613"
|
||||
@@ -290,6 +306,10 @@
|
||||
"label": "gpt-3.5-turbo",
|
||||
"name": "gpt-3.5-turbo"
|
||||
},
|
||||
{
|
||||
"label": "gpt-3.5-turbo-1106",
|
||||
"name": "gpt-3.5-turbo-1106"
|
||||
},
|
||||
{
|
||||
"label": "gpt-3.5-turbo-0613",
|
||||
"name": "gpt-3.5-turbo-0613"
|
||||
@@ -422,7 +442,7 @@
|
||||
"data": {
|
||||
"id": "openAIEmbeddings_0",
|
||||
"label": "OpenAI Embeddings",
|
||||
"version": 1,
|
||||
"version": 2,
|
||||
"name": "openAIEmbeddings",
|
||||
"type": "OpenAIEmbeddings",
|
||||
"baseClasses": ["OpenAIEmbeddings", "Embeddings"],
|
||||
@@ -436,6 +456,28 @@
|
||||
"credentialNames": ["openAIApi"],
|
||||
"id": "openAIEmbeddings_0-input-credential-credential"
|
||||
},
|
||||
{
|
||||
"label": "Model Name",
|
||||
"name": "modelName",
|
||||
"type": "options",
|
||||
"options": [
|
||||
{
|
||||
"label": "text-embedding-3-large",
|
||||
"name": "text-embedding-3-large"
|
||||
},
|
||||
{
|
||||
"label": "text-embedding-3-small",
|
||||
"name": "text-embedding-3-small"
|
||||
},
|
||||
{
|
||||
"label": "text-embedding-ada-002",
|
||||
"name": "text-embedding-ada-002"
|
||||
}
|
||||
],
|
||||
"default": "text-embedding-ada-002",
|
||||
"optional": true,
|
||||
"id": "openAIEmbeddings_0-input-modelName-options"
|
||||
},
|
||||
{
|
||||
"label": "Strip New Lines",
|
||||
"name": "stripNewLines",
|
||||
@@ -474,7 +516,8 @@
|
||||
"stripNewLines": "",
|
||||
"batchSize": "",
|
||||
"timeout": "",
|
||||
"basepath": ""
|
||||
"basepath": "",
|
||||
"modelName": "text-embedding-ada-002"
|
||||
},
|
||||
"outputAnchors": [
|
||||
{
|
||||
@@ -506,12 +549,12 @@
|
||||
"data": {
|
||||
"id": "pinecone_0",
|
||||
"label": "Pinecone",
|
||||
"version": 1,
|
||||
"version": 2,
|
||||
"name": "pinecone",
|
||||
"type": "Pinecone",
|
||||
"baseClasses": ["Pinecone", "VectorStoreRetriever", "BaseRetriever"],
|
||||
"category": "Vector Stores",
|
||||
"description": "Upsert embedded data and perform similarity search upon query using Pinecone, a leading fully managed hosted vector database",
|
||||
"description": "Upsert embedded data and perform similarity or mmr search using Pinecone, a leading fully managed hosted vector database",
|
||||
"inputParams": [
|
||||
{
|
||||
"label": "Connect Credential",
|
||||
@@ -552,6 +595,45 @@
|
||||
"additionalParams": true,
|
||||
"optional": true,
|
||||
"id": "pinecone_0-input-topK-number"
|
||||
},
|
||||
{
|
||||
"label": "Search Type",
|
||||
"name": "searchType",
|
||||
"type": "options",
|
||||
"default": "similarity",
|
||||
"options": [
|
||||
{
|
||||
"label": "Similarity",
|
||||
"name": "similarity"
|
||||
},
|
||||
{
|
||||
"label": "Max Marginal Relevance",
|
||||
"name": "mmr"
|
||||
}
|
||||
],
|
||||
"additionalParams": true,
|
||||
"optional": true,
|
||||
"id": "pinecone_0-input-searchType-options"
|
||||
},
|
||||
{
|
||||
"label": "Fetch K (for MMR Search)",
|
||||
"name": "fetchK",
|
||||
"description": "Number of initial documents to fetch for MMR reranking. Default to 20. Used only when the search type is MMR",
|
||||
"placeholder": "20",
|
||||
"type": "number",
|
||||
"additionalParams": true,
|
||||
"optional": true,
|
||||
"id": "pinecone_0-input-fetchK-number"
|
||||
},
|
||||
{
|
||||
"label": "Lambda (for MMR Search)",
|
||||
"name": "lambda",
|
||||
"description": "Number between 0 and 1 that determines the degree of diversity among the results, where 0 corresponds to maximum diversity and 1 to minimum diversity. Used only when the search type is MMR",
|
||||
"placeholder": "0.5",
|
||||
"type": "number",
|
||||
"additionalParams": true,
|
||||
"optional": true,
|
||||
"id": "pinecone_0-input-lambda-number"
|
||||
}
|
||||
],
|
||||
"inputAnchors": [
|
||||
@@ -576,7 +658,10 @@
|
||||
"pineconeIndex": "",
|
||||
"pineconeNamespace": "",
|
||||
"pineconeMetadataFilter": "",
|
||||
"topK": ""
|
||||
"topK": "",
|
||||
"searchType": "similarity",
|
||||
"fetchK": "",
|
||||
"lambda": ""
|
||||
},
|
||||
"outputAnchors": [
|
||||
{
|
||||
|
||||
@@ -77,7 +77,7 @@
|
||||
"data": {
|
||||
"id": "openAIEmbeddings_0",
|
||||
"label": "OpenAI Embeddings",
|
||||
"version": 1,
|
||||
"version": 2,
|
||||
"name": "openAIEmbeddings",
|
||||
"type": "OpenAIEmbeddings",
|
||||
"baseClasses": ["OpenAIEmbeddings", "Embeddings"],
|
||||
@@ -91,6 +91,28 @@
|
||||
"credentialNames": ["openAIApi"],
|
||||
"id": "openAIEmbeddings_0-input-credential-credential"
|
||||
},
|
||||
{
|
||||
"label": "Model Name",
|
||||
"name": "modelName",
|
||||
"type": "options",
|
||||
"options": [
|
||||
{
|
||||
"label": "text-embedding-3-large",
|
||||
"name": "text-embedding-3-large"
|
||||
},
|
||||
{
|
||||
"label": "text-embedding-3-small",
|
||||
"name": "text-embedding-3-small"
|
||||
},
|
||||
{
|
||||
"label": "text-embedding-ada-002",
|
||||
"name": "text-embedding-ada-002"
|
||||
}
|
||||
],
|
||||
"default": "text-embedding-ada-002",
|
||||
"optional": true,
|
||||
"id": "openAIEmbeddings_0-input-modelName-options"
|
||||
},
|
||||
{
|
||||
"label": "Strip New Lines",
|
||||
"name": "stripNewLines",
|
||||
@@ -129,7 +151,8 @@
|
||||
"stripNewLines": "",
|
||||
"batchSize": "",
|
||||
"timeout": "",
|
||||
"basepath": ""
|
||||
"basepath": "",
|
||||
"modelName": "text-embedding-ada-002"
|
||||
},
|
||||
"outputAnchors": [
|
||||
{
|
||||
@@ -161,12 +184,12 @@
|
||||
"data": {
|
||||
"id": "pinecone_0",
|
||||
"label": "Pinecone",
|
||||
"version": 1,
|
||||
"version": 2,
|
||||
"name": "pinecone",
|
||||
"type": "Pinecone",
|
||||
"baseClasses": ["Pinecone", "VectorStoreRetriever", "BaseRetriever"],
|
||||
"category": "Vector Stores",
|
||||
"description": "Upsert embedded data and perform similarity search upon query using Pinecone, a leading fully managed hosted vector database",
|
||||
"description": "Upsert embedded data and perform similarity or mmr search using Pinecone, a leading fully managed hosted vector database",
|
||||
"inputParams": [
|
||||
{
|
||||
"label": "Connect Credential",
|
||||
@@ -207,6 +230,45 @@
|
||||
"additionalParams": true,
|
||||
"optional": true,
|
||||
"id": "pinecone_0-input-topK-number"
|
||||
},
|
||||
{
|
||||
"label": "Search Type",
|
||||
"name": "searchType",
|
||||
"type": "options",
|
||||
"default": "similarity",
|
||||
"options": [
|
||||
{
|
||||
"label": "Similarity",
|
||||
"name": "similarity"
|
||||
},
|
||||
{
|
||||
"label": "Max Marginal Relevance",
|
||||
"name": "mmr"
|
||||
}
|
||||
],
|
||||
"additionalParams": true,
|
||||
"optional": true,
|
||||
"id": "pinecone_0-input-searchType-options"
|
||||
},
|
||||
{
|
||||
"label": "Fetch K (for MMR Search)",
|
||||
"name": "fetchK",
|
||||
"description": "Number of initial documents to fetch for MMR reranking. Default to 20. Used only when the search type is MMR",
|
||||
"placeholder": "20",
|
||||
"type": "number",
|
||||
"additionalParams": true,
|
||||
"optional": true,
|
||||
"id": "pinecone_0-input-fetchK-number"
|
||||
},
|
||||
{
|
||||
"label": "Lambda (for MMR Search)",
|
||||
"name": "lambda",
|
||||
"description": "Number between 0 and 1 that determines the degree of diversity among the results, where 0 corresponds to maximum diversity and 1 to minimum diversity. Used only when the search type is MMR",
|
||||
"placeholder": "0.5",
|
||||
"type": "number",
|
||||
"additionalParams": true,
|
||||
"optional": true,
|
||||
"id": "pinecone_0-input-lambda-number"
|
||||
}
|
||||
],
|
||||
"inputAnchors": [
|
||||
@@ -231,7 +293,10 @@
|
||||
"pineconeIndex": "",
|
||||
"pineconeNamespace": "",
|
||||
"pineconeMetadataFilter": "",
|
||||
"topK": ""
|
||||
"topK": "",
|
||||
"searchType": "similarity",
|
||||
"fetchK": "",
|
||||
"lambda": ""
|
||||
},
|
||||
"outputAnchors": [
|
||||
{
|
||||
@@ -279,7 +344,7 @@
|
||||
"data": {
|
||||
"id": "chatOpenAI_0",
|
||||
"label": "ChatOpenAI",
|
||||
"version": 2,
|
||||
"version": 3,
|
||||
"name": "chatOpenAI",
|
||||
"type": "ChatOpenAI",
|
||||
"baseClasses": ["ChatOpenAI", "BaseChatModel", "BaseLanguageModel", "Runnable"],
|
||||
@@ -302,6 +367,14 @@
|
||||
"label": "gpt-4",
|
||||
"name": "gpt-4"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-turbo-preview",
|
||||
"name": "gpt-4-turbo-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-0125-preview",
|
||||
"name": "gpt-4-0125-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-1106-preview",
|
||||
"name": "gpt-4-1106-preview"
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
"id": "chatOpenAI_0",
|
||||
"label": "ChatOpenAI",
|
||||
"name": "chatOpenAI",
|
||||
"version": 2,
|
||||
"version": 3,
|
||||
"type": "ChatOpenAI",
|
||||
"baseClasses": ["ChatOpenAI", "BaseChatModel", "BaseLanguageModel"],
|
||||
"category": "Chat Models",
|
||||
@@ -92,6 +92,22 @@
|
||||
"label": "gpt-4",
|
||||
"name": "gpt-4"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-turbo-preview",
|
||||
"name": "gpt-4-turbo-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-0125-preview",
|
||||
"name": "gpt-4-0125-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-1106-preview",
|
||||
"name": "gpt-4-1106-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-vision-preview",
|
||||
"name": "gpt-4-vision-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-0613",
|
||||
"name": "gpt-4-0613"
|
||||
@@ -108,6 +124,10 @@
|
||||
"label": "gpt-3.5-turbo",
|
||||
"name": "gpt-3.5-turbo"
|
||||
},
|
||||
{
|
||||
"label": "gpt-3.5-turbo-1106",
|
||||
"name": "gpt-3.5-turbo-1106"
|
||||
},
|
||||
{
|
||||
"label": "gpt-3.5-turbo-0613",
|
||||
"name": "gpt-3.5-turbo-0613"
|
||||
|
||||
@@ -194,7 +194,7 @@
|
||||
"data": {
|
||||
"id": "chatOpenAI_0",
|
||||
"label": "ChatOpenAI",
|
||||
"version": 2,
|
||||
"version": 3,
|
||||
"name": "chatOpenAI",
|
||||
"type": "ChatOpenAI",
|
||||
"baseClasses": ["ChatOpenAI", "BaseChatModel", "BaseLanguageModel", "Runnable"],
|
||||
@@ -217,6 +217,22 @@
|
||||
"label": "gpt-4",
|
||||
"name": "gpt-4"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-turbo-preview",
|
||||
"name": "gpt-4-turbo-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-0125-preview",
|
||||
"name": "gpt-4-0125-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-1106-preview",
|
||||
"name": "gpt-4-1106-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-vision-preview",
|
||||
"name": "gpt-4-vision-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-0613",
|
||||
"name": "gpt-4-0613"
|
||||
@@ -233,6 +249,10 @@
|
||||
"label": "gpt-3.5-turbo",
|
||||
"name": "gpt-3.5-turbo"
|
||||
},
|
||||
{
|
||||
"label": "gpt-3.5-turbo-1106",
|
||||
"name": "gpt-3.5-turbo-1106"
|
||||
},
|
||||
{
|
||||
"label": "gpt-3.5-turbo-0613",
|
||||
"name": "gpt-3.5-turbo-0613"
|
||||
@@ -440,7 +460,7 @@
|
||||
"data": {
|
||||
"id": "openAIEmbeddings_0",
|
||||
"label": "OpenAI Embeddings",
|
||||
"version": 1,
|
||||
"version": 2,
|
||||
"name": "openAIEmbeddings",
|
||||
"type": "OpenAIEmbeddings",
|
||||
"baseClasses": ["OpenAIEmbeddings", "Embeddings"],
|
||||
@@ -454,6 +474,28 @@
|
||||
"credentialNames": ["openAIApi"],
|
||||
"id": "openAIEmbeddings_0-input-credential-credential"
|
||||
},
|
||||
{
|
||||
"label": "Model Name",
|
||||
"name": "modelName",
|
||||
"type": "options",
|
||||
"options": [
|
||||
{
|
||||
"label": "text-embedding-3-large",
|
||||
"name": "text-embedding-3-large"
|
||||
},
|
||||
{
|
||||
"label": "text-embedding-3-small",
|
||||
"name": "text-embedding-3-small"
|
||||
},
|
||||
{
|
||||
"label": "text-embedding-ada-002",
|
||||
"name": "text-embedding-ada-002"
|
||||
}
|
||||
],
|
||||
"default": "text-embedding-ada-002",
|
||||
"optional": true,
|
||||
"id": "openAIEmbeddings_0-input-modelName-options"
|
||||
},
|
||||
{
|
||||
"label": "Strip New Lines",
|
||||
"name": "stripNewLines",
|
||||
@@ -492,7 +534,8 @@
|
||||
"stripNewLines": "",
|
||||
"batchSize": "",
|
||||
"timeout": "",
|
||||
"basepath": ""
|
||||
"basepath": "",
|
||||
"modelName": "text-embedding-ada-002"
|
||||
},
|
||||
"outputAnchors": [
|
||||
{
|
||||
|
||||
@@ -215,7 +215,7 @@
|
||||
"id": "chatOpenAI_0",
|
||||
"label": "ChatOpenAI",
|
||||
"name": "chatOpenAI",
|
||||
"version": 2,
|
||||
"version": 3,
|
||||
"type": "ChatOpenAI",
|
||||
"baseClasses": ["ChatOpenAI", "BaseChatModel", "BaseLanguageModel"],
|
||||
"category": "Chat Models",
|
||||
@@ -237,6 +237,22 @@
|
||||
"label": "gpt-4",
|
||||
"name": "gpt-4"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-turbo-preview",
|
||||
"name": "gpt-4-turbo-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-0125-preview",
|
||||
"name": "gpt-4-0125-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-1106-preview",
|
||||
"name": "gpt-4-1106-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-vision-preview",
|
||||
"name": "gpt-4-vision-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-0613",
|
||||
"name": "gpt-4-0613"
|
||||
@@ -253,6 +269,10 @@
|
||||
"label": "gpt-3.5-turbo",
|
||||
"name": "gpt-3.5-turbo"
|
||||
},
|
||||
{
|
||||
"label": "gpt-3.5-turbo-1106",
|
||||
"name": "gpt-3.5-turbo-1106"
|
||||
},
|
||||
{
|
||||
"label": "gpt-3.5-turbo-0613",
|
||||
"name": "gpt-3.5-turbo-0613"
|
||||
|
||||
@@ -6,15 +6,15 @@
|
||||
"height": 376,
|
||||
"id": "bufferMemory_0",
|
||||
"position": {
|
||||
"x": 451.4449437285705,
|
||||
"y": 118.30026803362762
|
||||
"x": 240.5161028076149,
|
||||
"y": 165.35849026339048
|
||||
},
|
||||
"type": "customNode",
|
||||
"data": {
|
||||
"id": "bufferMemory_0",
|
||||
"label": "Buffer Memory",
|
||||
"name": "bufferMemory",
|
||||
"version": 1,
|
||||
"name": "bufferMemory",
|
||||
"type": "BufferMemory",
|
||||
"baseClasses": ["BufferMemory", "BaseChatMemory", "BaseMemory"],
|
||||
"category": "Memory",
|
||||
@@ -53,8 +53,8 @@
|
||||
},
|
||||
"selected": false,
|
||||
"positionAbsolute": {
|
||||
"x": 451.4449437285705,
|
||||
"y": 118.30026803362762
|
||||
"x": 240.5161028076149,
|
||||
"y": 165.35849026339048
|
||||
},
|
||||
"dragging": false
|
||||
},
|
||||
@@ -63,17 +63,17 @@
|
||||
"height": 383,
|
||||
"id": "conversationChain_0",
|
||||
"position": {
|
||||
"x": 1176.1569322079652,
|
||||
"y": 303.56879146735974
|
||||
"x": 958.9887390513221,
|
||||
"y": 318.8734467468765
|
||||
},
|
||||
"type": "customNode",
|
||||
"data": {
|
||||
"id": "conversationChain_0",
|
||||
"label": "Conversation Chain",
|
||||
"version": 3,
|
||||
"name": "conversationChain",
|
||||
"version": 1,
|
||||
"type": "ConversationChain",
|
||||
"baseClasses": ["ConversationChain", "LLMChain", "BaseChain"],
|
||||
"baseClasses": ["ConversationChain", "LLMChain", "BaseChain", "Runnable"],
|
||||
"category": "Chains",
|
||||
"description": "Chat models specific conversational chain with memory",
|
||||
"inputParams": [
|
||||
@@ -82,9 +82,11 @@
|
||||
"name": "systemMessagePrompt",
|
||||
"type": "string",
|
||||
"rows": 4,
|
||||
"description": "If Chat Prompt Template is provided, this will be ignored",
|
||||
"additionalParams": true,
|
||||
"optional": true,
|
||||
"placeholder": "You are a helpful assistant that write codes",
|
||||
"default": "The following is a friendly conversation between a human and an AI. The AI is talkative and provides lots of specific details from its context. If the AI does not know the answer to a question, it truthfully says it does not know.",
|
||||
"placeholder": "The following is a friendly conversation between a human and an AI. The AI is talkative and provides lots of specific details from its context. If the AI does not know the answer to a question, it truthfully says it does not know.",
|
||||
"id": "conversationChain_0-input-systemMessagePrompt-string"
|
||||
}
|
||||
],
|
||||
@@ -102,27 +104,36 @@
|
||||
"id": "conversationChain_0-input-memory-BaseMemory"
|
||||
},
|
||||
{
|
||||
"label": "Document",
|
||||
"name": "document",
|
||||
"type": "Document",
|
||||
"description": "Include whole document into the context window",
|
||||
"label": "Chat Prompt Template",
|
||||
"name": "chatPromptTemplate",
|
||||
"type": "ChatPromptTemplate",
|
||||
"description": "Override existing prompt with Chat Prompt Template. Human Message must includes {input} variable",
|
||||
"optional": true,
|
||||
"id": "conversationChain_0-input-chatPromptTemplate-ChatPromptTemplate"
|
||||
},
|
||||
{
|
||||
"label": "Input Moderation",
|
||||
"description": "Detect text that could generate harmful output and prevent it from being sent to the language model",
|
||||
"name": "inputModeration",
|
||||
"type": "Moderation",
|
||||
"optional": true,
|
||||
"list": true,
|
||||
"id": "conversationChain_0-input-document-Document"
|
||||
"id": "conversationChain_0-input-inputModeration-Moderation"
|
||||
}
|
||||
],
|
||||
"inputs": {
|
||||
"inputModeration": "",
|
||||
"model": "{{chatAnthropic_0.data.instance}}",
|
||||
"memory": "{{bufferMemory_0.data.instance}}",
|
||||
"document": ["{{pdfFile_0.data.instance}}"],
|
||||
"systemMessagePrompt": ""
|
||||
"chatPromptTemplate": "{{chatPromptTemplate_0.data.instance}}",
|
||||
"systemMessagePrompt": "The following is a friendly conversation between a human and an AI. The AI is talkative and provides lots of specific details from its context. If the AI does not know the answer to a question, it truthfully says it does not know."
|
||||
},
|
||||
"outputAnchors": [
|
||||
{
|
||||
"id": "conversationChain_0-output-conversationChain-ConversationChain|LLMChain|BaseChain",
|
||||
"id": "conversationChain_0-output-conversationChain-ConversationChain|LLMChain|BaseChain|Runnable",
|
||||
"name": "conversationChain",
|
||||
"label": "ConversationChain",
|
||||
"type": "ConversationChain | LLMChain | BaseChain"
|
||||
"type": "ConversationChain | LLMChain | BaseChain | Runnable"
|
||||
}
|
||||
],
|
||||
"outputs": {},
|
||||
@@ -130,27 +141,27 @@
|
||||
},
|
||||
"selected": false,
|
||||
"positionAbsolute": {
|
||||
"x": 1176.1569322079652,
|
||||
"y": 303.56879146735974
|
||||
"x": 958.9887390513221,
|
||||
"y": 318.8734467468765
|
||||
},
|
||||
"dragging": false
|
||||
},
|
||||
{
|
||||
"width": 300,
|
||||
"height": 523,
|
||||
"height": 574,
|
||||
"id": "chatAnthropic_0",
|
||||
"position": {
|
||||
"x": 800.5525382783799,
|
||||
"y": -130.7988221837009
|
||||
"x": 585.3308245972187,
|
||||
"y": -116.32789506560908
|
||||
},
|
||||
"type": "customNode",
|
||||
"data": {
|
||||
"id": "chatAnthropic_0",
|
||||
"label": "ChatAnthropic",
|
||||
"name": "chatAnthropic",
|
||||
"version": 3,
|
||||
"name": "chatAnthropic",
|
||||
"type": "ChatAnthropic",
|
||||
"baseClasses": ["ChatAnthropic", "BaseChatModel", "BaseLanguageModel"],
|
||||
"baseClasses": ["ChatAnthropic", "BaseChatModel", "BaseLanguageModel", "Runnable"],
|
||||
"category": "Chat Models",
|
||||
"description": "Wrapper around ChatAnthropic large language models that use the Chat endpoint",
|
||||
"inputParams": [
|
||||
@@ -226,7 +237,7 @@
|
||||
"name": "claude-instant-v1.1-100k"
|
||||
}
|
||||
],
|
||||
"default": "claude-v1",
|
||||
"default": "claude-2",
|
||||
"optional": true,
|
||||
"id": "chatAnthropic_0-input-modelName-options"
|
||||
},
|
||||
@@ -234,6 +245,7 @@
|
||||
"label": "Temperature",
|
||||
"name": "temperature",
|
||||
"type": "number",
|
||||
"step": 0.1,
|
||||
"default": 0.9,
|
||||
"optional": true,
|
||||
"id": "chatAnthropic_0-input-temperature-number"
|
||||
@@ -242,6 +254,7 @@
|
||||
"label": "Max Tokens",
|
||||
"name": "maxTokensToSample",
|
||||
"type": "number",
|
||||
"step": 1,
|
||||
"optional": true,
|
||||
"additionalParams": true,
|
||||
"id": "chatAnthropic_0-input-maxTokensToSample-number"
|
||||
@@ -250,6 +263,7 @@
|
||||
"label": "Top P",
|
||||
"name": "topP",
|
||||
"type": "number",
|
||||
"step": 0.1,
|
||||
"optional": true,
|
||||
"additionalParams": true,
|
||||
"id": "chatAnthropic_0-input-topP-number"
|
||||
@@ -258,6 +272,7 @@
|
||||
"label": "Top K",
|
||||
"name": "topK",
|
||||
"type": "number",
|
||||
"step": 0.1,
|
||||
"optional": true,
|
||||
"additionalParams": true,
|
||||
"id": "chatAnthropic_0-input-topK-number"
|
||||
@@ -273,6 +288,7 @@
|
||||
}
|
||||
],
|
||||
"inputs": {
|
||||
"cache": "",
|
||||
"modelName": "claude-2.1",
|
||||
"temperature": 0.9,
|
||||
"maxTokensToSample": "",
|
||||
@@ -281,10 +297,10 @@
|
||||
},
|
||||
"outputAnchors": [
|
||||
{
|
||||
"id": "chatAnthropic_0-output-chatAnthropic-ChatAnthropic|BaseChatModel|BaseLanguageModel",
|
||||
"id": "chatAnthropic_0-output-chatAnthropic-ChatAnthropic|BaseChatModel|BaseLanguageModel|Runnable",
|
||||
"name": "chatAnthropic",
|
||||
"label": "ChatAnthropic",
|
||||
"type": "ChatAnthropic | BaseChatModel | BaseLanguageModel"
|
||||
"type": "ChatAnthropic | BaseChatModel | BaseLanguageModel | Runnable"
|
||||
}
|
||||
],
|
||||
"outputs": {},
|
||||
@@ -292,61 +308,106 @@
|
||||
},
|
||||
"selected": false,
|
||||
"positionAbsolute": {
|
||||
"x": 800.5525382783799,
|
||||
"y": -130.7988221837009
|
||||
"x": 585.3308245972187,
|
||||
"y": -116.32789506560908
|
||||
},
|
||||
"dragging": false
|
||||
},
|
||||
{
|
||||
"width": 300,
|
||||
"height": 507,
|
||||
"id": "pdfFile_0",
|
||||
"height": 688,
|
||||
"id": "chatPromptTemplate_0",
|
||||
"position": {
|
||||
"x": 94.16886576108482,
|
||||
"y": 37.12056504707391
|
||||
"x": -106.44189698270114,
|
||||
"y": 20.133956087516538
|
||||
},
|
||||
"type": "customNode",
|
||||
"data": {
|
||||
"id": "pdfFile_0",
|
||||
"label": "Pdf File",
|
||||
"name": "pdfFile",
|
||||
"id": "chatPromptTemplate_0",
|
||||
"label": "Chat Prompt Template",
|
||||
"version": 1,
|
||||
"name": "chatPromptTemplate",
|
||||
"type": "ChatPromptTemplate",
|
||||
"baseClasses": ["ChatPromptTemplate", "BaseChatPromptTemplate", "BasePromptTemplate", "Runnable"],
|
||||
"category": "Prompts",
|
||||
"description": "Schema to represent a chat prompt",
|
||||
"inputParams": [
|
||||
{
|
||||
"label": "System Message",
|
||||
"name": "systemMessagePrompt",
|
||||
"type": "string",
|
||||
"rows": 4,
|
||||
"placeholder": "You are a helpful assistant that translates {input_language} to {output_language}.",
|
||||
"id": "chatPromptTemplate_0-input-systemMessagePrompt-string"
|
||||
},
|
||||
{
|
||||
"label": "Human Message",
|
||||
"name": "humanMessagePrompt",
|
||||
"type": "string",
|
||||
"rows": 4,
|
||||
"placeholder": "{text}",
|
||||
"id": "chatPromptTemplate_0-input-humanMessagePrompt-string"
|
||||
},
|
||||
{
|
||||
"label": "Format Prompt Values",
|
||||
"name": "promptValues",
|
||||
"type": "json",
|
||||
"optional": true,
|
||||
"acceptVariable": true,
|
||||
"list": true,
|
||||
"id": "chatPromptTemplate_0-input-promptValues-json"
|
||||
}
|
||||
],
|
||||
"inputAnchors": [],
|
||||
"inputs": {
|
||||
"systemMessagePrompt": "The following is a friendly conversation between a human and an AI. The AI is talkative and provides lots of specific details from its context. If the AI does not know the answer to a question, it truthfully says it does not know.\nThe AI has the following context:\n{context}",
|
||||
"humanMessagePrompt": "{input}",
|
||||
"promptValues": "{\"context\":\"{{plainText_0.data.instance}}\",\"input\":\"{{question}}\"}"
|
||||
},
|
||||
"outputAnchors": [
|
||||
{
|
||||
"id": "chatPromptTemplate_0-output-chatPromptTemplate-ChatPromptTemplate|BaseChatPromptTemplate|BasePromptTemplate|Runnable",
|
||||
"name": "chatPromptTemplate",
|
||||
"label": "ChatPromptTemplate",
|
||||
"type": "ChatPromptTemplate | BaseChatPromptTemplate | BasePromptTemplate | Runnable"
|
||||
}
|
||||
],
|
||||
"outputs": {},
|
||||
"selected": false
|
||||
},
|
||||
"selected": false,
|
||||
"positionAbsolute": {
|
||||
"x": -106.44189698270114,
|
||||
"y": 20.133956087516538
|
||||
},
|
||||
"dragging": false
|
||||
},
|
||||
{
|
||||
"width": 300,
|
||||
"height": 485,
|
||||
"id": "plainText_0",
|
||||
"position": {
|
||||
"x": -487.7511991135089,
|
||||
"y": 77.83838996645807
|
||||
},
|
||||
"type": "customNode",
|
||||
"data": {
|
||||
"id": "plainText_0",
|
||||
"label": "Plain Text",
|
||||
"version": 2,
|
||||
"name": "plainText",
|
||||
"type": "Document",
|
||||
"baseClasses": ["Document"],
|
||||
"category": "Document Loaders",
|
||||
"description": "Load data from PDF files",
|
||||
"description": "Load data from plain text",
|
||||
"inputParams": [
|
||||
{
|
||||
"label": "Pdf File",
|
||||
"name": "pdfFile",
|
||||
"type": "file",
|
||||
"fileType": ".pdf",
|
||||
"id": "pdfFile_0-input-pdfFile-file"
|
||||
},
|
||||
{
|
||||
"label": "Usage",
|
||||
"name": "usage",
|
||||
"type": "options",
|
||||
"options": [
|
||||
{
|
||||
"label": "One document per page",
|
||||
"name": "perPage"
|
||||
},
|
||||
{
|
||||
"label": "One document per file",
|
||||
"name": "perFile"
|
||||
}
|
||||
],
|
||||
"default": "perPage",
|
||||
"id": "pdfFile_0-input-usage-options"
|
||||
},
|
||||
{
|
||||
"label": "Use Legacy Build",
|
||||
"name": "legacyBuild",
|
||||
"type": "boolean",
|
||||
"optional": true,
|
||||
"additionalParams": true,
|
||||
"id": "pdfFile_0-input-legacyBuild-boolean"
|
||||
"label": "Text",
|
||||
"name": "text",
|
||||
"type": "string",
|
||||
"rows": 4,
|
||||
"placeholder": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua...",
|
||||
"id": "plainText_0-input-text-string"
|
||||
},
|
||||
{
|
||||
"label": "Metadata",
|
||||
@@ -354,7 +415,7 @@
|
||||
"type": "json",
|
||||
"optional": true,
|
||||
"additionalParams": true,
|
||||
"id": "pdfFile_0-input-metadata-json"
|
||||
"id": "plainText_0-input-metadata-json"
|
||||
}
|
||||
],
|
||||
"inputAnchors": [
|
||||
@@ -363,30 +424,45 @@
|
||||
"name": "textSplitter",
|
||||
"type": "TextSplitter",
|
||||
"optional": true,
|
||||
"id": "pdfFile_0-input-textSplitter-TextSplitter"
|
||||
"id": "plainText_0-input-textSplitter-TextSplitter"
|
||||
}
|
||||
],
|
||||
"inputs": {
|
||||
"text": "Welcome to Skyworld Hotel, where your dreams take flight and your stay soars to new heights. Nestled amidst breathtaking cityscape views, our upscale establishment offers an unparalleled blend of luxury and comfort. Our rooms are elegantly appointed, featuring modern amenities and plush furnishings to ensure your relaxation.\n\nIndulge in culinary delights at our rooftop restaurant, offering a gastronomic journey with panoramic vistas. Skyworld Hotel boasts state-of-the-art conference facilities, perfect for business travelers, and an inviting spa for relaxation seekers. Our attentive staff is dedicated to ensuring your every need is met, making your stay memorable.\n\nCentrally located, we offer easy access to local attractions, making us an ideal choice for both leisure and business travelers. Experience the world of hospitality like never before at Skyworld Hotel.",
|
||||
"textSplitter": "",
|
||||
"usage": "perPage",
|
||||
"legacyBuild": "",
|
||||
"metadata": ""
|
||||
},
|
||||
"outputAnchors": [
|
||||
{
|
||||
"id": "pdfFile_0-output-pdfFile-Document",
|
||||
"name": "pdfFile",
|
||||
"label": "Document",
|
||||
"type": "Document"
|
||||
"name": "output",
|
||||
"label": "Output",
|
||||
"type": "options",
|
||||
"options": [
|
||||
{
|
||||
"id": "plainText_0-output-document-Document",
|
||||
"name": "document",
|
||||
"label": "Document",
|
||||
"type": "Document"
|
||||
},
|
||||
{
|
||||
"id": "plainText_0-output-text-string|json",
|
||||
"name": "text",
|
||||
"label": "Text",
|
||||
"type": "string | json"
|
||||
}
|
||||
],
|
||||
"default": "document"
|
||||
}
|
||||
],
|
||||
"outputs": {},
|
||||
"outputs": {
|
||||
"output": "text"
|
||||
},
|
||||
"selected": false
|
||||
},
|
||||
"selected": false,
|
||||
"positionAbsolute": {
|
||||
"x": 94.16886576108482,
|
||||
"y": 37.12056504707391
|
||||
"x": -487.7511991135089,
|
||||
"y": 77.83838996645807
|
||||
},
|
||||
"dragging": false
|
||||
}
|
||||
@@ -398,32 +474,31 @@
|
||||
"target": "conversationChain_0",
|
||||
"targetHandle": "conversationChain_0-input-memory-BaseMemory",
|
||||
"type": "buttonedge",
|
||||
"id": "bufferMemory_0-bufferMemory_0-output-bufferMemory-BufferMemory|BaseChatMemory|BaseMemory-conversationChain_0-conversationChain_0-input-memory-BaseMemory",
|
||||
"data": {
|
||||
"label": ""
|
||||
}
|
||||
"id": "bufferMemory_0-bufferMemory_0-output-bufferMemory-BufferMemory|BaseChatMemory|BaseMemory-conversationChain_0-conversationChain_0-input-memory-BaseMemory"
|
||||
},
|
||||
{
|
||||
"source": "chatAnthropic_0",
|
||||
"sourceHandle": "chatAnthropic_0-output-chatAnthropic-ChatAnthropic|BaseChatModel|BaseLanguageModel",
|
||||
"sourceHandle": "chatAnthropic_0-output-chatAnthropic-ChatAnthropic|BaseChatModel|BaseLanguageModel|Runnable",
|
||||
"target": "conversationChain_0",
|
||||
"targetHandle": "conversationChain_0-input-model-BaseChatModel",
|
||||
"type": "buttonedge",
|
||||
"id": "chatAnthropic_0-chatAnthropic_0-output-chatAnthropic-ChatAnthropic|BaseChatModel|BaseLanguageModel-conversationChain_0-conversationChain_0-input-model-BaseChatModel",
|
||||
"data": {
|
||||
"label": ""
|
||||
}
|
||||
"id": "chatAnthropic_0-chatAnthropic_0-output-chatAnthropic-ChatAnthropic|BaseChatModel|BaseLanguageModel|Runnable-conversationChain_0-conversationChain_0-input-model-BaseChatModel"
|
||||
},
|
||||
{
|
||||
"source": "pdfFile_0",
|
||||
"sourceHandle": "pdfFile_0-output-pdfFile-Document",
|
||||
"target": "conversationChain_0",
|
||||
"targetHandle": "conversationChain_0-input-document-Document",
|
||||
"source": "plainText_0",
|
||||
"sourceHandle": "plainText_0-output-text-string|json",
|
||||
"target": "chatPromptTemplate_0",
|
||||
"targetHandle": "chatPromptTemplate_0-input-promptValues-json",
|
||||
"type": "buttonedge",
|
||||
"id": "pdfFile_0-pdfFile_0-output-pdfFile-Document-conversationChain_0-conversationChain_0-input-document-Document",
|
||||
"data": {
|
||||
"label": ""
|
||||
}
|
||||
"id": "plainText_0-plainText_0-output-text-string|json-chatPromptTemplate_0-chatPromptTemplate_0-input-promptValues-json"
|
||||
},
|
||||
{
|
||||
"source": "chatPromptTemplate_0",
|
||||
"sourceHandle": "chatPromptTemplate_0-output-chatPromptTemplate-ChatPromptTemplate|BaseChatPromptTemplate|BasePromptTemplate|Runnable",
|
||||
"target": "conversationChain_0",
|
||||
"targetHandle": "conversationChain_0-input-chatPromptTemplate-ChatPromptTemplate",
|
||||
"type": "buttonedge",
|
||||
"id": "chatPromptTemplate_0-chatPromptTemplate_0-output-chatPromptTemplate-ChatPromptTemplate|BaseChatPromptTemplate|BasePromptTemplate|Runnable-conversationChain_0-conversationChain_0-input-chatPromptTemplate-ChatPromptTemplate"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -156,7 +156,7 @@
|
||||
"data": {
|
||||
"id": "chatOpenAI_0",
|
||||
"label": "ChatOpenAI",
|
||||
"version": 2,
|
||||
"version": 3,
|
||||
"name": "chatOpenAI",
|
||||
"type": "ChatOpenAI",
|
||||
"baseClasses": ["ChatOpenAI", "BaseChatModel", "BaseLanguageModel"],
|
||||
@@ -179,6 +179,22 @@
|
||||
"label": "gpt-4",
|
||||
"name": "gpt-4"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-turbo-preview",
|
||||
"name": "gpt-4-turbo-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-0125-preview",
|
||||
"name": "gpt-4-0125-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-1106-preview",
|
||||
"name": "gpt-4-1106-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-vision-preview",
|
||||
"name": "gpt-4-vision-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-0613",
|
||||
"name": "gpt-4-0613"
|
||||
@@ -195,6 +211,10 @@
|
||||
"label": "gpt-3.5-turbo",
|
||||
"name": "gpt-3.5-turbo"
|
||||
},
|
||||
{
|
||||
"label": "gpt-3.5-turbo-1106",
|
||||
"name": "gpt-3.5-turbo-1106"
|
||||
},
|
||||
{
|
||||
"label": "gpt-3.5-turbo-0613",
|
||||
"name": "gpt-3.5-turbo-0613"
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
"data": {
|
||||
"id": "openAIEmbeddings_0",
|
||||
"label": "OpenAI Embeddings",
|
||||
"version": 1,
|
||||
"version": 2,
|
||||
"name": "openAIEmbeddings",
|
||||
"type": "OpenAIEmbeddings",
|
||||
"baseClasses": ["OpenAIEmbeddings", "Embeddings"],
|
||||
@@ -28,6 +28,28 @@
|
||||
"credentialNames": ["openAIApi"],
|
||||
"id": "openAIEmbeddings_0-input-credential-credential"
|
||||
},
|
||||
{
|
||||
"label": "Model Name",
|
||||
"name": "modelName",
|
||||
"type": "options",
|
||||
"options": [
|
||||
{
|
||||
"label": "text-embedding-3-large",
|
||||
"name": "text-embedding-3-large"
|
||||
},
|
||||
{
|
||||
"label": "text-embedding-3-small",
|
||||
"name": "text-embedding-3-small"
|
||||
},
|
||||
{
|
||||
"label": "text-embedding-ada-002",
|
||||
"name": "text-embedding-ada-002"
|
||||
}
|
||||
],
|
||||
"default": "text-embedding-ada-002",
|
||||
"optional": true,
|
||||
"id": "openAIEmbeddings_0-input-modelName-options"
|
||||
},
|
||||
{
|
||||
"label": "Strip New Lines",
|
||||
"name": "stripNewLines",
|
||||
@@ -66,7 +88,8 @@
|
||||
"stripNewLines": "",
|
||||
"batchSize": "",
|
||||
"timeout": "",
|
||||
"basepath": ""
|
||||
"basepath": "",
|
||||
"modelName": "text-embedding-ada-002"
|
||||
},
|
||||
"outputAnchors": [
|
||||
{
|
||||
@@ -194,6 +217,13 @@
|
||||
"rows": 3,
|
||||
"placeholder": "Searches and returns documents regarding the state-of-the-union.",
|
||||
"id": "retrieverTool_0-input-description-string"
|
||||
},
|
||||
{
|
||||
"label": "Return Source Documents",
|
||||
"name": "returnSourceDocuments",
|
||||
"type": "boolean",
|
||||
"optional": true,
|
||||
"id": "retrieverTool_0-input-returnSourceDocuments-boolean"
|
||||
}
|
||||
],
|
||||
"inputAnchors": [
|
||||
@@ -207,7 +237,8 @@
|
||||
"inputs": {
|
||||
"name": "search_website",
|
||||
"description": "Searches and return documents regarding Jane - a culinary institution that offers top quality coffee, pastries, breakfast, lunch, and a variety of baked goods. They have multiple locations, including Jane on Fillmore, Jane on Larkin, Jane the Bakery, Toy Boat By Jane, and Little Jane on Grant. They emphasize healthy eating with a focus on flavor and quality ingredients. They bake everything in-house and work with local suppliers to source ingredients directly from farmers. They also offer catering services and delivery options.",
|
||||
"retriever": "{{pinecone_0.data.instance}}"
|
||||
"retriever": "{{pinecone_0.data.instance}}",
|
||||
"returnSourceDocuments": true
|
||||
},
|
||||
"outputAnchors": [
|
||||
{
|
||||
@@ -296,12 +327,12 @@
|
||||
"data": {
|
||||
"id": "pinecone_0",
|
||||
"label": "Pinecone",
|
||||
"version": 1,
|
||||
"version": 2,
|
||||
"name": "pinecone",
|
||||
"type": "Pinecone",
|
||||
"baseClasses": ["Pinecone", "VectorStoreRetriever", "BaseRetriever"],
|
||||
"category": "Vector Stores",
|
||||
"description": "Upsert embedded data and perform similarity search upon query using Pinecone, a leading fully managed hosted vector database",
|
||||
"description": "Upsert embedded data and perform similarity or mmr search using Pinecone, a leading fully managed hosted vector database",
|
||||
"inputParams": [
|
||||
{
|
||||
"label": "Connect Credential",
|
||||
@@ -342,6 +373,45 @@
|
||||
"additionalParams": true,
|
||||
"optional": true,
|
||||
"id": "pinecone_0-input-topK-number"
|
||||
},
|
||||
{
|
||||
"label": "Search Type",
|
||||
"name": "searchType",
|
||||
"type": "options",
|
||||
"default": "similarity",
|
||||
"options": [
|
||||
{
|
||||
"label": "Similarity",
|
||||
"name": "similarity"
|
||||
},
|
||||
{
|
||||
"label": "Max Marginal Relevance",
|
||||
"name": "mmr"
|
||||
}
|
||||
],
|
||||
"additionalParams": true,
|
||||
"optional": true,
|
||||
"id": "pinecone_0-input-searchType-options"
|
||||
},
|
||||
{
|
||||
"label": "Fetch K (for MMR Search)",
|
||||
"name": "fetchK",
|
||||
"description": "Number of initial documents to fetch for MMR reranking. Default to 20. Used only when the search type is MMR",
|
||||
"placeholder": "20",
|
||||
"type": "number",
|
||||
"additionalParams": true,
|
||||
"optional": true,
|
||||
"id": "pinecone_0-input-fetchK-number"
|
||||
},
|
||||
{
|
||||
"label": "Lambda (for MMR Search)",
|
||||
"name": "lambda",
|
||||
"description": "Number between 0 and 1 that determines the degree of diversity among the results, where 0 corresponds to maximum diversity and 1 to minimum diversity. Used only when the search type is MMR",
|
||||
"placeholder": "0.5",
|
||||
"type": "number",
|
||||
"additionalParams": true,
|
||||
"optional": true,
|
||||
"id": "pinecone_0-input-lambda-number"
|
||||
}
|
||||
],
|
||||
"inputAnchors": [
|
||||
@@ -366,7 +436,10 @@
|
||||
"pineconeIndex": "",
|
||||
"pineconeNamespace": "",
|
||||
"pineconeMetadataFilter": "",
|
||||
"topK": ""
|
||||
"topK": "",
|
||||
"searchType": "similarity",
|
||||
"fetchK": "",
|
||||
"lambda": ""
|
||||
},
|
||||
"outputAnchors": [
|
||||
{
|
||||
@@ -414,7 +487,7 @@
|
||||
"data": {
|
||||
"id": "chatOpenAI_0",
|
||||
"label": "ChatOpenAI",
|
||||
"version": 2,
|
||||
"version": 3,
|
||||
"name": "chatOpenAI",
|
||||
"type": "ChatOpenAI",
|
||||
"baseClasses": ["ChatOpenAI", "BaseChatModel", "BaseLanguageModel", "Runnable"],
|
||||
@@ -437,6 +510,14 @@
|
||||
"label": "gpt-4",
|
||||
"name": "gpt-4"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-turbo-preview",
|
||||
"name": "gpt-4-turbo-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-0125-preview",
|
||||
"name": "gpt-4-0125-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-1106-preview",
|
||||
"name": "gpt-4-1106-preview"
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
"data": {
|
||||
"id": "openAIEmbeddings_0",
|
||||
"label": "OpenAI Embeddings",
|
||||
"version": 1,
|
||||
"version": 2,
|
||||
"name": "openAIEmbeddings",
|
||||
"type": "OpenAIEmbeddings",
|
||||
"baseClasses": ["OpenAIEmbeddings", "Embeddings"],
|
||||
@@ -28,6 +28,28 @@
|
||||
"credentialNames": ["openAIApi"],
|
||||
"id": "openAIEmbeddings_0-input-credential-credential"
|
||||
},
|
||||
{
|
||||
"label": "Model Name",
|
||||
"name": "modelName",
|
||||
"type": "options",
|
||||
"options": [
|
||||
{
|
||||
"label": "text-embedding-3-large",
|
||||
"name": "text-embedding-3-large"
|
||||
},
|
||||
{
|
||||
"label": "text-embedding-3-small",
|
||||
"name": "text-embedding-3-small"
|
||||
},
|
||||
{
|
||||
"label": "text-embedding-ada-002",
|
||||
"name": "text-embedding-ada-002"
|
||||
}
|
||||
],
|
||||
"default": "text-embedding-ada-002",
|
||||
"optional": true,
|
||||
"id": "openAIEmbeddings_0-input-modelName-options"
|
||||
},
|
||||
{
|
||||
"label": "Strip New Lines",
|
||||
"name": "stripNewLines",
|
||||
@@ -66,7 +88,8 @@
|
||||
"stripNewLines": "",
|
||||
"batchSize": "",
|
||||
"timeout": "",
|
||||
"basepath": ""
|
||||
"basepath": "",
|
||||
"modelName": "text-embedding-ada-002"
|
||||
},
|
||||
"outputAnchors": [
|
||||
{
|
||||
@@ -346,7 +369,7 @@
|
||||
"data": {
|
||||
"id": "chatOpenAI_0",
|
||||
"label": "ChatOpenAI",
|
||||
"version": 2,
|
||||
"version": 3,
|
||||
"name": "chatOpenAI",
|
||||
"type": "ChatOpenAI",
|
||||
"baseClasses": ["ChatOpenAI", "BaseChatModel", "BaseLanguageModel", "Runnable"],
|
||||
@@ -369,6 +392,14 @@
|
||||
"label": "gpt-4",
|
||||
"name": "gpt-4"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-turbo-preview",
|
||||
"name": "gpt-4-turbo-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-0125-preview",
|
||||
"name": "gpt-4-0125-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-1106-preview",
|
||||
"name": "gpt-4-1106-preview"
|
||||
@@ -536,12 +567,12 @@
|
||||
"data": {
|
||||
"id": "pinecone_0",
|
||||
"label": "Pinecone",
|
||||
"version": 1,
|
||||
"version": 2,
|
||||
"name": "pinecone",
|
||||
"type": "Pinecone",
|
||||
"baseClasses": ["Pinecone", "VectorStoreRetriever", "BaseRetriever"],
|
||||
"category": "Vector Stores",
|
||||
"description": "Upsert embedded data and perform similarity search upon query using Pinecone, a leading fully managed hosted vector database",
|
||||
"description": "Upsert embedded data and perform similarity or mmr search using Pinecone, a leading fully managed hosted vector database",
|
||||
"inputParams": [
|
||||
{
|
||||
"label": "Connect Credential",
|
||||
@@ -582,6 +613,45 @@
|
||||
"additionalParams": true,
|
||||
"optional": true,
|
||||
"id": "pinecone_0-input-topK-number"
|
||||
},
|
||||
{
|
||||
"label": "Search Type",
|
||||
"name": "searchType",
|
||||
"type": "options",
|
||||
"default": "similarity",
|
||||
"options": [
|
||||
{
|
||||
"label": "Similarity",
|
||||
"name": "similarity"
|
||||
},
|
||||
{
|
||||
"label": "Max Marginal Relevance",
|
||||
"name": "mmr"
|
||||
}
|
||||
],
|
||||
"additionalParams": true,
|
||||
"optional": true,
|
||||
"id": "pinecone_0-input-searchType-options"
|
||||
},
|
||||
{
|
||||
"label": "Fetch K (for MMR Search)",
|
||||
"name": "fetchK",
|
||||
"description": "Number of initial documents to fetch for MMR reranking. Default to 20. Used only when the search type is MMR",
|
||||
"placeholder": "20",
|
||||
"type": "number",
|
||||
"additionalParams": true,
|
||||
"optional": true,
|
||||
"id": "pinecone_0-input-fetchK-number"
|
||||
},
|
||||
{
|
||||
"label": "Lambda (for MMR Search)",
|
||||
"name": "lambda",
|
||||
"description": "Number between 0 and 1 that determines the degree of diversity among the results, where 0 corresponds to maximum diversity and 1 to minimum diversity. Used only when the search type is MMR",
|
||||
"placeholder": "0.5",
|
||||
"type": "number",
|
||||
"additionalParams": true,
|
||||
"optional": true,
|
||||
"id": "pinecone_0-input-lambda-number"
|
||||
}
|
||||
],
|
||||
"inputAnchors": [
|
||||
@@ -606,7 +676,10 @@
|
||||
"pineconeIndex": "",
|
||||
"pineconeNamespace": "",
|
||||
"pineconeMetadataFilter": "",
|
||||
"topK": ""
|
||||
"topK": "",
|
||||
"searchType": "similarity",
|
||||
"fetchK": "",
|
||||
"lambda": ""
|
||||
},
|
||||
"outputAnchors": [
|
||||
{
|
||||
|
||||
@@ -376,7 +376,7 @@
|
||||
"id": "chatOpenAI_0",
|
||||
"label": "ChatOpenAI",
|
||||
"name": "chatOpenAI",
|
||||
"version": 2,
|
||||
"version": 3,
|
||||
"type": "ChatOpenAI",
|
||||
"baseClasses": ["ChatOpenAI", "BaseChatModel", "BaseLanguageModel"],
|
||||
"category": "Chat Models",
|
||||
@@ -398,6 +398,22 @@
|
||||
"label": "gpt-4",
|
||||
"name": "gpt-4"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-turbo-preview",
|
||||
"name": "gpt-4-turbo-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-0125-preview",
|
||||
"name": "gpt-4-0125-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-1106-preview",
|
||||
"name": "gpt-4-1106-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-vision-preview",
|
||||
"name": "gpt-4-vision-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-0613",
|
||||
"name": "gpt-4-0613"
|
||||
@@ -414,6 +430,10 @@
|
||||
"label": "gpt-3.5-turbo",
|
||||
"name": "gpt-3.5-turbo"
|
||||
},
|
||||
{
|
||||
"label": "gpt-3.5-turbo-1106",
|
||||
"name": "gpt-3.5-turbo-1106"
|
||||
},
|
||||
{
|
||||
"label": "gpt-3.5-turbo-0613",
|
||||
"name": "gpt-3.5-turbo-0613"
|
||||
@@ -547,7 +567,7 @@
|
||||
"id": "openAIEmbeddings_0",
|
||||
"label": "OpenAI Embeddings",
|
||||
"name": "openAIEmbeddings",
|
||||
"version": 1,
|
||||
"version": 2,
|
||||
"type": "OpenAIEmbeddings",
|
||||
"baseClasses": ["OpenAIEmbeddings", "Embeddings"],
|
||||
"category": "Embeddings",
|
||||
@@ -560,6 +580,28 @@
|
||||
"credentialNames": ["openAIApi"],
|
||||
"id": "openAIEmbeddings_0-input-credential-credential"
|
||||
},
|
||||
{
|
||||
"label": "Model Name",
|
||||
"name": "modelName",
|
||||
"type": "options",
|
||||
"options": [
|
||||
{
|
||||
"label": "text-embedding-3-large",
|
||||
"name": "text-embedding-3-large"
|
||||
},
|
||||
{
|
||||
"label": "text-embedding-3-small",
|
||||
"name": "text-embedding-3-small"
|
||||
},
|
||||
{
|
||||
"label": "text-embedding-ada-002",
|
||||
"name": "text-embedding-ada-002"
|
||||
}
|
||||
],
|
||||
"default": "text-embedding-ada-002",
|
||||
"optional": true,
|
||||
"id": "openAIEmbeddings_0-input-modelName-options"
|
||||
},
|
||||
{
|
||||
"label": "Strip New Lines",
|
||||
"name": "stripNewLines",
|
||||
@@ -598,7 +640,8 @@
|
||||
"stripNewLines": "",
|
||||
"batchSize": "",
|
||||
"timeout": "",
|
||||
"basepath": ""
|
||||
"basepath": "",
|
||||
"modelName": "text-embedding-ada-002"
|
||||
},
|
||||
"outputAnchors": [
|
||||
{
|
||||
|
||||
@@ -234,13 +234,23 @@
|
||||
"type": "BaseLLMOutputParser",
|
||||
"optional": true,
|
||||
"id": "llmChain_0-input-outputParser-BaseLLMOutputParser"
|
||||
},
|
||||
{
|
||||
"label": "Input Moderation",
|
||||
"description": "Detect text that could generate harmful output and prevent it from being sent to the language model",
|
||||
"name": "inputModeration",
|
||||
"type": "Moderation",
|
||||
"optional": true,
|
||||
"list": true,
|
||||
"id": "llmChain_0-input-inputModeration-Moderation"
|
||||
}
|
||||
],
|
||||
"inputs": {
|
||||
"model": "{{huggingFaceInference_LLMs_0.data.instance}}",
|
||||
"prompt": "{{promptTemplate_0.data.instance}}",
|
||||
"outputParser": "",
|
||||
"chainName": ""
|
||||
"chainName": "",
|
||||
"inputModeration": ""
|
||||
},
|
||||
"outputAnchors": [
|
||||
{
|
||||
|
||||
@@ -489,13 +489,23 @@
|
||||
"type": "BaseLLMOutputParser",
|
||||
"optional": true,
|
||||
"id": "llmChain_0-input-outputParser-BaseLLMOutputParser"
|
||||
},
|
||||
{
|
||||
"label": "Input Moderation",
|
||||
"description": "Detect text that could generate harmful output and prevent it from being sent to the language model",
|
||||
"name": "inputModeration",
|
||||
"type": "Moderation",
|
||||
"optional": true,
|
||||
"list": true,
|
||||
"id": "llmChain_0-input-inputModeration-Moderation"
|
||||
}
|
||||
],
|
||||
"inputs": {
|
||||
"model": "{{openAI_1.data.instance}}",
|
||||
"prompt": "{{promptTemplate_0.data.instance}}",
|
||||
"outputParser": "",
|
||||
"chainName": "FirstChain"
|
||||
"chainName": "FirstChain",
|
||||
"inputModeration": ""
|
||||
},
|
||||
"outputAnchors": [
|
||||
{
|
||||
@@ -578,13 +588,23 @@
|
||||
"type": "BaseLLMOutputParser",
|
||||
"optional": true,
|
||||
"id": "llmChain_1-input-outputParser-BaseLLMOutputParser"
|
||||
},
|
||||
{
|
||||
"label": "Input Moderation",
|
||||
"description": "Detect text that could generate harmful output and prevent it from being sent to the language model",
|
||||
"name": "inputModeration",
|
||||
"type": "Moderation",
|
||||
"optional": true,
|
||||
"list": true,
|
||||
"id": "llmChain_1-input-inputModeration-Moderation"
|
||||
}
|
||||
],
|
||||
"inputs": {
|
||||
"model": "{{openAI_2.data.instance}}",
|
||||
"prompt": "{{promptTemplate_1.data.instance}}",
|
||||
"outputParser": "",
|
||||
"chainName": "LastChain"
|
||||
"chainName": "LastChain",
|
||||
"inputModeration": ""
|
||||
},
|
||||
"outputAnchors": [
|
||||
{
|
||||
@@ -742,8 +762,8 @@
|
||||
"model": "{{chatOpenAI_0.data.instance}}",
|
||||
"prompt": "{{promptTemplate_2.data.instance}}",
|
||||
"outputParser": "",
|
||||
"inputModeration": "",
|
||||
"chainName": "FallbackChain"
|
||||
"chainName": "FallbackChain",
|
||||
"inputModeration": ""
|
||||
},
|
||||
"outputAnchors": [
|
||||
{
|
||||
@@ -888,7 +908,7 @@
|
||||
"data": {
|
||||
"id": "chatOpenAI_0",
|
||||
"label": "ChatOpenAI",
|
||||
"version": 2,
|
||||
"version": 3,
|
||||
"name": "chatOpenAI",
|
||||
"type": "ChatOpenAI",
|
||||
"baseClasses": ["ChatOpenAI", "BaseChatModel", "BaseLanguageModel", "Runnable"],
|
||||
@@ -911,6 +931,14 @@
|
||||
"label": "gpt-4",
|
||||
"name": "gpt-4"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-turbo-preview",
|
||||
"name": "gpt-4-turbo-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-0125-preview",
|
||||
"name": "gpt-4-0125-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-1106-preview",
|
||||
"name": "gpt-4-1106-preview"
|
||||
|
||||
@@ -289,13 +289,23 @@
|
||||
"type": "BaseLLMOutputParser",
|
||||
"optional": true,
|
||||
"id": "llmChain_0-input-outputParser-BaseLLMOutputParser"
|
||||
},
|
||||
{
|
||||
"label": "Input Moderation",
|
||||
"description": "Detect text that could generate harmful output and prevent it from being sent to the language model",
|
||||
"name": "inputModeration",
|
||||
"type": "Moderation",
|
||||
"optional": true,
|
||||
"list": true,
|
||||
"id": "llmChain_0-input-inputModeration-Moderation"
|
||||
}
|
||||
],
|
||||
"inputs": {
|
||||
"model": "{{replicate_0.data.instance}}",
|
||||
"prompt": "{{promptTemplate_0.data.instance}}",
|
||||
"outputParser": "",
|
||||
"chainName": ""
|
||||
"chainName": "",
|
||||
"inputModeration": ""
|
||||
},
|
||||
"outputAnchors": [
|
||||
{
|
||||
@@ -378,13 +388,23 @@
|
||||
"type": "BaseLLMOutputParser",
|
||||
"optional": true,
|
||||
"id": "llmChain_1-input-outputParser-BaseLLMOutputParser"
|
||||
},
|
||||
{
|
||||
"label": "Input Moderation",
|
||||
"description": "Detect text that could generate harmful output and prevent it from being sent to the language model",
|
||||
"name": "inputModeration",
|
||||
"type": "Moderation",
|
||||
"optional": true,
|
||||
"list": true,
|
||||
"id": "llmChain_1-input-inputModeration-Moderation"
|
||||
}
|
||||
],
|
||||
"inputs": {
|
||||
"model": "{{chatOpenAI_0.data.instance}}",
|
||||
"prompt": "{{promptTemplate_1.data.instance}}",
|
||||
"outputParser": "",
|
||||
"chainName": ""
|
||||
"chainName": "",
|
||||
"inputModeration": ""
|
||||
},
|
||||
"outputAnchors": [
|
||||
{
|
||||
@@ -432,7 +452,7 @@
|
||||
"data": {
|
||||
"id": "chatOpenAI_0",
|
||||
"label": "ChatOpenAI",
|
||||
"version": 2,
|
||||
"version": 3,
|
||||
"name": "chatOpenAI",
|
||||
"type": "ChatOpenAI",
|
||||
"baseClasses": ["ChatOpenAI", "BaseChatModel", "BaseLanguageModel", "Runnable"],
|
||||
@@ -455,6 +475,14 @@
|
||||
"label": "gpt-4",
|
||||
"name": "gpt-4"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-turbo-preview",
|
||||
"name": "gpt-4-turbo-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-0125-preview",
|
||||
"name": "gpt-4-0125-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-1106-preview",
|
||||
"name": "gpt-4-1106-preview"
|
||||
|
||||
@@ -164,7 +164,7 @@
|
||||
"data": {
|
||||
"id": "chatOpenAI_0",
|
||||
"label": "ChatOpenAI",
|
||||
"version": 2,
|
||||
"version": 3,
|
||||
"name": "chatOpenAI",
|
||||
"type": "ChatOpenAI",
|
||||
"baseClasses": ["ChatOpenAI", "BaseChatModel", "BaseLanguageModel", "Runnable"],
|
||||
@@ -187,6 +187,14 @@
|
||||
"label": "gpt-4",
|
||||
"name": "gpt-4"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-turbo-preview",
|
||||
"name": "gpt-4-turbo-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-0125-preview",
|
||||
"name": "gpt-4-0125-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-1106-preview",
|
||||
"name": "gpt-4-1106-preview"
|
||||
|
||||
@@ -49,13 +49,23 @@
|
||||
"type": "BaseLLMOutputParser",
|
||||
"optional": true,
|
||||
"id": "llmChain_0-input-outputParser-BaseLLMOutputParser"
|
||||
},
|
||||
{
|
||||
"label": "Input Moderation",
|
||||
"description": "Detect text that could generate harmful output and prevent it from being sent to the language model",
|
||||
"name": "inputModeration",
|
||||
"type": "Moderation",
|
||||
"optional": true,
|
||||
"list": true,
|
||||
"id": "llmChain_0-input-inputModeration-Moderation"
|
||||
}
|
||||
],
|
||||
"inputs": {
|
||||
"model": "{{chatOpenAI_0.data.instance}}",
|
||||
"prompt": "{{promptTemplate_0.data.instance}}",
|
||||
"outputParser": "{{csvOutputParser_0.data.instance}}",
|
||||
"chainName": ""
|
||||
"chainName": "",
|
||||
"inputModeration": ""
|
||||
},
|
||||
"outputAnchors": [
|
||||
{
|
||||
@@ -213,7 +223,7 @@
|
||||
"data": {
|
||||
"id": "chatOpenAI_0",
|
||||
"label": "ChatOpenAI",
|
||||
"version": 2,
|
||||
"version": 3,
|
||||
"name": "chatOpenAI",
|
||||
"type": "ChatOpenAI",
|
||||
"baseClasses": ["ChatOpenAI", "BaseChatModel", "BaseLanguageModel", "Runnable"],
|
||||
@@ -236,6 +246,22 @@
|
||||
"label": "gpt-4",
|
||||
"name": "gpt-4"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-turbo-preview",
|
||||
"name": "gpt-4-turbo-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-0125-preview",
|
||||
"name": "gpt-4-0125-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-1106-preview",
|
||||
"name": "gpt-4-1106-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-vision-preview",
|
||||
"name": "gpt-4-vision-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-0613",
|
||||
"name": "gpt-4-0613"
|
||||
@@ -252,6 +278,10 @@
|
||||
"label": "gpt-3.5-turbo",
|
||||
"name": "gpt-3.5-turbo"
|
||||
},
|
||||
{
|
||||
"label": "gpt-3.5-turbo-1106",
|
||||
"name": "gpt-3.5-turbo-1106"
|
||||
},
|
||||
{
|
||||
"label": "gpt-3.5-turbo-0613",
|
||||
"name": "gpt-3.5-turbo-0613"
|
||||
|
||||
@@ -112,7 +112,7 @@
|
||||
"data": {
|
||||
"id": "openAIEmbeddings_0",
|
||||
"label": "OpenAI Embeddings",
|
||||
"version": 1,
|
||||
"version": 2,
|
||||
"name": "openAIEmbeddings",
|
||||
"type": "OpenAIEmbeddings",
|
||||
"baseClasses": ["OpenAIEmbeddings", "Embeddings"],
|
||||
@@ -126,6 +126,28 @@
|
||||
"credentialNames": ["openAIApi"],
|
||||
"id": "openAIEmbeddings_0-input-credential-credential"
|
||||
},
|
||||
{
|
||||
"label": "Model Name",
|
||||
"name": "modelName",
|
||||
"type": "options",
|
||||
"options": [
|
||||
{
|
||||
"label": "text-embedding-3-large",
|
||||
"name": "text-embedding-3-large"
|
||||
},
|
||||
{
|
||||
"label": "text-embedding-3-small",
|
||||
"name": "text-embedding-3-small"
|
||||
},
|
||||
{
|
||||
"label": "text-embedding-ada-002",
|
||||
"name": "text-embedding-ada-002"
|
||||
}
|
||||
],
|
||||
"default": "text-embedding-ada-002",
|
||||
"optional": true,
|
||||
"id": "openAIEmbeddings_0-input-modelName-options"
|
||||
},
|
||||
{
|
||||
"label": "Strip New Lines",
|
||||
"name": "stripNewLines",
|
||||
@@ -164,7 +186,8 @@
|
||||
"stripNewLines": "",
|
||||
"batchSize": "",
|
||||
"timeout": "",
|
||||
"basepath": ""
|
||||
"basepath": "",
|
||||
"modelName": "text-embedding-ada-002"
|
||||
},
|
||||
"outputAnchors": [
|
||||
{
|
||||
@@ -483,7 +506,7 @@
|
||||
"data": {
|
||||
"id": "chatOpenAI_0",
|
||||
"label": "ChatOpenAI",
|
||||
"version": 2,
|
||||
"version": 3,
|
||||
"name": "chatOpenAI",
|
||||
"type": "ChatOpenAI",
|
||||
"baseClasses": ["ChatOpenAI", "BaseChatModel", "BaseLanguageModel", "Runnable"],
|
||||
@@ -506,6 +529,14 @@
|
||||
"label": "gpt-4",
|
||||
"name": "gpt-4"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-turbo-preview",
|
||||
"name": "gpt-4-turbo-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-0125-preview",
|
||||
"name": "gpt-4-0125-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-1106-preview",
|
||||
"name": "gpt-4-1106-preview"
|
||||
|
||||
@@ -346,7 +346,7 @@
|
||||
"data": {
|
||||
"id": "openAIEmbeddings_0",
|
||||
"label": "OpenAI Embeddings",
|
||||
"version": 1,
|
||||
"version": 2,
|
||||
"name": "openAIEmbeddings",
|
||||
"type": "OpenAIEmbeddings",
|
||||
"baseClasses": ["OpenAIEmbeddings", "Embeddings"],
|
||||
@@ -360,6 +360,28 @@
|
||||
"credentialNames": ["openAIApi"],
|
||||
"id": "openAIEmbeddings_0-input-credential-credential"
|
||||
},
|
||||
{
|
||||
"label": "Model Name",
|
||||
"name": "modelName",
|
||||
"type": "options",
|
||||
"options": [
|
||||
{
|
||||
"label": "text-embedding-3-large",
|
||||
"name": "text-embedding-3-large"
|
||||
},
|
||||
{
|
||||
"label": "text-embedding-3-small",
|
||||
"name": "text-embedding-3-small"
|
||||
},
|
||||
{
|
||||
"label": "text-embedding-ada-002",
|
||||
"name": "text-embedding-ada-002"
|
||||
}
|
||||
],
|
||||
"default": "text-embedding-ada-002",
|
||||
"optional": true,
|
||||
"id": "openAIEmbeddings_0-input-modelName-options"
|
||||
},
|
||||
{
|
||||
"label": "Strip New Lines",
|
||||
"name": "stripNewLines",
|
||||
@@ -398,7 +420,8 @@
|
||||
"stripNewLines": "",
|
||||
"batchSize": "",
|
||||
"timeout": "",
|
||||
"basepath": ""
|
||||
"basepath": "",
|
||||
"modelName": "text-embedding-ada-002"
|
||||
},
|
||||
"outputAnchors": [
|
||||
{
|
||||
@@ -430,7 +453,7 @@
|
||||
"data": {
|
||||
"id": "chatOpenAI_0",
|
||||
"label": "ChatOpenAI",
|
||||
"version": 2,
|
||||
"version": 3,
|
||||
"name": "chatOpenAI",
|
||||
"type": "ChatOpenAI",
|
||||
"baseClasses": ["ChatOpenAI", "BaseChatModel", "BaseLanguageModel", "Runnable"],
|
||||
@@ -453,6 +476,14 @@
|
||||
"label": "gpt-4",
|
||||
"name": "gpt-4"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-turbo-preview",
|
||||
"name": "gpt-4-turbo-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-0125-preview",
|
||||
"name": "gpt-4-0125-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-1106-preview",
|
||||
"name": "gpt-4-1106-preview"
|
||||
@@ -620,12 +651,12 @@
|
||||
"data": {
|
||||
"id": "pinecone_0",
|
||||
"label": "Pinecone",
|
||||
"version": 1,
|
||||
"version": 2,
|
||||
"name": "pinecone",
|
||||
"type": "Pinecone",
|
||||
"baseClasses": ["Pinecone", "VectorStoreRetriever", "BaseRetriever"],
|
||||
"category": "Vector Stores",
|
||||
"description": "Upsert embedded data and perform similarity search upon query using Pinecone, a leading fully managed hosted vector database",
|
||||
"description": "Upsert embedded data and perform similarity or mmr search using Pinecone, a leading fully managed hosted vector database",
|
||||
"inputParams": [
|
||||
{
|
||||
"label": "Connect Credential",
|
||||
@@ -666,6 +697,45 @@
|
||||
"additionalParams": true,
|
||||
"optional": true,
|
||||
"id": "pinecone_0-input-topK-number"
|
||||
},
|
||||
{
|
||||
"label": "Search Type",
|
||||
"name": "searchType",
|
||||
"type": "options",
|
||||
"default": "similarity",
|
||||
"options": [
|
||||
{
|
||||
"label": "Similarity",
|
||||
"name": "similarity"
|
||||
},
|
||||
{
|
||||
"label": "Max Marginal Relevance",
|
||||
"name": "mmr"
|
||||
}
|
||||
],
|
||||
"additionalParams": true,
|
||||
"optional": true,
|
||||
"id": "pinecone_0-input-searchType-options"
|
||||
},
|
||||
{
|
||||
"label": "Fetch K (for MMR Search)",
|
||||
"name": "fetchK",
|
||||
"description": "Number of initial documents to fetch for MMR reranking. Default to 20. Used only when the search type is MMR",
|
||||
"placeholder": "20",
|
||||
"type": "number",
|
||||
"additionalParams": true,
|
||||
"optional": true,
|
||||
"id": "pinecone_0-input-fetchK-number"
|
||||
},
|
||||
{
|
||||
"label": "Lambda (for MMR Search)",
|
||||
"name": "lambda",
|
||||
"description": "Number between 0 and 1 that determines the degree of diversity among the results, where 0 corresponds to maximum diversity and 1 to minimum diversity. Used only when the search type is MMR",
|
||||
"placeholder": "0.5",
|
||||
"type": "number",
|
||||
"additionalParams": true,
|
||||
"optional": true,
|
||||
"id": "pinecone_0-input-lambda-number"
|
||||
}
|
||||
],
|
||||
"inputAnchors": [
|
||||
@@ -690,7 +760,10 @@
|
||||
"pineconeIndex": "",
|
||||
"pineconeNamespace": "",
|
||||
"pineconeMetadataFilter": "{\"id\":{\"$in\":[\"doc1\",\"doc2\"]}}",
|
||||
"topK": ""
|
||||
"topK": "",
|
||||
"searchType": "similarity",
|
||||
"fetchK": "",
|
||||
"lambda": ""
|
||||
},
|
||||
"outputAnchors": [
|
||||
{
|
||||
|
||||
@@ -278,7 +278,7 @@
|
||||
"id": "chatOpenAI_0",
|
||||
"label": "ChatOpenAI",
|
||||
"name": "chatOpenAI",
|
||||
"version": 2,
|
||||
"version": 3,
|
||||
"type": "ChatOpenAI",
|
||||
"baseClasses": ["ChatOpenAI", "BaseChatModel", "BaseLanguageModel"],
|
||||
"category": "Chat Models",
|
||||
@@ -300,6 +300,22 @@
|
||||
"label": "gpt-4",
|
||||
"name": "gpt-4"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-turbo-preview",
|
||||
"name": "gpt-4-turbo-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-0125-preview",
|
||||
"name": "gpt-4-0125-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-1106-preview",
|
||||
"name": "gpt-4-1106-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-vision-preview",
|
||||
"name": "gpt-4-vision-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-0613",
|
||||
"name": "gpt-4-0613"
|
||||
@@ -316,6 +332,10 @@
|
||||
"label": "gpt-3.5-turbo",
|
||||
"name": "gpt-3.5-turbo"
|
||||
},
|
||||
{
|
||||
"label": "gpt-3.5-turbo-1106",
|
||||
"name": "gpt-3.5-turbo-1106"
|
||||
},
|
||||
{
|
||||
"label": "gpt-3.5-turbo-0613",
|
||||
"name": "gpt-3.5-turbo-0613"
|
||||
|
||||
@@ -281,7 +281,7 @@
|
||||
"data": {
|
||||
"id": "openAIEmbeddings_0",
|
||||
"label": "OpenAI Embeddings",
|
||||
"version": 1,
|
||||
"version": 2,
|
||||
"name": "openAIEmbeddings",
|
||||
"type": "OpenAIEmbeddings",
|
||||
"baseClasses": ["OpenAIEmbeddings", "Embeddings"],
|
||||
@@ -295,6 +295,28 @@
|
||||
"credentialNames": ["openAIApi"],
|
||||
"id": "openAIEmbeddings_0-input-credential-credential"
|
||||
},
|
||||
{
|
||||
"label": "Model Name",
|
||||
"name": "modelName",
|
||||
"type": "options",
|
||||
"options": [
|
||||
{
|
||||
"label": "text-embedding-3-large",
|
||||
"name": "text-embedding-3-large"
|
||||
},
|
||||
{
|
||||
"label": "text-embedding-3-small",
|
||||
"name": "text-embedding-3-small"
|
||||
},
|
||||
{
|
||||
"label": "text-embedding-ada-002",
|
||||
"name": "text-embedding-ada-002"
|
||||
}
|
||||
],
|
||||
"default": "text-embedding-ada-002",
|
||||
"optional": true,
|
||||
"id": "openAIEmbeddings_0-input-modelName-options"
|
||||
},
|
||||
{
|
||||
"label": "Strip New Lines",
|
||||
"name": "stripNewLines",
|
||||
@@ -333,7 +355,8 @@
|
||||
"stripNewLines": "",
|
||||
"batchSize": "",
|
||||
"timeout": "",
|
||||
"basepath": ""
|
||||
"basepath": "",
|
||||
"modelName": "text-embedding-ada-002"
|
||||
},
|
||||
"outputAnchors": [
|
||||
{
|
||||
@@ -365,7 +388,7 @@
|
||||
"data": {
|
||||
"id": "chatOpenAI_0",
|
||||
"label": "ChatOpenAI",
|
||||
"version": 2,
|
||||
"version": 3,
|
||||
"name": "chatOpenAI",
|
||||
"type": "ChatOpenAI",
|
||||
"baseClasses": ["ChatOpenAI", "BaseChatModel", "BaseLanguageModel", "Runnable"],
|
||||
@@ -388,6 +411,14 @@
|
||||
"label": "gpt-4",
|
||||
"name": "gpt-4"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-turbo-preview",
|
||||
"name": "gpt-4-turbo-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-0125-preview",
|
||||
"name": "gpt-4-0125-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-1106-preview",
|
||||
"name": "gpt-4-1106-preview"
|
||||
@@ -555,12 +586,12 @@
|
||||
"data": {
|
||||
"id": "pinecone_0",
|
||||
"label": "Pinecone",
|
||||
"version": 1,
|
||||
"version": 2,
|
||||
"name": "pinecone",
|
||||
"type": "Pinecone",
|
||||
"baseClasses": ["Pinecone", "VectorStoreRetriever", "BaseRetriever"],
|
||||
"category": "Vector Stores",
|
||||
"description": "Upsert embedded data and perform similarity search upon query using Pinecone, a leading fully managed hosted vector database",
|
||||
"description": "Upsert embedded data and perform similarity or mmr search using Pinecone, a leading fully managed hosted vector database",
|
||||
"inputParams": [
|
||||
{
|
||||
"label": "Connect Credential",
|
||||
@@ -601,6 +632,45 @@
|
||||
"additionalParams": true,
|
||||
"optional": true,
|
||||
"id": "pinecone_0-input-topK-number"
|
||||
},
|
||||
{
|
||||
"label": "Search Type",
|
||||
"name": "searchType",
|
||||
"type": "options",
|
||||
"default": "similarity",
|
||||
"options": [
|
||||
{
|
||||
"label": "Similarity",
|
||||
"name": "similarity"
|
||||
},
|
||||
{
|
||||
"label": "Max Marginal Relevance",
|
||||
"name": "mmr"
|
||||
}
|
||||
],
|
||||
"additionalParams": true,
|
||||
"optional": true,
|
||||
"id": "pinecone_0-input-searchType-options"
|
||||
},
|
||||
{
|
||||
"label": "Fetch K (for MMR Search)",
|
||||
"name": "fetchK",
|
||||
"description": "Number of initial documents to fetch for MMR reranking. Default to 20. Used only when the search type is MMR",
|
||||
"placeholder": "20",
|
||||
"type": "number",
|
||||
"additionalParams": true,
|
||||
"optional": true,
|
||||
"id": "pinecone_0-input-fetchK-number"
|
||||
},
|
||||
{
|
||||
"label": "Lambda (for MMR Search)",
|
||||
"name": "lambda",
|
||||
"description": "Number between 0 and 1 that determines the degree of diversity among the results, where 0 corresponds to maximum diversity and 1 to minimum diversity. Used only when the search type is MMR",
|
||||
"placeholder": "0.5",
|
||||
"type": "number",
|
||||
"additionalParams": true,
|
||||
"optional": true,
|
||||
"id": "pinecone_0-input-lambda-number"
|
||||
}
|
||||
],
|
||||
"inputAnchors": [
|
||||
@@ -625,7 +695,10 @@
|
||||
"pineconeIndex": "",
|
||||
"pineconeNamespace": "",
|
||||
"pineconeMetadataFilter": "",
|
||||
"topK": ""
|
||||
"topK": "",
|
||||
"searchType": "similarity",
|
||||
"fetchK": "",
|
||||
"lambda": ""
|
||||
},
|
||||
"outputAnchors": [
|
||||
{
|
||||
@@ -840,6 +913,45 @@
|
||||
"additionalParams": true,
|
||||
"optional": true,
|
||||
"id": "supabase_0-input-topK-number"
|
||||
},
|
||||
{
|
||||
"label": "Search Type",
|
||||
"name": "searchType",
|
||||
"type": "options",
|
||||
"default": "similarity",
|
||||
"options": [
|
||||
{
|
||||
"label": "Similarity",
|
||||
"name": "similarity"
|
||||
},
|
||||
{
|
||||
"label": "Max Marginal Relevance",
|
||||
"name": "mmr"
|
||||
}
|
||||
],
|
||||
"additionalParams": true,
|
||||
"optional": true,
|
||||
"id": "pinecone_0-input-searchType-options"
|
||||
},
|
||||
{
|
||||
"label": "Fetch K (for MMR Search)",
|
||||
"name": "fetchK",
|
||||
"description": "Number of initial documents to fetch for MMR reranking. Default to 20. Used only when the search type is MMR",
|
||||
"placeholder": "20",
|
||||
"type": "number",
|
||||
"additionalParams": true,
|
||||
"optional": true,
|
||||
"id": "pinecone_0-input-fetchK-number"
|
||||
},
|
||||
{
|
||||
"label": "Lambda (for MMR Search)",
|
||||
"name": "lambda",
|
||||
"description": "Number between 0 and 1 that determines the degree of diversity among the results, where 0 corresponds to maximum diversity and 1 to minimum diversity. Used only when the search type is MMR",
|
||||
"placeholder": "0.5",
|
||||
"type": "number",
|
||||
"additionalParams": true,
|
||||
"optional": true,
|
||||
"id": "pinecone_0-input-lambda-number"
|
||||
}
|
||||
],
|
||||
"inputAnchors": [
|
||||
@@ -865,7 +977,10 @@
|
||||
"tableName": "",
|
||||
"queryName": "",
|
||||
"supabaseMetadataFilter": "",
|
||||
"topK": ""
|
||||
"topK": "",
|
||||
"searchType": "similarity",
|
||||
"fetchK": "",
|
||||
"lambda": ""
|
||||
},
|
||||
"outputAnchors": [
|
||||
{
|
||||
|
||||
@@ -271,7 +271,7 @@
|
||||
"data": {
|
||||
"id": "openAIEmbeddings_1",
|
||||
"label": "OpenAI Embeddings",
|
||||
"version": 1,
|
||||
"version": 2,
|
||||
"name": "openAIEmbeddings",
|
||||
"type": "OpenAIEmbeddings",
|
||||
"baseClasses": ["OpenAIEmbeddings", "Embeddings"],
|
||||
@@ -285,6 +285,28 @@
|
||||
"credentialNames": ["openAIApi"],
|
||||
"id": "openAIEmbeddings_1-input-credential-credential"
|
||||
},
|
||||
{
|
||||
"label": "Model Name",
|
||||
"name": "modelName",
|
||||
"type": "options",
|
||||
"options": [
|
||||
{
|
||||
"label": "text-embedding-3-large",
|
||||
"name": "text-embedding-3-large"
|
||||
},
|
||||
{
|
||||
"label": "text-embedding-3-small",
|
||||
"name": "text-embedding-3-small"
|
||||
},
|
||||
{
|
||||
"label": "text-embedding-ada-002",
|
||||
"name": "text-embedding-ada-002"
|
||||
}
|
||||
],
|
||||
"default": "text-embedding-ada-002",
|
||||
"optional": true,
|
||||
"id": "openAIEmbeddings_1-input-modelName-options"
|
||||
},
|
||||
{
|
||||
"label": "Strip New Lines",
|
||||
"name": "stripNewLines",
|
||||
@@ -323,7 +345,8 @@
|
||||
"stripNewLines": "",
|
||||
"batchSize": "",
|
||||
"timeout": "",
|
||||
"basepath": ""
|
||||
"basepath": "",
|
||||
"modelName": "text-embedding-ada-002"
|
||||
},
|
||||
"outputAnchors": [
|
||||
{
|
||||
@@ -355,7 +378,7 @@
|
||||
"data": {
|
||||
"id": "openAIEmbeddings_2",
|
||||
"label": "OpenAI Embeddings",
|
||||
"version": 1,
|
||||
"version": 2,
|
||||
"name": "openAIEmbeddings",
|
||||
"type": "OpenAIEmbeddings",
|
||||
"baseClasses": ["OpenAIEmbeddings", "Embeddings"],
|
||||
@@ -369,6 +392,28 @@
|
||||
"credentialNames": ["openAIApi"],
|
||||
"id": "openAIEmbeddings_2-input-credential-credential"
|
||||
},
|
||||
{
|
||||
"label": "Model Name",
|
||||
"name": "modelName",
|
||||
"type": "options",
|
||||
"options": [
|
||||
{
|
||||
"label": "text-embedding-3-large",
|
||||
"name": "text-embedding-3-large"
|
||||
},
|
||||
{
|
||||
"label": "text-embedding-3-small",
|
||||
"name": "text-embedding-3-small"
|
||||
},
|
||||
{
|
||||
"label": "text-embedding-ada-002",
|
||||
"name": "text-embedding-ada-002"
|
||||
}
|
||||
],
|
||||
"default": "text-embedding-ada-002",
|
||||
"optional": true,
|
||||
"id": "openAIEmbeddings_2-input-modelName-options"
|
||||
},
|
||||
{
|
||||
"label": "Strip New Lines",
|
||||
"name": "stripNewLines",
|
||||
@@ -407,7 +452,8 @@
|
||||
"stripNewLines": "",
|
||||
"batchSize": "",
|
||||
"timeout": "",
|
||||
"basepath": ""
|
||||
"basepath": "",
|
||||
"modelName": "text-embedding-ada-002"
|
||||
},
|
||||
"outputAnchors": [
|
||||
{
|
||||
@@ -439,7 +485,7 @@
|
||||
"data": {
|
||||
"id": "chatOpenAI_0",
|
||||
"label": "ChatOpenAI",
|
||||
"version": 2,
|
||||
"version": 3,
|
||||
"name": "chatOpenAI",
|
||||
"type": "ChatOpenAI",
|
||||
"baseClasses": ["ChatOpenAI", "BaseChatModel", "BaseLanguageModel", "Runnable"],
|
||||
@@ -462,6 +508,14 @@
|
||||
"label": "gpt-4",
|
||||
"name": "gpt-4"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-turbo-preview",
|
||||
"name": "gpt-4-turbo-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-0125-preview",
|
||||
"name": "gpt-4-0125-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-1106-preview",
|
||||
"name": "gpt-4-1106-preview"
|
||||
@@ -949,7 +1003,7 @@
|
||||
"data": {
|
||||
"id": "chatOpenAI_1",
|
||||
"label": "ChatOpenAI",
|
||||
"version": 2,
|
||||
"version": 3,
|
||||
"name": "chatOpenAI",
|
||||
"type": "ChatOpenAI",
|
||||
"baseClasses": ["ChatOpenAI", "BaseChatModel", "BaseLanguageModel", "Runnable"],
|
||||
@@ -972,6 +1026,14 @@
|
||||
"label": "gpt-4",
|
||||
"name": "gpt-4"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-turbo-preview",
|
||||
"name": "gpt-4-turbo-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-0125-preview",
|
||||
"name": "gpt-4-0125-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-1106-preview",
|
||||
"name": "gpt-4-1106-preview"
|
||||
@@ -1139,7 +1201,7 @@
|
||||
"data": {
|
||||
"id": "chatOpenAI_2",
|
||||
"label": "ChatOpenAI",
|
||||
"version": 2,
|
||||
"version": 3,
|
||||
"name": "chatOpenAI",
|
||||
"type": "ChatOpenAI",
|
||||
"baseClasses": ["ChatOpenAI", "BaseChatModel", "BaseLanguageModel", "Runnable"],
|
||||
@@ -1162,6 +1224,14 @@
|
||||
"label": "gpt-4",
|
||||
"name": "gpt-4"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-turbo-preview",
|
||||
"name": "gpt-4-turbo-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-0125-preview",
|
||||
"name": "gpt-4-0125-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-1106-preview",
|
||||
"name": "gpt-4-1106-preview"
|
||||
|
||||
@@ -279,7 +279,7 @@
|
||||
"data": {
|
||||
"id": "chatOpenAI_0",
|
||||
"label": "ChatOpenAI",
|
||||
"version": 2,
|
||||
"version": 3,
|
||||
"name": "chatOpenAI",
|
||||
"type": "ChatOpenAI",
|
||||
"baseClasses": ["ChatOpenAI", "BaseChatModel", "BaseLanguageModel"],
|
||||
@@ -302,6 +302,22 @@
|
||||
"label": "gpt-4",
|
||||
"name": "gpt-4"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-turbo-preview",
|
||||
"name": "gpt-4-turbo-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-0125-preview",
|
||||
"name": "gpt-4-0125-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-1106-preview",
|
||||
"name": "gpt-4-1106-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-vision-preview",
|
||||
"name": "gpt-4-vision-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-0613",
|
||||
"name": "gpt-4-0613"
|
||||
@@ -318,6 +334,10 @@
|
||||
"label": "gpt-3.5-turbo",
|
||||
"name": "gpt-3.5-turbo"
|
||||
},
|
||||
{
|
||||
"label": "gpt-3.5-turbo-1106",
|
||||
"name": "gpt-3.5-turbo-1106"
|
||||
},
|
||||
{
|
||||
"label": "gpt-3.5-turbo-0613",
|
||||
"name": "gpt-3.5-turbo-0613"
|
||||
|
||||
@@ -190,10 +190,10 @@
|
||||
"type": "options",
|
||||
"options": [
|
||||
{
|
||||
"id": "vectorStoreToDocument_0-output-document-Document",
|
||||
"id": "vectorStoreToDocument_0-output-document-Document|json",
|
||||
"name": "document",
|
||||
"label": "Document",
|
||||
"type": "Document"
|
||||
"type": "Document | json"
|
||||
},
|
||||
{
|
||||
"id": "vectorStoreToDocument_0-output-text-string|json",
|
||||
@@ -264,13 +264,23 @@
|
||||
"type": "BaseLLMOutputParser",
|
||||
"optional": true,
|
||||
"id": "llmChain_2-input-outputParser-BaseLLMOutputParser"
|
||||
},
|
||||
{
|
||||
"label": "Input Moderation",
|
||||
"description": "Detect text that could generate harmful output and prevent it from being sent to the language model",
|
||||
"name": "inputModeration",
|
||||
"type": "Moderation",
|
||||
"optional": true,
|
||||
"list": true,
|
||||
"id": "llmChain_2-input-inputModeration-Moderation"
|
||||
}
|
||||
],
|
||||
"inputs": {
|
||||
"model": "{{chatOpenAI_0.data.instance}}",
|
||||
"prompt": "{{promptTemplate_0.data.instance}}",
|
||||
"outputParser": "",
|
||||
"chainName": "RephraseQuestion"
|
||||
"chainName": "RephraseQuestion",
|
||||
"inputModeration": ""
|
||||
},
|
||||
"outputAnchors": [
|
||||
{
|
||||
@@ -353,13 +363,23 @@
|
||||
"type": "BaseLLMOutputParser",
|
||||
"optional": true,
|
||||
"id": "llmChain_1-input-outputParser-BaseLLMOutputParser"
|
||||
},
|
||||
{
|
||||
"label": "Input Moderation",
|
||||
"description": "Detect text that could generate harmful output and prevent it from being sent to the language model",
|
||||
"name": "inputModeration",
|
||||
"type": "Moderation",
|
||||
"optional": true,
|
||||
"list": true,
|
||||
"id": "llmChain_1-input-inputModeration-Moderation"
|
||||
}
|
||||
],
|
||||
"inputs": {
|
||||
"model": "{{chatOpenAI_1.data.instance}}",
|
||||
"prompt": "{{chatPromptTemplate_0.data.instance}}",
|
||||
"outputParser": "",
|
||||
"chainName": "FinalResponse"
|
||||
"chainName": "FinalResponse",
|
||||
"inputModeration": ""
|
||||
},
|
||||
"outputAnchors": [
|
||||
{
|
||||
@@ -407,7 +427,7 @@
|
||||
"data": {
|
||||
"id": "chatOpenAI_0",
|
||||
"label": "ChatOpenAI",
|
||||
"version": 2,
|
||||
"version": 3,
|
||||
"name": "chatOpenAI",
|
||||
"type": "ChatOpenAI",
|
||||
"baseClasses": ["ChatOpenAI", "BaseChatModel", "BaseLanguageModel", "Runnable"],
|
||||
@@ -430,6 +450,14 @@
|
||||
"label": "gpt-4",
|
||||
"name": "gpt-4"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-turbo-preview",
|
||||
"name": "gpt-4-turbo-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-0125-preview",
|
||||
"name": "gpt-4-0125-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-1106-preview",
|
||||
"name": "gpt-4-1106-preview"
|
||||
@@ -597,7 +625,7 @@
|
||||
"data": {
|
||||
"id": "chatOpenAI_1",
|
||||
"label": "ChatOpenAI",
|
||||
"version": 2,
|
||||
"version": 3,
|
||||
"name": "chatOpenAI",
|
||||
"type": "ChatOpenAI",
|
||||
"baseClasses": ["ChatOpenAI", "BaseChatModel", "BaseLanguageModel", "Runnable"],
|
||||
@@ -620,6 +648,14 @@
|
||||
"label": "gpt-4",
|
||||
"name": "gpt-4"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-turbo-preview",
|
||||
"name": "gpt-4-turbo-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-0125-preview",
|
||||
"name": "gpt-4-0125-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-1106-preview",
|
||||
"name": "gpt-4-1106-preview"
|
||||
@@ -934,7 +970,7 @@
|
||||
"data": {
|
||||
"id": "openAIEmbeddings_0",
|
||||
"label": "OpenAI Embeddings",
|
||||
"version": 1,
|
||||
"version": 2,
|
||||
"name": "openAIEmbeddings",
|
||||
"type": "OpenAIEmbeddings",
|
||||
"baseClasses": ["OpenAIEmbeddings", "Embeddings"],
|
||||
@@ -948,6 +984,28 @@
|
||||
"credentialNames": ["openAIApi"],
|
||||
"id": "openAIEmbeddings_0-input-credential-credential"
|
||||
},
|
||||
{
|
||||
"label": "Model Name",
|
||||
"name": "modelName",
|
||||
"type": "options",
|
||||
"options": [
|
||||
{
|
||||
"label": "text-embedding-3-large",
|
||||
"name": "text-embedding-3-large"
|
||||
},
|
||||
{
|
||||
"label": "text-embedding-3-small",
|
||||
"name": "text-embedding-3-small"
|
||||
},
|
||||
{
|
||||
"label": "text-embedding-ada-002",
|
||||
"name": "text-embedding-ada-002"
|
||||
}
|
||||
],
|
||||
"default": "text-embedding-ada-002",
|
||||
"optional": true,
|
||||
"id": "openAIEmbeddings_0-input-modelName-options"
|
||||
},
|
||||
{
|
||||
"label": "Strip New Lines",
|
||||
"name": "stripNewLines",
|
||||
@@ -986,7 +1044,8 @@
|
||||
"stripNewLines": "",
|
||||
"batchSize": "",
|
||||
"timeout": "",
|
||||
"basepath": ""
|
||||
"basepath": "",
|
||||
"modelName": "text-embedding-ada-002"
|
||||
},
|
||||
"outputAnchors": [
|
||||
{
|
||||
|
||||
@@ -488,13 +488,23 @@
|
||||
"type": "BaseLLMOutputParser",
|
||||
"optional": true,
|
||||
"id": "llmChain_0-input-outputParser-BaseLLMOutputParser"
|
||||
},
|
||||
{
|
||||
"label": "Input Moderation",
|
||||
"description": "Detect text that could generate harmful output and prevent it from being sent to the language model",
|
||||
"name": "inputModeration",
|
||||
"type": "Moderation",
|
||||
"optional": true,
|
||||
"list": true,
|
||||
"id": "llmChain_0-input-inputModeration-Moderation"
|
||||
}
|
||||
],
|
||||
"inputs": {
|
||||
"model": "{{openAI_1.data.instance}}",
|
||||
"prompt": "{{promptTemplate_0.data.instance}}",
|
||||
"outputParser": "",
|
||||
"chainName": "FirstChain"
|
||||
"chainName": "FirstChain",
|
||||
"inputModeration": ""
|
||||
},
|
||||
"outputAnchors": [
|
||||
{
|
||||
@@ -577,13 +587,23 @@
|
||||
"type": "BaseLLMOutputParser",
|
||||
"optional": true,
|
||||
"id": "llmChain_1-input-outputParser-BaseLLMOutputParser"
|
||||
},
|
||||
{
|
||||
"label": "Input Moderation",
|
||||
"description": "Detect text that could generate harmful output and prevent it from being sent to the language model",
|
||||
"name": "inputModeration",
|
||||
"type": "Moderation",
|
||||
"optional": true,
|
||||
"list": true,
|
||||
"id": "llmChain_1-input-inputModeration-Moderation"
|
||||
}
|
||||
],
|
||||
"inputs": {
|
||||
"model": "{{openAI_2.data.instance}}",
|
||||
"prompt": "{{promptTemplate_1.data.instance}}",
|
||||
"outputParser": "",
|
||||
"chainName": "LastChain"
|
||||
"chainName": "LastChain",
|
||||
"inputModeration": ""
|
||||
},
|
||||
"outputAnchors": [
|
||||
{
|
||||
|
||||
@@ -99,7 +99,7 @@
|
||||
"data": {
|
||||
"id": "chatOpenAI_0",
|
||||
"label": "ChatOpenAI",
|
||||
"version": 2,
|
||||
"version": 3,
|
||||
"name": "chatOpenAI",
|
||||
"type": "ChatOpenAI",
|
||||
"baseClasses": ["ChatOpenAI", "BaseChatModel", "BaseLanguageModel", "Runnable"],
|
||||
@@ -122,6 +122,14 @@
|
||||
"label": "gpt-4",
|
||||
"name": "gpt-4"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-turbo-preview",
|
||||
"name": "gpt-4-turbo-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-0125-preview",
|
||||
"name": "gpt-4-0125-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-1106-preview",
|
||||
"name": "gpt-4-1106-preview"
|
||||
|
||||
@@ -227,13 +227,23 @@
|
||||
"type": "BaseLLMOutputParser",
|
||||
"optional": true,
|
||||
"id": "llmChain_0-input-outputParser-BaseLLMOutputParser"
|
||||
},
|
||||
{
|
||||
"label": "Input Moderation",
|
||||
"description": "Detect text that could generate harmful output and prevent it from being sent to the language model",
|
||||
"name": "inputModeration",
|
||||
"type": "Moderation",
|
||||
"optional": true,
|
||||
"list": true,
|
||||
"id": "llmChain_0-input-inputModeration-Moderation"
|
||||
}
|
||||
],
|
||||
"inputs": {
|
||||
"model": "{{replicate_0.data.instance}}",
|
||||
"prompt": "{{promptTemplate_0.data.instance}}",
|
||||
"outputParser": "",
|
||||
"chainName": ""
|
||||
"chainName": "",
|
||||
"inputModeration": ""
|
||||
},
|
||||
"outputAnchors": [
|
||||
{
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
"data": {
|
||||
"id": "chatOpenAI_0",
|
||||
"label": "ChatOpenAI",
|
||||
"version": 2,
|
||||
"version": 3,
|
||||
"name": "chatOpenAI",
|
||||
"type": "ChatOpenAI",
|
||||
"baseClasses": ["ChatOpenAI", "BaseChatModel", "BaseLanguageModel"],
|
||||
@@ -36,6 +36,22 @@
|
||||
"label": "gpt-4",
|
||||
"name": "gpt-4"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-turbo-preview",
|
||||
"name": "gpt-4-turbo-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-0125-preview",
|
||||
"name": "gpt-4-0125-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-1106-preview",
|
||||
"name": "gpt-4-1106-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-vision-preview",
|
||||
"name": "gpt-4-vision-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-0613",
|
||||
"name": "gpt-4-0613"
|
||||
@@ -52,6 +68,10 @@
|
||||
"label": "gpt-3.5-turbo",
|
||||
"name": "gpt-3.5-turbo"
|
||||
},
|
||||
{
|
||||
"label": "gpt-3.5-turbo-1106",
|
||||
"name": "gpt-3.5-turbo-1106"
|
||||
},
|
||||
{
|
||||
"label": "gpt-3.5-turbo-0613",
|
||||
"name": "gpt-3.5-turbo-0613"
|
||||
|
||||
@@ -173,7 +173,7 @@
|
||||
"data": {
|
||||
"id": "chatOpenAI_0",
|
||||
"label": "ChatOpenAI",
|
||||
"version": 2,
|
||||
"version": 3,
|
||||
"name": "chatOpenAI",
|
||||
"type": "ChatOpenAI",
|
||||
"baseClasses": ["ChatOpenAI", "BaseChatModel", "BaseLanguageModel", "Runnable"],
|
||||
@@ -196,6 +196,14 @@
|
||||
"label": "gpt-4",
|
||||
"name": "gpt-4"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-turbo-preview",
|
||||
"name": "gpt-4-turbo-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-0125-preview",
|
||||
"name": "gpt-4-0125-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-1106-preview",
|
||||
"name": "gpt-4-1106-preview"
|
||||
@@ -363,7 +371,7 @@
|
||||
"data": {
|
||||
"id": "chatOpenAI_1",
|
||||
"label": "ChatOpenAI",
|
||||
"version": 2,
|
||||
"version": 3,
|
||||
"name": "chatOpenAI",
|
||||
"type": "ChatOpenAI",
|
||||
"baseClasses": ["ChatOpenAI", "BaseChatModel", "BaseLanguageModel", "Runnable"],
|
||||
@@ -386,6 +394,14 @@
|
||||
"label": "gpt-4",
|
||||
"name": "gpt-4"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-turbo-preview",
|
||||
"name": "gpt-4-turbo-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-0125-preview",
|
||||
"name": "gpt-4-0125-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-1106-preview",
|
||||
"name": "gpt-4-1106-preview"
|
||||
@@ -1279,7 +1295,7 @@
|
||||
"data": {
|
||||
"id": "chatOpenAI_2",
|
||||
"label": "ChatOpenAI",
|
||||
"version": 2,
|
||||
"version": 3,
|
||||
"name": "chatOpenAI",
|
||||
"type": "ChatOpenAI",
|
||||
"baseClasses": ["ChatOpenAI", "BaseChatModel", "BaseLanguageModel", "Runnable"],
|
||||
@@ -1302,6 +1318,14 @@
|
||||
"label": "gpt-4",
|
||||
"name": "gpt-4"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-turbo-preview",
|
||||
"name": "gpt-4-turbo-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-0125-preview",
|
||||
"name": "gpt-4-0125-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-1106-preview",
|
||||
"name": "gpt-4-1106-preview"
|
||||
|
||||
@@ -2,20 +2,218 @@
|
||||
"description": "Basic example of Conversation Chain with built-in memory - works exactly like ChatGPT",
|
||||
"badge": "POPULAR",
|
||||
"nodes": [
|
||||
{
|
||||
"width": 300,
|
||||
"height": 574,
|
||||
"id": "chatOpenAI_0",
|
||||
"position": {
|
||||
"x": 579.0877964395976,
|
||||
"y": -138.68792413227874
|
||||
},
|
||||
"type": "customNode",
|
||||
"data": {
|
||||
"id": "chatOpenAI_0",
|
||||
"label": "ChatOpenAI",
|
||||
"version": 3,
|
||||
"name": "chatOpenAI",
|
||||
"type": "ChatOpenAI",
|
||||
"baseClasses": ["ChatOpenAI", "BaseChatModel", "BaseLanguageModel", "Runnable"],
|
||||
"category": "Chat Models",
|
||||
"description": "Wrapper around OpenAI large language models that use the Chat endpoint",
|
||||
"inputParams": [
|
||||
{
|
||||
"label": "Connect Credential",
|
||||
"name": "credential",
|
||||
"type": "credential",
|
||||
"credentialNames": ["openAIApi"],
|
||||
"id": "chatOpenAI_0-input-credential-credential"
|
||||
},
|
||||
{
|
||||
"label": "Model Name",
|
||||
"name": "modelName",
|
||||
"type": "options",
|
||||
"options": [
|
||||
{
|
||||
"label": "gpt-4",
|
||||
"name": "gpt-4"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-turbo-preview",
|
||||
"name": "gpt-4-turbo-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-0125-preview",
|
||||
"name": "gpt-4-0125-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-1106-preview",
|
||||
"name": "gpt-4-1106-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-vision-preview",
|
||||
"name": "gpt-4-vision-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-0613",
|
||||
"name": "gpt-4-0613"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-32k",
|
||||
"name": "gpt-4-32k"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-32k-0613",
|
||||
"name": "gpt-4-32k-0613"
|
||||
},
|
||||
{
|
||||
"label": "gpt-3.5-turbo",
|
||||
"name": "gpt-3.5-turbo"
|
||||
},
|
||||
{
|
||||
"label": "gpt-3.5-turbo-1106",
|
||||
"name": "gpt-3.5-turbo-1106"
|
||||
},
|
||||
{
|
||||
"label": "gpt-3.5-turbo-0613",
|
||||
"name": "gpt-3.5-turbo-0613"
|
||||
},
|
||||
{
|
||||
"label": "gpt-3.5-turbo-16k",
|
||||
"name": "gpt-3.5-turbo-16k"
|
||||
},
|
||||
{
|
||||
"label": "gpt-3.5-turbo-16k-0613",
|
||||
"name": "gpt-3.5-turbo-16k-0613"
|
||||
}
|
||||
],
|
||||
"default": "gpt-3.5-turbo",
|
||||
"optional": true,
|
||||
"id": "chatOpenAI_0-input-modelName-options"
|
||||
},
|
||||
{
|
||||
"label": "Temperature",
|
||||
"name": "temperature",
|
||||
"type": "number",
|
||||
"step": 0.1,
|
||||
"default": 0.9,
|
||||
"optional": true,
|
||||
"id": "chatOpenAI_0-input-temperature-number"
|
||||
},
|
||||
{
|
||||
"label": "Max Tokens",
|
||||
"name": "maxTokens",
|
||||
"type": "number",
|
||||
"step": 1,
|
||||
"optional": true,
|
||||
"additionalParams": true,
|
||||
"id": "chatOpenAI_0-input-maxTokens-number"
|
||||
},
|
||||
{
|
||||
"label": "Top Probability",
|
||||
"name": "topP",
|
||||
"type": "number",
|
||||
"step": 0.1,
|
||||
"optional": true,
|
||||
"additionalParams": true,
|
||||
"id": "chatOpenAI_0-input-topP-number"
|
||||
},
|
||||
{
|
||||
"label": "Frequency Penalty",
|
||||
"name": "frequencyPenalty",
|
||||
"type": "number",
|
||||
"step": 0.1,
|
||||
"optional": true,
|
||||
"additionalParams": true,
|
||||
"id": "chatOpenAI_0-input-frequencyPenalty-number"
|
||||
},
|
||||
{
|
||||
"label": "Presence Penalty",
|
||||
"name": "presencePenalty",
|
||||
"type": "number",
|
||||
"step": 0.1,
|
||||
"optional": true,
|
||||
"additionalParams": true,
|
||||
"id": "chatOpenAI_0-input-presencePenalty-number"
|
||||
},
|
||||
{
|
||||
"label": "Timeout",
|
||||
"name": "timeout",
|
||||
"type": "number",
|
||||
"step": 1,
|
||||
"optional": true,
|
||||
"additionalParams": true,
|
||||
"id": "chatOpenAI_0-input-timeout-number"
|
||||
},
|
||||
{
|
||||
"label": "BasePath",
|
||||
"name": "basepath",
|
||||
"type": "string",
|
||||
"optional": true,
|
||||
"additionalParams": true,
|
||||
"id": "chatOpenAI_0-input-basepath-string"
|
||||
},
|
||||
{
|
||||
"label": "BaseOptions",
|
||||
"name": "baseOptions",
|
||||
"type": "json",
|
||||
"optional": true,
|
||||
"additionalParams": true,
|
||||
"id": "chatOpenAI_0-input-baseOptions-json"
|
||||
}
|
||||
],
|
||||
"inputAnchors": [
|
||||
{
|
||||
"label": "Cache",
|
||||
"name": "cache",
|
||||
"type": "BaseCache",
|
||||
"optional": true,
|
||||
"id": "chatOpenAI_0-input-cache-BaseCache"
|
||||
}
|
||||
],
|
||||
"inputs": {
|
||||
"cache": "",
|
||||
"modelName": "gpt-3.5-turbo-16k",
|
||||
"temperature": 0.9,
|
||||
"maxTokens": "",
|
||||
"topP": "",
|
||||
"frequencyPenalty": "",
|
||||
"presencePenalty": "",
|
||||
"timeout": "",
|
||||
"basepath": "",
|
||||
"baseOptions": ""
|
||||
},
|
||||
"outputAnchors": [
|
||||
{
|
||||
"id": "chatOpenAI_0-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel|Runnable",
|
||||
"name": "chatOpenAI",
|
||||
"label": "ChatOpenAI",
|
||||
"type": "ChatOpenAI | BaseChatModel | BaseLanguageModel | Runnable"
|
||||
}
|
||||
],
|
||||
"outputs": {},
|
||||
"selected": false
|
||||
},
|
||||
"selected": false,
|
||||
"positionAbsolute": {
|
||||
"x": 579.0877964395976,
|
||||
"y": -138.68792413227874
|
||||
},
|
||||
"dragging": false
|
||||
},
|
||||
{
|
||||
"width": 300,
|
||||
"height": 376,
|
||||
"id": "bufferMemory_0",
|
||||
"position": {
|
||||
"x": 753.4300788823234,
|
||||
"y": 479.5336426526603
|
||||
"x": 220.30240896145915,
|
||||
"y": 351.61324070296877
|
||||
},
|
||||
"type": "customNode",
|
||||
"data": {
|
||||
"id": "bufferMemory_0",
|
||||
"label": "Buffer Memory",
|
||||
"name": "bufferMemory",
|
||||
"version": 1,
|
||||
"name": "bufferMemory",
|
||||
"type": "BufferMemory",
|
||||
"baseClasses": ["BufferMemory", "BaseChatMemory", "BaseMemory"],
|
||||
"category": "Memory",
|
||||
@@ -54,179 +252,8 @@
|
||||
},
|
||||
"selected": false,
|
||||
"positionAbsolute": {
|
||||
"x": 753.4300788823234,
|
||||
"y": 479.5336426526603
|
||||
},
|
||||
"dragging": false
|
||||
},
|
||||
{
|
||||
"width": 300,
|
||||
"height": 523,
|
||||
"id": "chatOpenAI_0",
|
||||
"position": {
|
||||
"x": 754.8942497823595,
|
||||
"y": -140
|
||||
},
|
||||
"type": "customNode",
|
||||
"data": {
|
||||
"id": "chatOpenAI_0",
|
||||
"label": "ChatOpenAI",
|
||||
"name": "chatOpenAI",
|
||||
"version": 2,
|
||||
"type": "ChatOpenAI",
|
||||
"baseClasses": ["ChatOpenAI", "BaseChatModel", "BaseLanguageModel"],
|
||||
"category": "Chat Models",
|
||||
"description": "Wrapper around OpenAI large language models that use the Chat endpoint",
|
||||
"inputParams": [
|
||||
{
|
||||
"label": "Connect Credential",
|
||||
"name": "credential",
|
||||
"type": "credential",
|
||||
"credentialNames": ["openAIApi"],
|
||||
"id": "chatOpenAI_0-input-credential-credential"
|
||||
},
|
||||
{
|
||||
"label": "Model Name",
|
||||
"name": "modelName",
|
||||
"type": "options",
|
||||
"options": [
|
||||
{
|
||||
"label": "gpt-4",
|
||||
"name": "gpt-4"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-0613",
|
||||
"name": "gpt-4-0613"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-32k",
|
||||
"name": "gpt-4-32k"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-32k-0613",
|
||||
"name": "gpt-4-32k-0613"
|
||||
},
|
||||
{
|
||||
"label": "gpt-3.5-turbo",
|
||||
"name": "gpt-3.5-turbo"
|
||||
},
|
||||
{
|
||||
"label": "gpt-3.5-turbo-0613",
|
||||
"name": "gpt-3.5-turbo-0613"
|
||||
},
|
||||
{
|
||||
"label": "gpt-3.5-turbo-16k",
|
||||
"name": "gpt-3.5-turbo-16k"
|
||||
},
|
||||
{
|
||||
"label": "gpt-3.5-turbo-16k-0613",
|
||||
"name": "gpt-3.5-turbo-16k-0613"
|
||||
}
|
||||
],
|
||||
"default": "gpt-3.5-turbo",
|
||||
"optional": true,
|
||||
"id": "chatOpenAI_0-input-modelName-options"
|
||||
},
|
||||
{
|
||||
"label": "Temperature",
|
||||
"name": "temperature",
|
||||
"type": "number",
|
||||
"default": 0.9,
|
||||
"optional": true,
|
||||
"id": "chatOpenAI_0-input-temperature-number"
|
||||
},
|
||||
{
|
||||
"label": "Max Tokens",
|
||||
"name": "maxTokens",
|
||||
"type": "number",
|
||||
"optional": true,
|
||||
"additionalParams": true,
|
||||
"id": "chatOpenAI_0-input-maxTokens-number"
|
||||
},
|
||||
{
|
||||
"label": "Top Probability",
|
||||
"name": "topP",
|
||||
"type": "number",
|
||||
"optional": true,
|
||||
"additionalParams": true,
|
||||
"id": "chatOpenAI_0-input-topP-number"
|
||||
},
|
||||
{
|
||||
"label": "Frequency Penalty",
|
||||
"name": "frequencyPenalty",
|
||||
"type": "number",
|
||||
"optional": true,
|
||||
"additionalParams": true,
|
||||
"id": "chatOpenAI_0-input-frequencyPenalty-number"
|
||||
},
|
||||
{
|
||||
"label": "Presence Penalty",
|
||||
"name": "presencePenalty",
|
||||
"type": "number",
|
||||
"optional": true,
|
||||
"additionalParams": true,
|
||||
"id": "chatOpenAI_0-input-presencePenalty-number"
|
||||
},
|
||||
{
|
||||
"label": "Timeout",
|
||||
"name": "timeout",
|
||||
"type": "number",
|
||||
"optional": true,
|
||||
"additionalParams": true,
|
||||
"id": "chatOpenAI_0-input-timeout-number"
|
||||
},
|
||||
{
|
||||
"label": "BasePath",
|
||||
"name": "basepath",
|
||||
"type": "string",
|
||||
"optional": true,
|
||||
"additionalParams": true,
|
||||
"id": "chatOpenAI_0-input-basepath-string"
|
||||
},
|
||||
{
|
||||
"label": "BaseOptions",
|
||||
"name": "baseOptions",
|
||||
"type": "json",
|
||||
"optional": true,
|
||||
"additionalParams": true,
|
||||
"id": "chatOpenAI_0-input-baseOptions-json"
|
||||
}
|
||||
],
|
||||
"inputAnchors": [
|
||||
{
|
||||
"label": "Cache",
|
||||
"name": "cache",
|
||||
"type": "BaseCache",
|
||||
"optional": true,
|
||||
"id": "chatOpenAI_0-input-cache-BaseCache"
|
||||
}
|
||||
],
|
||||
"inputs": {
|
||||
"modelName": "gpt-3.5-turbo",
|
||||
"temperature": 0.9,
|
||||
"maxTokens": "",
|
||||
"topP": "",
|
||||
"frequencyPenalty": "",
|
||||
"presencePenalty": "",
|
||||
"timeout": "",
|
||||
"basepath": "",
|
||||
"baseOptions": ""
|
||||
},
|
||||
"outputAnchors": [
|
||||
{
|
||||
"id": "chatOpenAI_0-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel",
|
||||
"name": "chatOpenAI",
|
||||
"label": "ChatOpenAI",
|
||||
"type": "ChatOpenAI | BaseChatModel | BaseLanguageModel"
|
||||
}
|
||||
],
|
||||
"outputs": {},
|
||||
"selected": false
|
||||
},
|
||||
"selected": false,
|
||||
"positionAbsolute": {
|
||||
"x": 754.8942497823595,
|
||||
"y": -140
|
||||
"x": 220.30240896145915,
|
||||
"y": 351.61324070296877
|
||||
},
|
||||
"dragging": false
|
||||
},
|
||||
@@ -235,17 +262,17 @@
|
||||
"height": 383,
|
||||
"id": "conversationChain_0",
|
||||
"position": {
|
||||
"x": 1174.6496397666272,
|
||||
"y": 311.1052536740497
|
||||
"x": 958.9887390513221,
|
||||
"y": 318.8734467468765
|
||||
},
|
||||
"type": "customNode",
|
||||
"data": {
|
||||
"id": "conversationChain_0",
|
||||
"label": "Conversation Chain",
|
||||
"version": 3,
|
||||
"name": "conversationChain",
|
||||
"version": 1,
|
||||
"type": "ConversationChain",
|
||||
"baseClasses": ["ConversationChain", "LLMChain", "BaseChain"],
|
||||
"baseClasses": ["ConversationChain", "LLMChain", "BaseChain", "Runnable"],
|
||||
"category": "Chains",
|
||||
"description": "Chat models specific conversational chain with memory",
|
||||
"inputParams": [
|
||||
@@ -254,9 +281,11 @@
|
||||
"name": "systemMessagePrompt",
|
||||
"type": "string",
|
||||
"rows": 4,
|
||||
"description": "If Chat Prompt Template is provided, this will be ignored",
|
||||
"additionalParams": true,
|
||||
"optional": true,
|
||||
"placeholder": "You are a helpful assistant that write codes",
|
||||
"default": "The following is a friendly conversation between a human and an AI. The AI is talkative and provides lots of specific details from its context. If the AI does not know the answer to a question, it truthfully says it does not know.",
|
||||
"placeholder": "The following is a friendly conversation between a human and an AI. The AI is talkative and provides lots of specific details from its context. If the AI does not know the answer to a question, it truthfully says it does not know.",
|
||||
"id": "conversationChain_0-input-systemMessagePrompt-string"
|
||||
}
|
||||
],
|
||||
@@ -274,27 +303,36 @@
|
||||
"id": "conversationChain_0-input-memory-BaseMemory"
|
||||
},
|
||||
{
|
||||
"label": "Document",
|
||||
"name": "document",
|
||||
"type": "Document",
|
||||
"description": "Include whole document into the context window",
|
||||
"label": "Chat Prompt Template",
|
||||
"name": "chatPromptTemplate",
|
||||
"type": "ChatPromptTemplate",
|
||||
"description": "Override existing prompt with Chat Prompt Template. Human Message must includes {input} variable",
|
||||
"optional": true,
|
||||
"id": "conversationChain_0-input-chatPromptTemplate-ChatPromptTemplate"
|
||||
},
|
||||
{
|
||||
"label": "Input Moderation",
|
||||
"description": "Detect text that could generate harmful output and prevent it from being sent to the language model",
|
||||
"name": "inputModeration",
|
||||
"type": "Moderation",
|
||||
"optional": true,
|
||||
"list": true,
|
||||
"id": "conversationChain_0-input-document-Document"
|
||||
"id": "conversationChain_0-input-inputModeration-Moderation"
|
||||
}
|
||||
],
|
||||
"inputs": {
|
||||
"inputModeration": "",
|
||||
"model": "{{chatOpenAI_0.data.instance}}",
|
||||
"memory": "{{bufferMemory_0.data.instance}}",
|
||||
"document": "",
|
||||
"systemMessagePrompt": ""
|
||||
"chatPromptTemplate": "",
|
||||
"systemMessagePrompt": "The following is a friendly conversation between a human and an AI. The AI is talkative and provides lots of specific details from its context. If the AI does not know the answer to a question, it truthfully says it does not know."
|
||||
},
|
||||
"outputAnchors": [
|
||||
{
|
||||
"id": "conversationChain_0-output-conversationChain-ConversationChain|LLMChain|BaseChain",
|
||||
"id": "conversationChain_0-output-conversationChain-ConversationChain|LLMChain|BaseChain|Runnable",
|
||||
"name": "conversationChain",
|
||||
"label": "ConversationChain",
|
||||
"type": "ConversationChain | LLMChain | BaseChain"
|
||||
"type": "ConversationChain | LLMChain | BaseChain | Runnable"
|
||||
}
|
||||
],
|
||||
"outputs": {},
|
||||
@@ -302,8 +340,8 @@
|
||||
},
|
||||
"selected": false,
|
||||
"positionAbsolute": {
|
||||
"x": 1174.6496397666272,
|
||||
"y": 311.1052536740497
|
||||
"x": 958.9887390513221,
|
||||
"y": 318.8734467468765
|
||||
},
|
||||
"dragging": false
|
||||
}
|
||||
@@ -311,14 +349,11 @@
|
||||
"edges": [
|
||||
{
|
||||
"source": "chatOpenAI_0",
|
||||
"sourceHandle": "chatOpenAI_0-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel",
|
||||
"sourceHandle": "chatOpenAI_0-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel|Runnable",
|
||||
"target": "conversationChain_0",
|
||||
"targetHandle": "conversationChain_0-input-model-BaseChatModel",
|
||||
"type": "buttonedge",
|
||||
"id": "chatOpenAI_0-chatOpenAI_0-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel-conversationChain_0-conversationChain_0-input-model-BaseChatModel",
|
||||
"data": {
|
||||
"label": ""
|
||||
}
|
||||
"id": "chatOpenAI_0-chatOpenAI_0-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel|Runnable-conversationChain_0-conversationChain_0-input-model-BaseChatModel"
|
||||
},
|
||||
{
|
||||
"source": "bufferMemory_0",
|
||||
@@ -326,10 +361,7 @@
|
||||
"target": "conversationChain_0",
|
||||
"targetHandle": "conversationChain_0-input-memory-BaseMemory",
|
||||
"type": "buttonedge",
|
||||
"id": "bufferMemory_0-bufferMemory_0-output-bufferMemory-BufferMemory|BaseChatMemory|BaseMemory-conversationChain_0-conversationChain_0-input-memory-BaseMemory",
|
||||
"data": {
|
||||
"label": ""
|
||||
}
|
||||
"id": "bufferMemory_0-bufferMemory_0-output-bufferMemory-BufferMemory|BaseChatMemory|BaseMemory-conversationChain_0-conversationChain_0-input-memory-BaseMemory"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -268,13 +268,23 @@
|
||||
"type": "BaseLLMOutputParser",
|
||||
"optional": true,
|
||||
"id": "llmChain_0-input-outputParser-BaseLLMOutputParser"
|
||||
},
|
||||
{
|
||||
"label": "Input Moderation",
|
||||
"description": "Detect text that could generate harmful output and prevent it from being sent to the language model",
|
||||
"name": "inputModeration",
|
||||
"type": "Moderation",
|
||||
"optional": true,
|
||||
"list": true,
|
||||
"id": "llmChain_0-input-inputModeration-Moderation"
|
||||
}
|
||||
],
|
||||
"inputs": {
|
||||
"model": "{{openAI_0.data.instance}}",
|
||||
"prompt": "{{promptTemplate_0.data.instance}}",
|
||||
"outputParser": "",
|
||||
"chainName": ""
|
||||
"chainName": "",
|
||||
"inputModeration": ""
|
||||
},
|
||||
"outputAnchors": [
|
||||
{
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
"data": {
|
||||
"id": "chatOpenAI_0",
|
||||
"label": "ChatOpenAI",
|
||||
"version": 2,
|
||||
"version": 3,
|
||||
"name": "chatOpenAI",
|
||||
"type": "ChatOpenAI",
|
||||
"baseClasses": ["ChatOpenAI", "BaseChatModel", "BaseLanguageModel", "Runnable"],
|
||||
@@ -37,6 +37,22 @@
|
||||
"label": "gpt-4",
|
||||
"name": "gpt-4"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-turbo-preview",
|
||||
"name": "gpt-4-turbo-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-0125-preview",
|
||||
"name": "gpt-4-0125-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-1106-preview",
|
||||
"name": "gpt-4-1106-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-vision-preview",
|
||||
"name": "gpt-4-vision-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-0613",
|
||||
"name": "gpt-4-0613"
|
||||
@@ -53,6 +69,10 @@
|
||||
"label": "gpt-3.5-turbo",
|
||||
"name": "gpt-3.5-turbo"
|
||||
},
|
||||
{
|
||||
"label": "gpt-3.5-turbo-1106",
|
||||
"name": "gpt-3.5-turbo-1106"
|
||||
},
|
||||
{
|
||||
"label": "gpt-3.5-turbo-0613",
|
||||
"name": "gpt-3.5-turbo-0613"
|
||||
@@ -227,13 +247,23 @@
|
||||
"type": "BaseLLMOutputParser",
|
||||
"optional": true,
|
||||
"id": "llmChain_0-input-outputParser-BaseLLMOutputParser"
|
||||
},
|
||||
{
|
||||
"label": "Input Moderation",
|
||||
"description": "Detect text that could generate harmful output and prevent it from being sent to the language model",
|
||||
"name": "inputModeration",
|
||||
"type": "Moderation",
|
||||
"optional": true,
|
||||
"list": true,
|
||||
"id": "llmChain_0-input-inputModeration-Moderation"
|
||||
}
|
||||
],
|
||||
"inputs": {
|
||||
"model": "{{chatOpenAI_0.data.instance}}",
|
||||
"prompt": "{{chatPromptTemplate_0.data.instance}}",
|
||||
"outputParser": "{{structuredOutputParser_0.data.instance}}",
|
||||
"chainName": ""
|
||||
"chainName": "",
|
||||
"inputModeration": ""
|
||||
},
|
||||
"outputAnchors": [
|
||||
{
|
||||
|
||||
@@ -82,7 +82,7 @@
|
||||
"data": {
|
||||
"id": "chatOpenAI_0",
|
||||
"label": "ChatOpenAI",
|
||||
"version": 2,
|
||||
"version": 3,
|
||||
"name": "chatOpenAI",
|
||||
"type": "ChatOpenAI",
|
||||
"baseClasses": ["ChatOpenAI", "BaseChatModel", "BaseLanguageModel"],
|
||||
@@ -105,6 +105,22 @@
|
||||
"label": "gpt-4",
|
||||
"name": "gpt-4"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-turbo-preview",
|
||||
"name": "gpt-4-turbo-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-0125-preview",
|
||||
"name": "gpt-4-0125-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-1106-preview",
|
||||
"name": "gpt-4-1106-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-vision-preview",
|
||||
"name": "gpt-4-vision-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-0613",
|
||||
"name": "gpt-4-0613"
|
||||
@@ -121,6 +137,10 @@
|
||||
"label": "gpt-3.5-turbo",
|
||||
"name": "gpt-3.5-turbo"
|
||||
},
|
||||
{
|
||||
"label": "gpt-3.5-turbo-1106",
|
||||
"name": "gpt-3.5-turbo-1106"
|
||||
},
|
||||
{
|
||||
"label": "gpt-3.5-turbo-0613",
|
||||
"name": "gpt-3.5-turbo-0613"
|
||||
@@ -288,13 +308,23 @@
|
||||
"type": "BaseLLMOutputParser",
|
||||
"optional": true,
|
||||
"id": "llmChain_0-input-outputParser-BaseLLMOutputParser"
|
||||
},
|
||||
{
|
||||
"label": "Input Moderation",
|
||||
"description": "Detect text that could generate harmful output and prevent it from being sent to the language model",
|
||||
"name": "inputModeration",
|
||||
"type": "Moderation",
|
||||
"optional": true,
|
||||
"list": true,
|
||||
"id": "llmChain_0-input-inputModeration-Moderation"
|
||||
}
|
||||
],
|
||||
"inputs": {
|
||||
"model": "{{chatOpenAI_0.data.instance}}",
|
||||
"prompt": "{{chatPromptTemplate_0.data.instance}}",
|
||||
"outputParser": "",
|
||||
"chainName": "Language Translation"
|
||||
"chainName": "Language Translation",
|
||||
"inputModeration": ""
|
||||
},
|
||||
"outputAnchors": [
|
||||
{
|
||||
|
||||
@@ -1,461 +0,0 @@
|
||||
{
|
||||
"description": "A simple LLM chain that uses Vectara to enable conversations with uploaded files",
|
||||
"nodes": [
|
||||
{
|
||||
"width": 300,
|
||||
"height": 574,
|
||||
"id": "chatOpenAI_0",
|
||||
"position": {
|
||||
"x": 581.1784360612766,
|
||||
"y": -229.3906666911439
|
||||
},
|
||||
"type": "customNode",
|
||||
"data": {
|
||||
"id": "chatOpenAI_0",
|
||||
"label": "ChatOpenAI",
|
||||
"version": 2,
|
||||
"name": "chatOpenAI",
|
||||
"type": "ChatOpenAI",
|
||||
"baseClasses": ["ChatOpenAI", "BaseChatModel", "BaseLanguageModel", "Runnable"],
|
||||
"category": "Chat Models",
|
||||
"description": "Wrapper around OpenAI large language models that use the Chat endpoint",
|
||||
"inputParams": [
|
||||
{
|
||||
"label": "Connect Credential",
|
||||
"name": "credential",
|
||||
"type": "credential",
|
||||
"credentialNames": ["openAIApi"],
|
||||
"id": "chatOpenAI_0-input-credential-credential"
|
||||
},
|
||||
{
|
||||
"label": "Model Name",
|
||||
"name": "modelName",
|
||||
"type": "options",
|
||||
"options": [
|
||||
{
|
||||
"label": "gpt-4",
|
||||
"name": "gpt-4"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-0613",
|
||||
"name": "gpt-4-0613"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-32k",
|
||||
"name": "gpt-4-32k"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-32k-0613",
|
||||
"name": "gpt-4-32k-0613"
|
||||
},
|
||||
{
|
||||
"label": "gpt-3.5-turbo",
|
||||
"name": "gpt-3.5-turbo"
|
||||
},
|
||||
{
|
||||
"label": "gpt-3.5-turbo-0613",
|
||||
"name": "gpt-3.5-turbo-0613"
|
||||
},
|
||||
{
|
||||
"label": "gpt-3.5-turbo-16k",
|
||||
"name": "gpt-3.5-turbo-16k"
|
||||
},
|
||||
{
|
||||
"label": "gpt-3.5-turbo-16k-0613",
|
||||
"name": "gpt-3.5-turbo-16k-0613"
|
||||
}
|
||||
],
|
||||
"default": "gpt-3.5-turbo",
|
||||
"optional": true,
|
||||
"id": "chatOpenAI_0-input-modelName-options"
|
||||
},
|
||||
{
|
||||
"label": "Temperature",
|
||||
"name": "temperature",
|
||||
"type": "number",
|
||||
"step": 0.1,
|
||||
"default": 0.9,
|
||||
"optional": true,
|
||||
"id": "chatOpenAI_0-input-temperature-number"
|
||||
},
|
||||
{
|
||||
"label": "Max Tokens",
|
||||
"name": "maxTokens",
|
||||
"type": "number",
|
||||
"step": 1,
|
||||
"optional": true,
|
||||
"additionalParams": true,
|
||||
"id": "chatOpenAI_0-input-maxTokens-number"
|
||||
},
|
||||
{
|
||||
"label": "Top Probability",
|
||||
"name": "topP",
|
||||
"type": "number",
|
||||
"step": 0.1,
|
||||
"optional": true,
|
||||
"additionalParams": true,
|
||||
"id": "chatOpenAI_0-input-topP-number"
|
||||
},
|
||||
{
|
||||
"label": "Frequency Penalty",
|
||||
"name": "frequencyPenalty",
|
||||
"type": "number",
|
||||
"step": 0.1,
|
||||
"optional": true,
|
||||
"additionalParams": true,
|
||||
"id": "chatOpenAI_0-input-frequencyPenalty-number"
|
||||
},
|
||||
{
|
||||
"label": "Presence Penalty",
|
||||
"name": "presencePenalty",
|
||||
"type": "number",
|
||||
"step": 0.1,
|
||||
"optional": true,
|
||||
"additionalParams": true,
|
||||
"id": "chatOpenAI_0-input-presencePenalty-number"
|
||||
},
|
||||
{
|
||||
"label": "Timeout",
|
||||
"name": "timeout",
|
||||
"type": "number",
|
||||
"step": 1,
|
||||
"optional": true,
|
||||
"additionalParams": true,
|
||||
"id": "chatOpenAI_0-input-timeout-number"
|
||||
},
|
||||
{
|
||||
"label": "BasePath",
|
||||
"name": "basepath",
|
||||
"type": "string",
|
||||
"optional": true,
|
||||
"additionalParams": true,
|
||||
"id": "chatOpenAI_0-input-basepath-string"
|
||||
},
|
||||
{
|
||||
"label": "BaseOptions",
|
||||
"name": "baseOptions",
|
||||
"type": "json",
|
||||
"optional": true,
|
||||
"additionalParams": true,
|
||||
"id": "chatOpenAI_0-input-baseOptions-json"
|
||||
}
|
||||
],
|
||||
"inputAnchors": [
|
||||
{
|
||||
"label": "Cache",
|
||||
"name": "cache",
|
||||
"type": "BaseCache",
|
||||
"optional": true,
|
||||
"id": "chatOpenAI_0-input-cache-BaseCache"
|
||||
}
|
||||
],
|
||||
"inputs": {
|
||||
"modelName": "gpt-3.5-turbo",
|
||||
"temperature": "0.6",
|
||||
"maxTokens": "",
|
||||
"topP": "",
|
||||
"frequencyPenalty": "",
|
||||
"presencePenalty": "",
|
||||
"timeout": "",
|
||||
"basepath": "",
|
||||
"baseOptions": ""
|
||||
},
|
||||
"outputAnchors": [
|
||||
{
|
||||
"id": "chatOpenAI_0-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel|Runnable",
|
||||
"name": "chatOpenAI",
|
||||
"label": "ChatOpenAI",
|
||||
"type": "ChatOpenAI | BaseChatModel | BaseLanguageModel | Runnable"
|
||||
}
|
||||
],
|
||||
"outputs": {},
|
||||
"selected": false
|
||||
},
|
||||
"selected": false,
|
||||
"positionAbsolute": {
|
||||
"x": 581.1784360612766,
|
||||
"y": -229.3906666911439
|
||||
},
|
||||
"dragging": false
|
||||
},
|
||||
{
|
||||
"width": 300,
|
||||
"height": 480,
|
||||
"id": "conversationalRetrievalQAChain_0",
|
||||
"position": {
|
||||
"x": 979.9713511176517,
|
||||
"y": 200.09513217589273
|
||||
},
|
||||
"type": "customNode",
|
||||
"data": {
|
||||
"id": "conversationalRetrievalQAChain_0",
|
||||
"label": "Conversational Retrieval QA Chain",
|
||||
"version": 2,
|
||||
"name": "conversationalRetrievalQAChain",
|
||||
"type": "ConversationalRetrievalQAChain",
|
||||
"baseClasses": ["ConversationalRetrievalQAChain", "BaseChain", "Runnable"],
|
||||
"category": "Chains",
|
||||
"description": "Document QA - built on RetrievalQAChain to provide a chat history component",
|
||||
"inputParams": [
|
||||
{
|
||||
"label": "Return Source Documents",
|
||||
"name": "returnSourceDocuments",
|
||||
"type": "boolean",
|
||||
"optional": true,
|
||||
"id": "conversationalRetrievalQAChain_0-input-returnSourceDocuments-boolean"
|
||||
},
|
||||
{
|
||||
"label": "Rephrase Prompt",
|
||||
"name": "rephrasePrompt",
|
||||
"type": "string",
|
||||
"description": "Using previous chat history, rephrase question into a standalone question",
|
||||
"warning": "Prompt must include input variables: {chat_history} and {question}",
|
||||
"rows": 4,
|
||||
"additionalParams": true,
|
||||
"optional": true,
|
||||
"default": "Given the following conversation and a follow up question, rephrase the follow up question to be a standalone question.\n\nChat History:\n{chat_history}\nFollow Up Input: {question}\nStandalone Question:",
|
||||
"id": "conversationalRetrievalQAChain_0-input-rephrasePrompt-string"
|
||||
},
|
||||
{
|
||||
"label": "Response Prompt",
|
||||
"name": "responsePrompt",
|
||||
"type": "string",
|
||||
"description": "Taking the rephrased question, search for answer from the provided context",
|
||||
"warning": "Prompt must include input variable: {context}",
|
||||
"rows": 4,
|
||||
"additionalParams": true,
|
||||
"optional": true,
|
||||
"default": "You are a helpful assistant. Using the provided context, answer the user's question to the best of your ability using the resources provided.\nIf there is nothing in the context relevant to the question at hand, just say \"Hmm, I'm not sure.\" Don't try to make up an answer.\n------------\n{context}\n------------\nREMEMBER: If there is no relevant information within the context, just say \"Hmm, I'm not sure.\" Don't try to make up an answer.",
|
||||
"id": "conversationalRetrievalQAChain_0-input-responsePrompt-string"
|
||||
}
|
||||
],
|
||||
"inputAnchors": [
|
||||
{
|
||||
"label": "Chat Model",
|
||||
"name": "model",
|
||||
"type": "BaseChatModel",
|
||||
"id": "conversationalRetrievalQAChain_0-input-model-BaseChatModel"
|
||||
},
|
||||
{
|
||||
"label": "Vector Store Retriever",
|
||||
"name": "vectorStoreRetriever",
|
||||
"type": "BaseRetriever",
|
||||
"id": "conversationalRetrievalQAChain_0-input-vectorStoreRetriever-BaseRetriever"
|
||||
},
|
||||
{
|
||||
"label": "Memory",
|
||||
"name": "memory",
|
||||
"type": "BaseMemory",
|
||||
"optional": true,
|
||||
"description": "If left empty, a default BufferMemory will be used",
|
||||
"id": "conversationalRetrievalQAChain_0-input-memory-BaseMemory"
|
||||
}
|
||||
],
|
||||
"inputs": {
|
||||
"model": "{{chatOpenAI_0.data.instance}}",
|
||||
"vectorStoreRetriever": "{{vectara_0.data.instance}}",
|
||||
"memory": "",
|
||||
"returnSourceDocuments": true,
|
||||
"rephrasePrompt": "Given the following conversation and a follow up question, rephrase the follow up question to be a standalone question.\n\nChat History:\n{chat_history}\nFollow Up Input: {question}\nStandalone Question:",
|
||||
"responsePrompt": "You are a helpful assistant. Using the provided context, answer the user's question to the best of your ability using the resources provided.\nIf there is nothing in the context relevant to the question at hand, just say \"Hmm, I'm not sure.\" Don't try to make up an answer.\n------------\n{context}\n------------\nREMEMBER: If there is no relevant information within the context, just say \"Hmm, I'm not sure.\" Don't try to make up an answer."
|
||||
},
|
||||
"outputAnchors": [
|
||||
{
|
||||
"id": "conversationalRetrievalQAChain_0-output-conversationalRetrievalQAChain-ConversationalRetrievalQAChain|BaseChain|Runnable",
|
||||
"name": "conversationalRetrievalQAChain",
|
||||
"label": "ConversationalRetrievalQAChain",
|
||||
"type": "ConversationalRetrievalQAChain | BaseChain | Runnable"
|
||||
}
|
||||
],
|
||||
"outputs": {},
|
||||
"selected": false
|
||||
},
|
||||
"selected": false,
|
||||
"dragging": false,
|
||||
"positionAbsolute": {
|
||||
"x": 979.9713511176517,
|
||||
"y": 200.09513217589273
|
||||
}
|
||||
},
|
||||
{
|
||||
"width": 300,
|
||||
"height": 535,
|
||||
"id": "vectara_0",
|
||||
"position": {
|
||||
"x": 199.28476672510158,
|
||||
"y": 177.63260741741112
|
||||
},
|
||||
"type": "customNode",
|
||||
"data": {
|
||||
"id": "vectara_0",
|
||||
"label": "Vectara",
|
||||
"version": 1,
|
||||
"name": "vectara",
|
||||
"type": "Vectara",
|
||||
"baseClasses": ["Vectara", "VectorStoreRetriever", "BaseRetriever"],
|
||||
"category": "Vector Stores",
|
||||
"description": "Upsert embedded data and perform similarity search upon query using Vectara, a LLM-powered search-as-a-service",
|
||||
"inputParams": [
|
||||
{
|
||||
"label": "Connect Credential",
|
||||
"name": "credential",
|
||||
"type": "credential",
|
||||
"credentialNames": ["vectaraApi"],
|
||||
"id": "vectara_0-input-credential-credential"
|
||||
},
|
||||
{
|
||||
"label": "File",
|
||||
"name": "file",
|
||||
"description": "File to upload to Vectara. Supported file types: https://docs.vectara.com/docs/api-reference/indexing-apis/file-upload/file-upload-filetypes",
|
||||
"type": "file",
|
||||
"optional": true,
|
||||
"id": "vectara_0-input-file-file"
|
||||
},
|
||||
{
|
||||
"label": "Metadata Filter",
|
||||
"name": "filter",
|
||||
"description": "Filter to apply to Vectara metadata. Refer to the <a target=\"_blank\" href=\"https://docs.flowiseai.com/vector-stores/vectara\">documentation</a> on how to use Vectara filters with Flowise.",
|
||||
"type": "string",
|
||||
"additionalParams": true,
|
||||
"optional": true,
|
||||
"id": "vectara_0-input-filter-string"
|
||||
},
|
||||
{
|
||||
"label": "Sentences Before",
|
||||
"name": "sentencesBefore",
|
||||
"description": "Number of sentences to fetch before the matched sentence. Defaults to 2.",
|
||||
"type": "number",
|
||||
"additionalParams": true,
|
||||
"optional": true,
|
||||
"id": "vectara_0-input-sentencesBefore-number"
|
||||
},
|
||||
{
|
||||
"label": "Sentences After",
|
||||
"name": "sentencesAfter",
|
||||
"description": "Number of sentences to fetch after the matched sentence. Defaults to 2.",
|
||||
"type": "number",
|
||||
"additionalParams": true,
|
||||
"optional": true,
|
||||
"id": "vectara_0-input-sentencesAfter-number"
|
||||
},
|
||||
{
|
||||
"label": "Lambda",
|
||||
"name": "lambda",
|
||||
"description": "Improves retrieval accuracy by adjusting the balance (from 0 to 1) between neural search and keyword-based search factors.",
|
||||
"type": "number",
|
||||
"additionalParams": true,
|
||||
"optional": true,
|
||||
"id": "vectara_0-input-lambda-number"
|
||||
},
|
||||
{
|
||||
"label": "Top K",
|
||||
"name": "topK",
|
||||
"description": "Number of top results to fetch. Defaults to 5",
|
||||
"placeholder": "5",
|
||||
"type": "number",
|
||||
"additionalParams": true,
|
||||
"optional": true,
|
||||
"id": "vectara_0-input-topK-number"
|
||||
},
|
||||
{
|
||||
"label": "MMR K",
|
||||
"name": "mmrK",
|
||||
"description": "The number of results to rerank if MMR is enabled.",
|
||||
"placeholder": "50",
|
||||
"type": "number",
|
||||
"additionalParams": true,
|
||||
"optional": true,
|
||||
"id": "vectara_0-input-mmrK-number"
|
||||
},
|
||||
{
|
||||
"label": "MMR Diversity Bias",
|
||||
"name": "mmrDiversityBias",
|
||||
"step": 0.1,
|
||||
"description": "Diversity Bias parameter for MMR, if enabled. 0.0 means no diversiry bias, 1.0 means maximum diversity bias. Defaults to 0.0 (MMR disabled).",
|
||||
"placeholder": "0.0",
|
||||
"type": "number",
|
||||
"additionalParams": true,
|
||||
"optional": true,
|
||||
"id": "vectara_0-input-mmrDiversityBias-number"
|
||||
}
|
||||
],
|
||||
"inputAnchors": [
|
||||
{
|
||||
"label": "Document",
|
||||
"name": "document",
|
||||
"type": "Document",
|
||||
"list": true,
|
||||
"optional": true,
|
||||
"id": "vectara_0-input-document-Document"
|
||||
}
|
||||
],
|
||||
"inputs": {
|
||||
"document": "",
|
||||
"filter": "",
|
||||
"sentencesBefore": "",
|
||||
"sentencesAfter": "",
|
||||
"lambda": "",
|
||||
"topK": "",
|
||||
"mmrK": "",
|
||||
"mmrDiversityBias": ""
|
||||
},
|
||||
"outputAnchors": [
|
||||
{
|
||||
"name": "output",
|
||||
"label": "Output",
|
||||
"type": "options",
|
||||
"options": [
|
||||
{
|
||||
"id": "vectara_0-output-retriever-Vectara|VectorStoreRetriever|BaseRetriever",
|
||||
"name": "retriever",
|
||||
"label": "Vectara Retriever",
|
||||
"type": "Vectara | VectorStoreRetriever | BaseRetriever"
|
||||
},
|
||||
{
|
||||
"id": "vectara_0-output-vectorStore-Vectara|VectorStore",
|
||||
"name": "vectorStore",
|
||||
"label": "Vectara Vector Store",
|
||||
"type": "Vectara | VectorStore"
|
||||
}
|
||||
],
|
||||
"default": "retriever"
|
||||
}
|
||||
],
|
||||
"outputs": {
|
||||
"output": "retriever"
|
||||
},
|
||||
"selected": false
|
||||
},
|
||||
"selected": false,
|
||||
"positionAbsolute": {
|
||||
"x": 199.28476672510158,
|
||||
"y": 177.63260741741112
|
||||
},
|
||||
"dragging": false
|
||||
}
|
||||
],
|
||||
"edges": [
|
||||
{
|
||||
"source": "chatOpenAI_0",
|
||||
"sourceHandle": "chatOpenAI_0-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel|Runnable",
|
||||
"target": "conversationalRetrievalQAChain_0",
|
||||
"targetHandle": "conversationalRetrievalQAChain_0-input-model-BaseChatModel",
|
||||
"type": "buttonedge",
|
||||
"id": "chatOpenAI_0-chatOpenAI_0-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel|Runnable-conversationalRetrievalQAChain_0-conversationalRetrievalQAChain_0-input-model-BaseChatModel",
|
||||
"data": {
|
||||
"label": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"source": "vectara_0",
|
||||
"sourceHandle": "vectara_0-output-retriever-Vectara|VectorStoreRetriever|BaseRetriever",
|
||||
"target": "conversationalRetrievalQAChain_0",
|
||||
"targetHandle": "conversationalRetrievalQAChain_0-input-vectorStoreRetriever-BaseRetriever",
|
||||
"type": "buttonedge",
|
||||
"id": "vectara_0-vectara_0-output-retriever-Vectara|VectorStoreRetriever|BaseRetriever-conversationalRetrievalQAChain_0-conversationalRetrievalQAChain_0-input-vectorStoreRetriever-BaseRetriever",
|
||||
"data": {
|
||||
"label": ""
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,385 @@
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"width": 300,
|
||||
"height": 520,
|
||||
"id": "vectaraQAChain_0",
|
||||
"position": {
|
||||
"x": 740.28434119739,
|
||||
"y": 164.93261446841598
|
||||
},
|
||||
"type": "customNode",
|
||||
"data": {
|
||||
"id": "vectaraQAChain_0",
|
||||
"label": "Vectara QA Chain",
|
||||
"version": 1,
|
||||
"name": "vectaraQAChain",
|
||||
"type": "VectaraQAChain",
|
||||
"baseClasses": ["VectaraQAChain", "BaseChain", "Runnable"],
|
||||
"category": "Chains",
|
||||
"description": "QA chain for Vectara",
|
||||
"inputParams": [
|
||||
{
|
||||
"label": "Summarizer Prompt Name",
|
||||
"name": "summarizerPromptName",
|
||||
"description": "Summarize the results fetched from Vectara. Read <a target=\"_blank\" href=\"https://docs.vectara.com/docs/learn/grounded-generation/select-a-summarizer\">more</a>",
|
||||
"type": "options",
|
||||
"options": [
|
||||
{
|
||||
"label": "vectara-summary-ext-v1.2.0 (gpt-3.5-turbo)",
|
||||
"name": "vectara-summary-ext-v1.2.0"
|
||||
},
|
||||
{
|
||||
"label": "vectara-experimental-summary-ext-2023-10-23-small (gpt-3.5-turbo)",
|
||||
"name": "vectara-experimental-summary-ext-2023-10-23-small",
|
||||
"description": "In beta, available to both Growth and Scale Vectara users"
|
||||
},
|
||||
{
|
||||
"label": "vectara-summary-ext-v1.3.0 (gpt-4.0)",
|
||||
"name": "vectara-summary-ext-v1.3.0",
|
||||
"description": "Only available to paying Scale Vectara users"
|
||||
},
|
||||
{
|
||||
"label": "vectara-experimental-summary-ext-2023-10-23-med (gpt-4.0)",
|
||||
"name": "vectara-experimental-summary-ext-2023-10-23-med",
|
||||
"description": "In beta, only available to paying Scale Vectara users"
|
||||
}
|
||||
],
|
||||
"default": "vectara-summary-ext-v1.2.0",
|
||||
"id": "vectaraQAChain_0-input-summarizerPromptName-options"
|
||||
},
|
||||
{
|
||||
"label": "Response Language",
|
||||
"name": "responseLang",
|
||||
"description": "Return the response in specific language. If not selected, Vectara will automatically detects the language. Read <a target=\"_blank\" href=\"https://docs.vectara.com/docs/learn/grounded-generation/grounded-generation-response-languages\">more</a>",
|
||||
"type": "options",
|
||||
"options": [
|
||||
{
|
||||
"label": "English",
|
||||
"name": "eng"
|
||||
},
|
||||
{
|
||||
"label": "German",
|
||||
"name": "deu"
|
||||
},
|
||||
{
|
||||
"label": "French",
|
||||
"name": "fra"
|
||||
},
|
||||
{
|
||||
"label": "Chinese",
|
||||
"name": "zho"
|
||||
},
|
||||
{
|
||||
"label": "Korean",
|
||||
"name": "kor"
|
||||
},
|
||||
{
|
||||
"label": "Arabic",
|
||||
"name": "ara"
|
||||
},
|
||||
{
|
||||
"label": "Russian",
|
||||
"name": "rus"
|
||||
},
|
||||
{
|
||||
"label": "Thai",
|
||||
"name": "tha"
|
||||
},
|
||||
{
|
||||
"label": "Dutch",
|
||||
"name": "nld"
|
||||
},
|
||||
{
|
||||
"label": "Italian",
|
||||
"name": "ita"
|
||||
},
|
||||
{
|
||||
"label": "Portuguese",
|
||||
"name": "por"
|
||||
},
|
||||
{
|
||||
"label": "Spanish",
|
||||
"name": "spa"
|
||||
},
|
||||
{
|
||||
"label": "Japanese",
|
||||
"name": "jpn"
|
||||
},
|
||||
{
|
||||
"label": "Polish",
|
||||
"name": "pol"
|
||||
},
|
||||
{
|
||||
"label": "Turkish",
|
||||
"name": "tur"
|
||||
},
|
||||
{
|
||||
"label": "Vietnamese",
|
||||
"name": "vie"
|
||||
},
|
||||
{
|
||||
"label": "Indonesian",
|
||||
"name": "ind"
|
||||
},
|
||||
{
|
||||
"label": "Czech",
|
||||
"name": "ces"
|
||||
},
|
||||
{
|
||||
"label": "Ukrainian",
|
||||
"name": "ukr"
|
||||
},
|
||||
{
|
||||
"label": "Greek",
|
||||
"name": "ell"
|
||||
},
|
||||
{
|
||||
"label": "Hebrew",
|
||||
"name": "heb"
|
||||
},
|
||||
{
|
||||
"label": "Farsi/Persian",
|
||||
"name": "fas"
|
||||
},
|
||||
{
|
||||
"label": "Hindi",
|
||||
"name": "hin"
|
||||
},
|
||||
{
|
||||
"label": "Urdu",
|
||||
"name": "urd"
|
||||
},
|
||||
{
|
||||
"label": "Swedish",
|
||||
"name": "swe"
|
||||
},
|
||||
{
|
||||
"label": "Bengali",
|
||||
"name": "ben"
|
||||
},
|
||||
{
|
||||
"label": "Malay",
|
||||
"name": "msa"
|
||||
},
|
||||
{
|
||||
"label": "Romanian",
|
||||
"name": "ron"
|
||||
}
|
||||
],
|
||||
"optional": true,
|
||||
"default": "eng",
|
||||
"id": "vectaraQAChain_0-input-responseLang-options"
|
||||
},
|
||||
{
|
||||
"label": "Max Summarized Results",
|
||||
"name": "maxSummarizedResults",
|
||||
"description": "Maximum results used to build the summarized response",
|
||||
"type": "number",
|
||||
"default": 7,
|
||||
"id": "vectaraQAChain_0-input-maxSummarizedResults-number"
|
||||
}
|
||||
],
|
||||
"inputAnchors": [
|
||||
{
|
||||
"label": "Vectara Store",
|
||||
"name": "vectaraStore",
|
||||
"type": "VectorStore",
|
||||
"id": "vectaraQAChain_0-input-vectaraStore-VectorStore"
|
||||
}
|
||||
],
|
||||
"inputs": {
|
||||
"vectaraStore": "{{vectara_1.data.instance}}",
|
||||
"summarizerPromptName": "vectara-experimental-summary-ext-2023-10-23-small",
|
||||
"responseLang": "eng",
|
||||
"maxSummarizedResults": 7
|
||||
},
|
||||
"outputAnchors": [
|
||||
{
|
||||
"id": "vectaraQAChain_0-output-vectaraQAChain-VectaraQAChain|BaseChain|Runnable",
|
||||
"name": "vectaraQAChain",
|
||||
"label": "VectaraQAChain",
|
||||
"type": "VectaraQAChain | BaseChain | Runnable"
|
||||
}
|
||||
],
|
||||
"outputs": {},
|
||||
"selected": false
|
||||
},
|
||||
"selected": false,
|
||||
"positionAbsolute": {
|
||||
"x": 740.28434119739,
|
||||
"y": 164.93261446841598
|
||||
},
|
||||
"dragging": false
|
||||
},
|
||||
{
|
||||
"width": 300,
|
||||
"height": 536,
|
||||
"id": "vectara_1",
|
||||
"position": {
|
||||
"x": 139.43135627266395,
|
||||
"y": 189.3685569634871
|
||||
},
|
||||
"type": "customNode",
|
||||
"data": {
|
||||
"id": "vectara_1",
|
||||
"label": "Vectara",
|
||||
"version": 2,
|
||||
"name": "vectara",
|
||||
"type": "Vectara",
|
||||
"baseClasses": ["Vectara", "VectorStoreRetriever", "BaseRetriever"],
|
||||
"category": "Vector Stores",
|
||||
"description": "Upsert embedded data and perform similarity search upon query using Vectara, a LLM-powered search-as-a-service",
|
||||
"inputParams": [
|
||||
{
|
||||
"label": "Connect Credential",
|
||||
"name": "credential",
|
||||
"type": "credential",
|
||||
"credentialNames": ["vectaraApi"],
|
||||
"id": "vectara_1-input-credential-credential"
|
||||
},
|
||||
{
|
||||
"label": "File",
|
||||
"name": "file",
|
||||
"description": "File to upload to Vectara. Supported file types: https://docs.vectara.com/docs/api-reference/indexing-apis/file-upload/file-upload-filetypes",
|
||||
"type": "file",
|
||||
"optional": true,
|
||||
"id": "vectara_1-input-file-file"
|
||||
},
|
||||
{
|
||||
"label": "Metadata Filter",
|
||||
"name": "filter",
|
||||
"description": "Filter to apply to Vectara metadata. Refer to the <a target=\"_blank\" href=\"https://docs.flowiseai.com/vector-stores/vectara\">documentation</a> on how to use Vectara filters with Flowise.",
|
||||
"type": "string",
|
||||
"additionalParams": true,
|
||||
"optional": true,
|
||||
"id": "vectara_1-input-filter-string"
|
||||
},
|
||||
{
|
||||
"label": "Sentences Before",
|
||||
"name": "sentencesBefore",
|
||||
"description": "Number of sentences to fetch before the matched sentence. Defaults to 2.",
|
||||
"type": "number",
|
||||
"default": 2,
|
||||
"additionalParams": true,
|
||||
"optional": true,
|
||||
"id": "vectara_1-input-sentencesBefore-number"
|
||||
},
|
||||
{
|
||||
"label": "Sentences After",
|
||||
"name": "sentencesAfter",
|
||||
"description": "Number of sentences to fetch after the matched sentence. Defaults to 2.",
|
||||
"type": "number",
|
||||
"default": 2,
|
||||
"additionalParams": true,
|
||||
"optional": true,
|
||||
"id": "vectara_1-input-sentencesAfter-number"
|
||||
},
|
||||
{
|
||||
"label": "Lambda",
|
||||
"name": "lambda",
|
||||
"description": "Enable hybrid search to improve retrieval accuracy by adjusting the balance (from 0 to 1) between neural search and keyword-based search factors.A value of 0.0 means that only neural search is used, while a value of 1.0 means that only keyword-based search is used. Defaults to 0.0 (neural only).",
|
||||
"default": 0,
|
||||
"type": "number",
|
||||
"additionalParams": true,
|
||||
"optional": true,
|
||||
"id": "vectara_1-input-lambda-number"
|
||||
},
|
||||
{
|
||||
"label": "Top K",
|
||||
"name": "topK",
|
||||
"description": "Number of top results to fetch. Defaults to 5",
|
||||
"placeholder": "5",
|
||||
"type": "number",
|
||||
"additionalParams": true,
|
||||
"optional": true,
|
||||
"id": "vectara_1-input-topK-number"
|
||||
},
|
||||
{
|
||||
"label": "MMR K",
|
||||
"name": "mmrK",
|
||||
"description": "Number of top results to fetch for MMR. Defaults to 50",
|
||||
"placeholder": "50",
|
||||
"type": "number",
|
||||
"additionalParams": true,
|
||||
"optional": true,
|
||||
"id": "vectara_1-input-mmrK-number"
|
||||
},
|
||||
{
|
||||
"label": "MMR diversity bias",
|
||||
"name": "mmrDiversityBias",
|
||||
"step": 0.1,
|
||||
"description": "The diversity bias to use for MMR. This is a value between 0.0 and 1.0Values closer to 1.0 optimize for the most diverse results.Defaults to 0 (MMR disabled)",
|
||||
"placeholder": "0.0",
|
||||
"type": "number",
|
||||
"additionalParams": true,
|
||||
"optional": true,
|
||||
"id": "vectara_1-input-mmrDiversityBias-number"
|
||||
}
|
||||
],
|
||||
"inputAnchors": [
|
||||
{
|
||||
"label": "Document",
|
||||
"name": "document",
|
||||
"type": "Document",
|
||||
"list": true,
|
||||
"optional": true,
|
||||
"id": "vectara_1-input-document-Document"
|
||||
}
|
||||
],
|
||||
"inputs": {
|
||||
"document": "",
|
||||
"filter": "",
|
||||
"sentencesBefore": 2,
|
||||
"sentencesAfter": 2,
|
||||
"lambda": "",
|
||||
"topK": "",
|
||||
"mmrK": "",
|
||||
"mmrDiversityBias": ""
|
||||
},
|
||||
"outputAnchors": [
|
||||
{
|
||||
"name": "output",
|
||||
"label": "Output",
|
||||
"type": "options",
|
||||
"options": [
|
||||
{
|
||||
"id": "vectara_1-output-retriever-Vectara|VectorStoreRetriever|BaseRetriever",
|
||||
"name": "retriever",
|
||||
"label": "Vectara Retriever",
|
||||
"type": "Vectara | VectorStoreRetriever | BaseRetriever"
|
||||
},
|
||||
{
|
||||
"id": "vectara_1-output-vectorStore-Vectara|VectorStore",
|
||||
"name": "vectorStore",
|
||||
"label": "Vectara Vector Store",
|
||||
"type": "Vectara | VectorStore"
|
||||
}
|
||||
],
|
||||
"default": "retriever"
|
||||
}
|
||||
],
|
||||
"outputs": {
|
||||
"output": "vectorStore"
|
||||
},
|
||||
"selected": false
|
||||
},
|
||||
"positionAbsolute": {
|
||||
"x": 139.43135627266395,
|
||||
"y": 189.3685569634871
|
||||
},
|
||||
"selected": false,
|
||||
"dragging": false
|
||||
}
|
||||
],
|
||||
"edges": [
|
||||
{
|
||||
"source": "vectara_1",
|
||||
"sourceHandle": "vectara_1-output-vectorStore-Vectara|VectorStore",
|
||||
"target": "vectaraQAChain_0",
|
||||
"targetHandle": "vectaraQAChain_0-input-vectaraStore-VectorStore",
|
||||
"type": "buttonedge",
|
||||
"id": "vectara_1-vectara_1-output-vectorStore-Vectara|VectorStore-vectaraQAChain_0-vectaraQAChain_0-input-vectaraStore-VectorStore"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -125,7 +125,7 @@
|
||||
"data": {
|
||||
"id": "chatOpenAI_0",
|
||||
"label": "ChatOpenAI",
|
||||
"version": 2,
|
||||
"version": 3,
|
||||
"name": "chatOpenAI",
|
||||
"type": "ChatOpenAI",
|
||||
"baseClasses": ["ChatOpenAI", "BaseChatModel", "BaseLanguageModel"],
|
||||
@@ -148,6 +148,22 @@
|
||||
"label": "gpt-4",
|
||||
"name": "gpt-4"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-turbo-preview",
|
||||
"name": "gpt-4-turbo-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-0125-preview",
|
||||
"name": "gpt-4-0125-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-1106-preview",
|
||||
"name": "gpt-4-1106-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-vision-preview",
|
||||
"name": "gpt-4-vision-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-0613",
|
||||
"name": "gpt-4-0613"
|
||||
@@ -164,6 +180,10 @@
|
||||
"label": "gpt-3.5-turbo",
|
||||
"name": "gpt-3.5-turbo"
|
||||
},
|
||||
{
|
||||
"label": "gpt-3.5-turbo-1106",
|
||||
"name": "gpt-3.5-turbo-1106"
|
||||
},
|
||||
{
|
||||
"label": "gpt-3.5-turbo-0613",
|
||||
"name": "gpt-3.5-turbo-0613"
|
||||
@@ -296,7 +316,7 @@
|
||||
"data": {
|
||||
"id": "openAIEmbeddings_0",
|
||||
"label": "OpenAI Embeddings",
|
||||
"version": 1,
|
||||
"version": 2,
|
||||
"name": "openAIEmbeddings",
|
||||
"type": "OpenAIEmbeddings",
|
||||
"baseClasses": ["OpenAIEmbeddings", "Embeddings"],
|
||||
@@ -310,6 +330,28 @@
|
||||
"credentialNames": ["openAIApi"],
|
||||
"id": "openAIEmbeddings_0-input-credential-credential"
|
||||
},
|
||||
{
|
||||
"label": "Model Name",
|
||||
"name": "modelName",
|
||||
"type": "options",
|
||||
"options": [
|
||||
{
|
||||
"label": "text-embedding-3-large",
|
||||
"name": "text-embedding-3-large"
|
||||
},
|
||||
{
|
||||
"label": "text-embedding-3-small",
|
||||
"name": "text-embedding-3-small"
|
||||
},
|
||||
{
|
||||
"label": "text-embedding-ada-002",
|
||||
"name": "text-embedding-ada-002"
|
||||
}
|
||||
],
|
||||
"default": "text-embedding-ada-002",
|
||||
"optional": true,
|
||||
"id": "openAIEmbeddings_0-input-modelName-options"
|
||||
},
|
||||
{
|
||||
"label": "Strip New Lines",
|
||||
"name": "stripNewLines",
|
||||
@@ -348,7 +390,8 @@
|
||||
"stripNewLines": "",
|
||||
"batchSize": "",
|
||||
"timeout": "",
|
||||
"basepath": ""
|
||||
"basepath": "",
|
||||
"modelName": "text-embedding-ada-002"
|
||||
},
|
||||
"outputAnchors": [
|
||||
{
|
||||
@@ -380,7 +423,7 @@
|
||||
"data": {
|
||||
"id": "chatOpenAI_1",
|
||||
"label": "ChatOpenAI",
|
||||
"version": 2,
|
||||
"version": 3,
|
||||
"name": "chatOpenAI",
|
||||
"type": "ChatOpenAI",
|
||||
"baseClasses": ["ChatOpenAI", "BaseChatModel", "BaseLanguageModel"],
|
||||
@@ -403,6 +446,22 @@
|
||||
"label": "gpt-4",
|
||||
"name": "gpt-4"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-turbo-preview",
|
||||
"name": "gpt-4-turbo-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-0125-preview",
|
||||
"name": "gpt-4-0125-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-1106-preview",
|
||||
"name": "gpt-4-1106-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-vision-preview",
|
||||
"name": "gpt-4-vision-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-0613",
|
||||
"name": "gpt-4-0613"
|
||||
@@ -419,6 +478,10 @@
|
||||
"label": "gpt-3.5-turbo",
|
||||
"name": "gpt-3.5-turbo"
|
||||
},
|
||||
{
|
||||
"label": "gpt-3.5-turbo-1106",
|
||||
"name": "gpt-3.5-turbo-1106"
|
||||
},
|
||||
{
|
||||
"label": "gpt-3.5-turbo-0613",
|
||||
"name": "gpt-3.5-turbo-0613"
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
"data": {
|
||||
"id": "openAIEmbeddings_0",
|
||||
"label": "OpenAI Embeddings",
|
||||
"version": 1,
|
||||
"version": 2,
|
||||
"name": "openAIEmbeddings",
|
||||
"type": "OpenAIEmbeddings",
|
||||
"baseClasses": ["OpenAIEmbeddings", "Embeddings"],
|
||||
@@ -28,6 +28,28 @@
|
||||
"credentialNames": ["openAIApi"],
|
||||
"id": "openAIEmbeddings_0-input-credential-credential"
|
||||
},
|
||||
{
|
||||
"label": "Model Name",
|
||||
"name": "modelName",
|
||||
"type": "options",
|
||||
"options": [
|
||||
{
|
||||
"label": "text-embedding-3-large",
|
||||
"name": "text-embedding-3-large"
|
||||
},
|
||||
{
|
||||
"label": "text-embedding-3-small",
|
||||
"name": "text-embedding-3-small"
|
||||
},
|
||||
{
|
||||
"label": "text-embedding-ada-002",
|
||||
"name": "text-embedding-ada-002"
|
||||
}
|
||||
],
|
||||
"default": "text-embedding-ada-002",
|
||||
"optional": true,
|
||||
"id": "openAIEmbeddings_0-input-modelName-options"
|
||||
},
|
||||
{
|
||||
"label": "Strip New Lines",
|
||||
"name": "stripNewLines",
|
||||
@@ -66,7 +88,8 @@
|
||||
"stripNewLines": "",
|
||||
"batchSize": "",
|
||||
"timeout": "",
|
||||
"basepath": ""
|
||||
"basepath": "",
|
||||
"modelName": "text-embedding-ada-002"
|
||||
},
|
||||
"outputAnchors": [
|
||||
{
|
||||
@@ -369,7 +392,7 @@
|
||||
"data": {
|
||||
"id": "chatOpenAI_0",
|
||||
"label": "ChatOpenAI",
|
||||
"version": 2,
|
||||
"version": 3,
|
||||
"name": "chatOpenAI",
|
||||
"type": "ChatOpenAI",
|
||||
"baseClasses": ["ChatOpenAI", "BaseChatModel", "BaseLanguageModel", "Runnable"],
|
||||
@@ -392,6 +415,14 @@
|
||||
"label": "gpt-4",
|
||||
"name": "gpt-4"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-turbo-preview",
|
||||
"name": "gpt-4-turbo-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-0125-preview",
|
||||
"name": "gpt-4-0125-preview"
|
||||
},
|
||||
{
|
||||
"label": "gpt-4-1106-preview",
|
||||
"name": "gpt-4-1106-preview"
|
||||
@@ -638,12 +669,12 @@
|
||||
"data": {
|
||||
"id": "pinecone_0",
|
||||
"label": "Pinecone",
|
||||
"version": 1,
|
||||
"version": 3,
|
||||
"name": "pinecone",
|
||||
"type": "Pinecone",
|
||||
"baseClasses": ["Pinecone", "VectorStoreRetriever", "BaseRetriever"],
|
||||
"category": "Vector Stores",
|
||||
"description": "Upsert embedded data and perform similarity search upon query using Pinecone, a leading fully managed hosted vector database",
|
||||
"description": "Upsert embedded data and perform similarity or mmr search using Pinecone, a leading fully managed hosted vector database",
|
||||
"inputParams": [
|
||||
{
|
||||
"label": "Connect Credential",
|
||||
@@ -684,6 +715,45 @@
|
||||
"additionalParams": true,
|
||||
"optional": true,
|
||||
"id": "pinecone_0-input-topK-number"
|
||||
},
|
||||
{
|
||||
"label": "Search Type",
|
||||
"name": "searchType",
|
||||
"type": "options",
|
||||
"default": "similarity",
|
||||
"options": [
|
||||
{
|
||||
"label": "Similarity",
|
||||
"name": "similarity"
|
||||
},
|
||||
{
|
||||
"label": "Max Marginal Relevance",
|
||||
"name": "mmr"
|
||||
}
|
||||
],
|
||||
"additionalParams": true,
|
||||
"optional": true,
|
||||
"id": "pinecone_0-input-searchType-options"
|
||||
},
|
||||
{
|
||||
"label": "Fetch K (for MMR Search)",
|
||||
"name": "fetchK",
|
||||
"description": "Number of initial documents to fetch for MMR reranking. Default to 20. Used only when the search type is MMR",
|
||||
"placeholder": "20",
|
||||
"type": "number",
|
||||
"additionalParams": true,
|
||||
"optional": true,
|
||||
"id": "pinecone_0-input-fetchK-number"
|
||||
},
|
||||
{
|
||||
"label": "Lambda (for MMR Search)",
|
||||
"name": "lambda",
|
||||
"description": "Number between 0 and 1 that determines the degree of diversity among the results, where 0 corresponds to maximum diversity and 1 to minimum diversity. Used only when the search type is MMR",
|
||||
"placeholder": "0.5",
|
||||
"type": "number",
|
||||
"additionalParams": true,
|
||||
"optional": true,
|
||||
"id": "pinecone_0-input-lambda-number"
|
||||
}
|
||||
],
|
||||
"inputAnchors": [
|
||||
@@ -708,7 +778,10 @@
|
||||
"pineconeIndex": "",
|
||||
"pineconeNamespace": "",
|
||||
"pineconeMetadataFilter": "",
|
||||
"topK": ""
|
||||
"topK": "",
|
||||
"searchType": "similarity",
|
||||
"fetchK": "",
|
||||
"lambda": ""
|
||||
},
|
||||
"outputAnchors": [
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "flowise",
|
||||
"version": "1.4.9",
|
||||
"version": "1.4.12",
|
||||
"description": "Flowiseai Server",
|
||||
"main": "dist/index",
|
||||
"types": "dist/index.d.ts",
|
||||
@@ -60,6 +60,7 @@
|
||||
"multer": "^1.4.5-lts.1",
|
||||
"mysql": "^2.18.1",
|
||||
"pg": "^8.11.1",
|
||||
"posthog-node": "^3.5.0",
|
||||
"reflect-metadata": "^0.1.13",
|
||||
"sanitize-html": "^2.11.0",
|
||||
"socket.io": "^4.6.1",
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import 'reflect-metadata'
|
||||
import path from 'path'
|
||||
import * as fs from 'fs'
|
||||
import { DataSource } from 'typeorm'
|
||||
import { getUserHome } from './utils'
|
||||
import { entities } from './database/entities'
|
||||
@@ -11,9 +12,13 @@ let appDataSource: DataSource
|
||||
|
||||
export const init = async (): Promise<void> => {
|
||||
let homePath
|
||||
let flowisePath = path.join(getUserHome(), '.flowise')
|
||||
if (!fs.existsSync(flowisePath)) {
|
||||
fs.mkdirSync(flowisePath)
|
||||
}
|
||||
switch (process.env.DATABASE_TYPE) {
|
||||
case 'sqlite':
|
||||
homePath = process.env.DATABASE_PATH ?? path.join(getUserHome(), '.flowise')
|
||||
homePath = process.env.DATABASE_PATH ?? flowisePath
|
||||
appDataSource = new DataSource({
|
||||
type: 'sqlite',
|
||||
database: path.resolve(homePath, 'database.sqlite'),
|
||||
@@ -35,7 +40,8 @@ export const init = async (): Promise<void> => {
|
||||
synchronize: false,
|
||||
migrationsRun: false,
|
||||
entities: Object.values(entities),
|
||||
migrations: mysqlMigrations
|
||||
migrations: mysqlMigrations,
|
||||
ssl: getDatabaseSSLFromEnv()
|
||||
})
|
||||
break
|
||||
case 'postgres':
|
||||
@@ -46,7 +52,7 @@ export const init = async (): Promise<void> => {
|
||||
username: process.env.DATABASE_USER,
|
||||
password: process.env.DATABASE_PASSWORD,
|
||||
database: process.env.DATABASE_NAME,
|
||||
ssl: process.env.DATABASE_SSL === 'true',
|
||||
ssl: getDatabaseSSLFromEnv(),
|
||||
synchronize: false,
|
||||
migrationsRun: false,
|
||||
entities: Object.values(entities),
|
||||
@@ -54,7 +60,7 @@ export const init = async (): Promise<void> => {
|
||||
})
|
||||
break
|
||||
default:
|
||||
homePath = process.env.DATABASE_PATH ?? path.join(getUserHome(), '.flowise')
|
||||
homePath = process.env.DATABASE_PATH ?? flowisePath
|
||||
appDataSource = new DataSource({
|
||||
type: 'sqlite',
|
||||
database: path.resolve(homePath, 'database.sqlite'),
|
||||
@@ -73,3 +79,15 @@ export function getDataSource(): DataSource {
|
||||
}
|
||||
return appDataSource
|
||||
}
|
||||
|
||||
const getDatabaseSSLFromEnv = () => {
|
||||
if (process.env.DATABASE_SSL_KEY_BASE64) {
|
||||
return {
|
||||
rejectUnauthorized: false,
|
||||
ca: Buffer.from(process.env.DATABASE_SSL_KEY_BASE64, 'base64')
|
||||
}
|
||||
} else if (process.env.DATABASE_SSL === 'true') {
|
||||
return true
|
||||
}
|
||||
return undefined
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ICommonObject, INode, INodeData as INodeDataFromComponent, INodeParams } from 'flowise-components'
|
||||
import { ICommonObject, IFileUpload, INode, INodeData as INodeDataFromComponent, INodeParams } from 'flowise-components'
|
||||
|
||||
export type MessageType = 'apiMessage' | 'userMessage'
|
||||
|
||||
@@ -177,7 +177,7 @@ export interface IncomingInput {
|
||||
socketIOClientId?: string
|
||||
chatId?: string
|
||||
stopNodeId?: string
|
||||
uploads?: string
|
||||
uploads?: IFileUpload[]
|
||||
}
|
||||
|
||||
export interface IActiveChatflows {
|
||||
|
||||
@@ -19,6 +19,8 @@ export default class Start extends Command {
|
||||
FLOWISE_USERNAME: Flags.string(),
|
||||
FLOWISE_PASSWORD: Flags.string(),
|
||||
PORT: Flags.string(),
|
||||
CORS_ORIGINS: Flags.string(),
|
||||
IFRAME_ORIGINS: Flags.string(),
|
||||
DEBUG: Flags.string(),
|
||||
APIKEY_PATH: Flags.string(),
|
||||
SECRETKEY_PATH: Flags.string(),
|
||||
@@ -36,10 +38,12 @@ export default class Start extends Command {
|
||||
DATABASE_USER: Flags.string(),
|
||||
DATABASE_PASSWORD: Flags.string(),
|
||||
DATABASE_SSL: Flags.string(),
|
||||
DATABASE_SSL_KEY_BASE64: Flags.string(),
|
||||
LANGCHAIN_TRACING_V2: Flags.string(),
|
||||
LANGCHAIN_ENDPOINT: Flags.string(),
|
||||
LANGCHAIN_API_KEY: Flags.string(),
|
||||
LANGCHAIN_PROJECT: Flags.string()
|
||||
LANGCHAIN_PROJECT: Flags.string(),
|
||||
DISABLE_FLOWISE_TELEMETRY: Flags.string()
|
||||
}
|
||||
|
||||
async stopProcess() {
|
||||
@@ -77,6 +81,8 @@ export default class Start extends Command {
|
||||
const { flags } = await this.parse(Start)
|
||||
|
||||
if (flags.PORT) process.env.PORT = flags.PORT
|
||||
if (flags.CORS_ORIGINS) process.env.CORS_ORIGINS = flags.CORS_ORIGINS
|
||||
if (flags.IFRAME_ORIGINS) process.env.IFRAME_ORIGINS = flags.IFRAME_ORIGINS
|
||||
if (flags.DEBUG) process.env.DEBUG = flags.DEBUG
|
||||
if (flags.NUMBER_OF_PROXIES) process.env.NUMBER_OF_PROXIES = flags.NUMBER_OF_PROXIES
|
||||
|
||||
@@ -106,6 +112,7 @@ export default class Start extends Command {
|
||||
if (flags.DATABASE_USER) process.env.DATABASE_USER = flags.DATABASE_USER
|
||||
if (flags.DATABASE_PASSWORD) process.env.DATABASE_PASSWORD = flags.DATABASE_PASSWORD
|
||||
if (flags.DATABASE_SSL) process.env.DATABASE_SSL = flags.DATABASE_SSL
|
||||
if (flags.DATABASE_SSL_KEY_BASE64) process.env.DATABASE_SSL_KEY_BASE64 = flags.DATABASE_SSL_KEY_BASE64
|
||||
|
||||
// Langsmith tracing
|
||||
if (flags.LANGCHAIN_TRACING_V2) process.env.LANGCHAIN_TRACING_V2 = flags.LANGCHAIN_TRACING_V2
|
||||
@@ -113,6 +120,9 @@ export default class Start extends Command {
|
||||
if (flags.LANGCHAIN_API_KEY) process.env.LANGCHAIN_API_KEY = flags.LANGCHAIN_API_KEY
|
||||
if (flags.LANGCHAIN_PROJECT) process.env.LANGCHAIN_PROJECT = flags.LANGCHAIN_PROJECT
|
||||
|
||||
// Telemetry
|
||||
if (flags.DISABLE_FLOWISE_TELEMETRY) process.env.DISABLE_FLOWISE_TELEMETRY = flags.DISABLE_FLOWISE_TELEMETRY
|
||||
|
||||
await (async () => {
|
||||
try {
|
||||
logger.info('Starting Flowise...')
|
||||
|
||||
+208
-78
@@ -47,7 +47,9 @@ import {
|
||||
getAllConnectedNodes,
|
||||
clearSessionMemory,
|
||||
findMemoryNode,
|
||||
deleteFolderRecursive
|
||||
deleteFolderRecursive,
|
||||
getTelemetryFlowObj,
|
||||
getAppVersion
|
||||
} from './utils'
|
||||
import { cloneDeep, omit, uniqWith, isEqual } from 'lodash'
|
||||
import { getDataSource } from './DataSource'
|
||||
@@ -66,14 +68,18 @@ import {
|
||||
INodeParams,
|
||||
handleEscapeCharacters,
|
||||
convertSpeechToText,
|
||||
xmlScrape,
|
||||
webCrawl,
|
||||
getStoragePath,
|
||||
IFileUpload
|
||||
} from 'flowise-components'
|
||||
import { createRateLimiter, getRateLimiter, initializeRateLimiter } from './utils/rateLimit'
|
||||
import { addAPIKey, compareKeys, deleteAPIKey, getApiKey, getAPIKeys, updateAPIKey } from './utils/apiKey'
|
||||
import { sanitizeMiddleware } from './utils/XSS'
|
||||
import { sanitizeMiddleware, getCorsOptions, getAllowedIframeOrigins } from './utils/XSS'
|
||||
import axios from 'axios'
|
||||
import { Client } from 'langchainhub'
|
||||
import { parsePrompt } from './utils/hub'
|
||||
import { Telemetry } from './utils/telemetry'
|
||||
import { Variable } from './database/entities/Variable'
|
||||
|
||||
export class App {
|
||||
@@ -81,6 +87,7 @@ export class App {
|
||||
nodesPool: NodesPool
|
||||
chatflowPool: ChatflowPool
|
||||
cachePool: CachePool
|
||||
telemetry: Telemetry
|
||||
AppDataSource = getDataSource()
|
||||
|
||||
constructor() {
|
||||
@@ -115,6 +122,9 @@ export class App {
|
||||
|
||||
// Initialize cache pool
|
||||
this.cachePool = new CachePool()
|
||||
|
||||
// Initialize telemetry
|
||||
this.telemetry = new Telemetry()
|
||||
})
|
||||
.catch((err) => {
|
||||
logger.error('❌ [server]: Error during Data Source initialization:', err)
|
||||
@@ -129,8 +139,20 @@ export class App {
|
||||
if (process.env.NUMBER_OF_PROXIES && parseInt(process.env.NUMBER_OF_PROXIES) > 0)
|
||||
this.app.set('trust proxy', parseInt(process.env.NUMBER_OF_PROXIES))
|
||||
|
||||
// Allow access from *
|
||||
this.app.use(cors())
|
||||
// Allow access from specified domains
|
||||
this.app.use(cors(getCorsOptions()))
|
||||
|
||||
// Allow embedding from specified domains.
|
||||
this.app.use((req, res, next) => {
|
||||
const allowedOrigins = getAllowedIframeOrigins()
|
||||
if (allowedOrigins == '*') {
|
||||
next()
|
||||
} else {
|
||||
const csp = `frame-ancestors ${allowedOrigins}`
|
||||
res.setHeader('Content-Security-Policy', csp)
|
||||
next()
|
||||
}
|
||||
})
|
||||
|
||||
// Switch off the default 'X-Powered-By: Express' header
|
||||
this.app.disable('x-powered-by')
|
||||
@@ -306,7 +328,13 @@ export class App {
|
||||
const nodeModule = await import(nodeInstanceFilePath)
|
||||
const newNodeInstance = new nodeModule.nodeClass()
|
||||
|
||||
const returnData = await newNodeInstance.init(nodeData)
|
||||
const options: ICommonObject = {
|
||||
appDataSource: this.AppDataSource,
|
||||
databaseEntities,
|
||||
logger
|
||||
}
|
||||
|
||||
const returnData = await newNodeInstance.init(nodeData, '', options)
|
||||
const result = typeof returnData === 'string' ? handleEscapeCharacters(returnData, true) : returnData
|
||||
|
||||
return res.json(result)
|
||||
@@ -394,6 +422,12 @@ export class App {
|
||||
const chatflow = this.AppDataSource.getRepository(ChatFlow).create(newChatFlow)
|
||||
const results = await this.AppDataSource.getRepository(ChatFlow).save(chatflow)
|
||||
|
||||
await this.telemetry.sendTelemetry('chatflow_created', {
|
||||
version: await getAppVersion(),
|
||||
chatlowId: results.id,
|
||||
flowGraph: getTelemetryFlowObj(JSON.parse(results.flowData)?.nodes, JSON.parse(results.flowData)?.edges)
|
||||
})
|
||||
|
||||
return res.json(results)
|
||||
})
|
||||
|
||||
@@ -433,11 +467,11 @@ export class App {
|
||||
const results = await this.AppDataSource.getRepository(ChatFlow).delete({ id: req.params.id })
|
||||
|
||||
try {
|
||||
/* Delete all multimodal uploads corresponding to this chatflow */
|
||||
const directory = path.join(getUserHome(), '.flowise', 'gptvision', req.params.id)
|
||||
// Delete all uploads corresponding to this chatflow
|
||||
const directory = path.join(getStoragePath(), req.params.id)
|
||||
deleteFolderRecursive(directory)
|
||||
} catch (e) {
|
||||
logger.error(`[server]: Error deleting multimodal uploads: ${e}`)
|
||||
logger.error(`[server]: Error deleting file storage for chatflow ${req.params.id}: ${e}`)
|
||||
}
|
||||
|
||||
return res.json(results)
|
||||
@@ -463,18 +497,25 @@ export class App {
|
||||
const endingNodes = nodes.filter((nd) => endingNodeIds.includes(nd.id))
|
||||
|
||||
let isStreaming = false
|
||||
let isEndingNodeExists = endingNodes.find((node) => node.data?.outputs?.output === 'EndingNode')
|
||||
|
||||
for (const endingNode of endingNodes) {
|
||||
const endingNodeData = endingNode.data
|
||||
if (!endingNodeData) return res.status(500).send(`Ending node ${endingNode.id} data not found`)
|
||||
|
||||
if (endingNodeData && endingNodeData.category !== 'Chains' && endingNodeData.category !== 'Agents') {
|
||||
return res.status(500).send(`Ending node must be either a Chain or Agent`)
|
||||
const isEndingNode = endingNodeData?.outputs?.output === 'EndingNode'
|
||||
|
||||
if (!isEndingNode) {
|
||||
if (endingNodeData && endingNodeData.category !== 'Chains' && endingNodeData.category !== 'Agents') {
|
||||
return res.status(500).send(`Ending node must be either a Chain or Agent`)
|
||||
}
|
||||
}
|
||||
|
||||
isStreaming = isFlowValidForStream(nodes, endingNodeData)
|
||||
isStreaming = isEndingNode ? false : isFlowValidForStream(nodes, endingNodeData)
|
||||
}
|
||||
|
||||
const obj = { isStreaming }
|
||||
// Once custom function ending node exists, flow is always unavailable to stream
|
||||
const obj = { isStreaming: isEndingNodeExists ? false : isStreaming }
|
||||
return res.json(obj)
|
||||
})
|
||||
|
||||
@@ -490,43 +531,55 @@ export class App {
|
||||
|
||||
try {
|
||||
const flowObj = JSON.parse(chatflow.flowData)
|
||||
const allowances: IUploadFileSizeAndTypes[] = []
|
||||
let allowSpeechToText = false
|
||||
const imgUploadSizeAndTypes: IUploadFileSizeAndTypes[] = []
|
||||
|
||||
let isSpeechToTextEnabled = false
|
||||
if (chatflow.speechToText) {
|
||||
const speechToTextProviders = JSON.parse(chatflow.speechToText)
|
||||
for (const provider in speechToTextProviders) {
|
||||
const providerObj = speechToTextProviders[provider]
|
||||
if (providerObj.status) {
|
||||
allowSpeechToText = true
|
||||
isSpeechToTextEnabled = true
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let allowImageUploads = false
|
||||
flowObj.nodes.forEach((node: IReactFlowNode) => {
|
||||
if (uploadProcessingNodes.indexOf(node.data.name) > -1) {
|
||||
logger.debug(`[server]: Found Eligible Node ${node.data.type}, Allowing Uploads.`)
|
||||
let isImageUploadAllowed = false
|
||||
const nodes: IReactFlowNode[] = flowObj.nodes
|
||||
|
||||
// there could be multiple components allowing uploads, so we check if it's already added
|
||||
/*
|
||||
* Condition for isImageUploadAllowed
|
||||
* 1.) one of the uploadAllowedNodes exists
|
||||
* 2.) one of the uploadProcessingNodes exists + allowImageUploads is ON
|
||||
*/
|
||||
if (!nodes.some((node) => uploadAllowedNodes.includes(node.data.name))) {
|
||||
return res.json({
|
||||
isSpeechToTextEnabled,
|
||||
isImageUploadAllowed: false,
|
||||
imgUploadSizeAndTypes
|
||||
})
|
||||
}
|
||||
|
||||
nodes.forEach((node: IReactFlowNode) => {
|
||||
if (uploadProcessingNodes.indexOf(node.data.name) > -1) {
|
||||
// TODO: for now the maxUploadSize is hardcoded to 5MB, we need to add it to the node properties
|
||||
node.data.inputParams.map((param: INodeParams) => {
|
||||
if (param.name === 'allowImageUploads' && node.data.inputs?.['allowImageUploads']) {
|
||||
allowances.push({
|
||||
imgUploadSizeAndTypes.push({
|
||||
fileTypes: 'image/gif;image/jpeg;image/png;image/webp;'.split(';'),
|
||||
maxUploadSize: 5
|
||||
})
|
||||
isImageUploadAllowed = true
|
||||
}
|
||||
})
|
||||
} else if (uploadAllowedNodes.indexOf(node.data.name) > -1 && !allowImageUploads) {
|
||||
allowImageUploads = true
|
||||
}
|
||||
})
|
||||
|
||||
return res.json({
|
||||
allowSpeechToText: allowSpeechToText,
|
||||
isUploadAllowed: allowImageUploads,
|
||||
uploadFileSizeAndTypes: allowances
|
||||
isSpeechToTextEnabled,
|
||||
isImageUploadAllowed,
|
||||
imgUploadSizeAndTypes
|
||||
})
|
||||
} catch (e) {
|
||||
return res.status(500).send(e)
|
||||
@@ -628,12 +681,14 @@ export class App {
|
||||
if (sessionId) deleteOptions.sessionId = sessionId
|
||||
if (chatType) deleteOptions.chatType = chatType
|
||||
|
||||
try {
|
||||
/* Delete all multimodal uploads corresponding to this chatflow */
|
||||
const directory = path.join(getUserHome(), '.flowise', 'gptvision', chatflowid)
|
||||
deleteFolderRecursive(directory)
|
||||
} catch (e) {
|
||||
logger.error(`[server]: Error deleting multimodal uploads: ${e}`)
|
||||
// Delete all uploads corresponding to this chatflow/chatId
|
||||
if (chatId) {
|
||||
try {
|
||||
const directory = path.join(getStoragePath(), chatflowid, chatId)
|
||||
deleteFolderRecursive(directory)
|
||||
} catch (e) {
|
||||
logger.error(`[server]: Error deleting file storage for chatflow ${chatflowid}, chatId ${chatId}: ${e}`)
|
||||
}
|
||||
}
|
||||
|
||||
const results = await this.AppDataSource.getRepository(ChatMessage).delete(deleteOptions)
|
||||
@@ -752,6 +807,12 @@ export class App {
|
||||
const tool = this.AppDataSource.getRepository(Tool).create(newTool)
|
||||
const results = await this.AppDataSource.getRepository(Tool).save(tool)
|
||||
|
||||
await this.telemetry.sendTelemetry('tool_created', {
|
||||
version: await getAppVersion(),
|
||||
toolId: results.id,
|
||||
toolName: results.name
|
||||
})
|
||||
|
||||
return res.json(results)
|
||||
})
|
||||
|
||||
@@ -958,6 +1019,11 @@ export class App {
|
||||
const assistant = this.AppDataSource.getRepository(Assistant).create(newAssistant)
|
||||
const results = await this.AppDataSource.getRepository(Assistant).save(assistant)
|
||||
|
||||
await this.telemetry.sendTelemetry('assistant_created', {
|
||||
version: await getAppVersion(),
|
||||
assistantId: results.id
|
||||
})
|
||||
|
||||
return res.json(results)
|
||||
})
|
||||
|
||||
@@ -1121,25 +1187,38 @@ export class App {
|
||||
if (filePath.includes('..')) return res.status(500).send(`Invalid file path`)
|
||||
//only return from the .flowise openai-assistant folder
|
||||
if (!(filePath.includes('.flowise') && filePath.includes('openai-assistant'))) return res.status(500).send(`Invalid file path`)
|
||||
res.setHeader('Content-Disposition', 'attachment; filename=' + path.basename(filePath))
|
||||
streamFileToUser(res, filePath)
|
||||
|
||||
if (fs.existsSync(filePath)) {
|
||||
res.setHeader('Content-Disposition', 'attachment; filename=' + path.basename(filePath))
|
||||
streamFileToUser(res, filePath)
|
||||
} else {
|
||||
return res.status(404).send(`File ${req.body.fileName} not found`)
|
||||
}
|
||||
})
|
||||
|
||||
// stream uploaded image
|
||||
this.app.get('/api/v1/get-upload-file/:id', async (req: Request, res: Response) => {
|
||||
if (!req.params.id || !req.query.chatId) {
|
||||
this.app.get('/api/v1/get-upload-file', async (req: Request, res: Response) => {
|
||||
if (!req.query.chatflowId || !req.query.chatId || !req.query.fileName) {
|
||||
return res.status(500).send(`Invalid file path`)
|
||||
}
|
||||
const filePath = path.join(getUserHome(), '.flowise', 'gptvision', req.query.chatId as string, req.params.id)
|
||||
const chatflowId = req.query.chatflowId as string
|
||||
const chatId = req.query.chatId as string
|
||||
const fileName = req.query.fileName as string
|
||||
|
||||
const filePath = path.join(getStoragePath(), chatflowId, chatId, fileName)
|
||||
//raise error if file path is not absolute
|
||||
if (!path.isAbsolute(filePath)) return res.status(500).send(`Invalid file path`)
|
||||
//raise error if file path contains '..'
|
||||
if (filePath.includes('..')) return res.status(500).send(`Invalid file path`)
|
||||
//only return from the .flowise gptvision folder
|
||||
if (!(filePath.includes('.flowise') && filePath.includes('gptvision') && filePath.includes(req.query.chatId as string)))
|
||||
return res.status(500).send(`Invalid file path`)
|
||||
res.setHeader('Content-Disposition', 'attachment; filename=' + path.basename(filePath))
|
||||
streamFileToUser(res, filePath)
|
||||
//only return from the storage folder
|
||||
if (!filePath.startsWith(getStoragePath())) return res.status(500).send(`Invalid file path`)
|
||||
|
||||
if (fs.existsSync(filePath)) {
|
||||
res.setHeader('Content-Disposition', 'attachment; filename=' + path.basename(filePath))
|
||||
streamFileToUser(res, filePath)
|
||||
} else {
|
||||
return res.status(404).send(`File ${fileName} not found`)
|
||||
}
|
||||
})
|
||||
|
||||
// ----------------------------------------
|
||||
@@ -1192,6 +1271,19 @@ export class App {
|
||||
}
|
||||
})
|
||||
|
||||
// ----------------------------------------
|
||||
// Scraper
|
||||
// ----------------------------------------
|
||||
|
||||
this.app.get('/api/v1/fetch-links', async (req: Request, res: Response) => {
|
||||
const url = decodeURIComponent(req.query.url as string)
|
||||
const relativeLinksMethod = req.query.relativeLinksMethod as string
|
||||
if (process.env.DEBUG === 'true') console.info(`Start ${relativeLinksMethod}`)
|
||||
const links: string[] = relativeLinksMethod === 'webCrawl' ? await webCrawl(url, 0) : await xmlScrape(url, 0)
|
||||
|
||||
res.json({ status: 'OK', links })
|
||||
})
|
||||
|
||||
// ----------------------------------------
|
||||
// Upsert
|
||||
// ----------------------------------------
|
||||
@@ -1553,6 +1645,11 @@ export class App {
|
||||
let chatId = incomingInput.chatId ?? ''
|
||||
let isUpsert = true
|
||||
|
||||
// Get session ID
|
||||
const memoryNode = findMemoryNode(nodes, edges)
|
||||
let sessionId = undefined
|
||||
if (memoryNode) sessionId = getMemorySessionId(memoryNode, incomingInput, chatId, isInternal)
|
||||
|
||||
const vsNodes = nodes.filter(
|
||||
(node) =>
|
||||
node.data.category === 'Vector Stores' &&
|
||||
@@ -1590,6 +1687,7 @@ export class App {
|
||||
incomingInput.question,
|
||||
chatHistory,
|
||||
chatId,
|
||||
sessionId ?? '',
|
||||
chatflowid,
|
||||
this.AppDataSource,
|
||||
incomingInput?.overrideConfig,
|
||||
@@ -1601,6 +1699,15 @@ export class App {
|
||||
const startingNodes = nodes.filter((nd) => startingNodeIds.includes(nd.data.id))
|
||||
|
||||
this.chatflowPool.add(chatflowid, undefined, startingNodes, incomingInput?.overrideConfig)
|
||||
|
||||
await this.telemetry.sendTelemetry('vector_upserted', {
|
||||
version: await getAppVersion(),
|
||||
chatlowId: chatflowid,
|
||||
type: isInternal ? chatType.INTERNAL : chatType.EXTERNAL,
|
||||
flowGraph: getTelemetryFlowObj(nodes, edges),
|
||||
stopNodeId
|
||||
})
|
||||
|
||||
return res.status(201).send('Successfully Upserted')
|
||||
} catch (e: any) {
|
||||
logger.error('[server]: Error:', e)
|
||||
@@ -1636,29 +1743,30 @@ export class App {
|
||||
if (!isKeyValidated) return res.status(401).send('Unauthorized')
|
||||
}
|
||||
|
||||
let fileUploads: IFileUpload[] = []
|
||||
if (incomingInput.uploads) {
|
||||
// @ts-ignore
|
||||
const uploads = incomingInput.uploads as IFileUpload[]
|
||||
for (const upload of uploads) {
|
||||
if (upload.type === 'file' || upload.type === 'audio') {
|
||||
fileUploads = incomingInput.uploads
|
||||
for (let i = 0; i < fileUploads.length; i += 1) {
|
||||
const upload = fileUploads[i]
|
||||
if ((upload.type === 'file' || upload.type === 'audio') && upload.data) {
|
||||
const filename = upload.name
|
||||
const dir = path.join(getUserHome(), '.flowise', 'gptvision', chatflowid)
|
||||
const dir = path.join(getStoragePath(), chatflowid, chatId)
|
||||
if (!fs.existsSync(dir)) {
|
||||
fs.mkdirSync(dir, { recursive: true })
|
||||
}
|
||||
const filePath = path.join(dir, filename)
|
||||
const splitDataURI = upload.data.split(',')
|
||||
const bf = Buffer.from(splitDataURI.pop() || '', 'base64')
|
||||
//writes data to a file, replacing the file if it already exists.
|
||||
fs.writeFileSync(filePath, bf)
|
||||
// don't need to store the file contents in chatmessage, just the filename and chatId
|
||||
upload.data = chatflowid
|
||||
|
||||
// Omit upload.data since we don't store the content in database
|
||||
upload.type = 'stored-file'
|
||||
fileUploads[i] = omit(upload, ['data'])
|
||||
}
|
||||
|
||||
// Run Speech to Text conversion
|
||||
if (upload.mime === 'audio/webm' && incomingInput.uploads?.length === 1) {
|
||||
//speechToText
|
||||
let speechToTextConfig: any = {}
|
||||
let speechToTextConfig: ICommonObject = {}
|
||||
if (chatflow.speechToText) {
|
||||
const speechToTextProviders = JSON.parse(chatflow.speechToText)
|
||||
for (const provider in speechToTextProviders) {
|
||||
@@ -1672,6 +1780,8 @@ export class App {
|
||||
}
|
||||
if (speechToTextConfig) {
|
||||
const options: ICommonObject = {
|
||||
chatId,
|
||||
chatflowid,
|
||||
appDataSource: this.AppDataSource,
|
||||
databaseEntities: databaseEntities
|
||||
}
|
||||
@@ -1715,6 +1825,12 @@ export class App {
|
||||
const nodes = parsedFlowData.nodes
|
||||
const edges = parsedFlowData.edges
|
||||
|
||||
// Get session ID
|
||||
const memoryNode = findMemoryNode(nodes, edges)
|
||||
const memoryType = memoryNode?.data.label
|
||||
let sessionId = undefined
|
||||
if (memoryNode) sessionId = getMemorySessionId(memoryNode, incomingInput, chatId, isInternal)
|
||||
|
||||
/* Reuse the flow without having to rebuild (to avoid duplicated upsert, recomputation, reinitialization of memory) when all these conditions met:
|
||||
* - Node Data already exists in pool
|
||||
* - Still in sync (i.e the flow has not been modified since)
|
||||
@@ -1750,29 +1866,39 @@ export class App {
|
||||
if (!endingNodeIds.length) return res.status(500).send(`Ending nodes not found`)
|
||||
|
||||
const endingNodes = nodes.filter((nd) => endingNodeIds.includes(nd.id))
|
||||
|
||||
let isEndingNodeExists = endingNodes.find((node) => node.data?.outputs?.output === 'EndingNode')
|
||||
|
||||
for (const endingNode of endingNodes) {
|
||||
const endingNodeData = endingNode.data
|
||||
if (!endingNodeData) return res.status(500).send(`Ending node ${endingNode.id} data not found`)
|
||||
|
||||
if (endingNodeData && endingNodeData.category !== 'Chains' && endingNodeData.category !== 'Agents') {
|
||||
return res.status(500).send(`Ending node must be either a Chain or Agent`)
|
||||
}
|
||||
const isEndingNode = endingNodeData?.outputs?.output === 'EndingNode'
|
||||
|
||||
if (
|
||||
endingNodeData.outputs &&
|
||||
Object.keys(endingNodeData.outputs).length &&
|
||||
!Object.values(endingNodeData.outputs).includes(endingNodeData.name)
|
||||
) {
|
||||
return res
|
||||
.status(500)
|
||||
.send(
|
||||
`Output of ${endingNodeData.label} (${endingNodeData.id}) must be ${endingNodeData.label}, can't be an Output Prediction`
|
||||
)
|
||||
if (!isEndingNode) {
|
||||
if (endingNodeData && endingNodeData.category !== 'Chains' && endingNodeData.category !== 'Agents') {
|
||||
return res.status(500).send(`Ending node must be either a Chain or Agent`)
|
||||
}
|
||||
|
||||
if (
|
||||
endingNodeData.outputs &&
|
||||
Object.keys(endingNodeData.outputs).length &&
|
||||
!Object.values(endingNodeData.outputs ?? {}).includes(endingNodeData.name)
|
||||
) {
|
||||
return res
|
||||
.status(500)
|
||||
.send(
|
||||
`Output of ${endingNodeData.label} (${endingNodeData.id}) must be ${endingNodeData.label}, can't be an Output Prediction`
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
isStreamValid = isFlowValidForStream(nodes, endingNodeData)
|
||||
}
|
||||
|
||||
// Once custom function ending node exists, flow is always unavailable to stream
|
||||
isStreamValid = isEndingNodeExists ? false : isStreamValid
|
||||
|
||||
let chatHistory: IMessage[] = incomingInput.history ?? []
|
||||
|
||||
// When {{chat_history}} is used in Prompt Template, fetch the chat conversations from memory node
|
||||
@@ -1824,6 +1950,7 @@ export class App {
|
||||
incomingInput.question,
|
||||
chatHistory,
|
||||
chatId,
|
||||
sessionId ?? '',
|
||||
chatflowid,
|
||||
this.AppDataSource,
|
||||
incomingInput?.overrideConfig,
|
||||
@@ -1853,12 +1980,6 @@ export class App {
|
||||
|
||||
logger.debug(`[server]: Running ${nodeToExecuteData.label} (${nodeToExecuteData.id})`)
|
||||
|
||||
const memoryNode = findMemoryNode(nodes, edges)
|
||||
const memoryType = memoryNode?.data.label
|
||||
|
||||
let sessionId = undefined
|
||||
if (memoryNode) sessionId = getMemorySessionId(memoryNode, incomingInput, chatId, isInternal)
|
||||
|
||||
const nodeInstanceFilePath = this.nodesPool.componentNodes[nodeToExecuteData.name].filePath as string
|
||||
const nodeModule = await import(nodeInstanceFilePath)
|
||||
const nodeInstance = new nodeModule.nodeClass({ sessionId })
|
||||
@@ -1903,7 +2024,7 @@ export class App {
|
||||
memoryType,
|
||||
sessionId,
|
||||
createdDate: userMessageDateTime,
|
||||
fileUploads: incomingInput.uploads ? JSON.stringify(incomingInput.uploads) : ''
|
||||
fileUploads: incomingInput.uploads ? JSON.stringify(fileUploads) : undefined
|
||||
}
|
||||
await this.addChatMessage(userMessage)
|
||||
|
||||
@@ -1924,12 +2045,22 @@ export class App {
|
||||
if (result?.sourceDocuments) apiMessage.sourceDocuments = JSON.stringify(result.sourceDocuments)
|
||||
if (result?.usedTools) apiMessage.usedTools = JSON.stringify(result.usedTools)
|
||||
if (result?.fileAnnotations) apiMessage.fileAnnotations = JSON.stringify(result.fileAnnotations)
|
||||
await this.addChatMessage(apiMessage)
|
||||
const chatMessage = await this.addChatMessage(apiMessage)
|
||||
|
||||
logger.debug(`[server]: Finished running ${nodeToExecuteData.label} (${nodeToExecuteData.id})`)
|
||||
await this.telemetry.sendTelemetry('prediction_sent', {
|
||||
version: await getAppVersion(),
|
||||
chatlowId: chatflowid,
|
||||
chatId,
|
||||
type: isInternal ? chatType.INTERNAL : chatType.EXTERNAL,
|
||||
flowGraph: getTelemetryFlowObj(nodes, edges)
|
||||
})
|
||||
|
||||
// Only return ChatId when its Internal OR incoming input has ChatId, to avoid confusion when calling API
|
||||
if (incomingInput.chatId || isInternal) result.chatId = chatId
|
||||
// Prepare response
|
||||
result.chatId = chatId
|
||||
result.chatMessageId = chatMessage.id
|
||||
if (sessionId) result.sessionId = sessionId
|
||||
if (memoryType) result.memoryType = memoryType
|
||||
|
||||
return res.json(result)
|
||||
} catch (e: any) {
|
||||
@@ -1941,6 +2072,7 @@ export class App {
|
||||
async stopApp() {
|
||||
try {
|
||||
const removePromises: any[] = []
|
||||
removePromises.push(this.telemetry.flush())
|
||||
await Promise.all(removePromises)
|
||||
} catch (e) {
|
||||
logger.error(`❌[server]: Flowise Server shut down error: ${e}`)
|
||||
@@ -1961,9 +2093,7 @@ export async function start(): Promise<void> {
|
||||
const server = http.createServer(serverApp.app)
|
||||
|
||||
const io = new Server(server, {
|
||||
cors: {
|
||||
origin: '*'
|
||||
}
|
||||
cors: getCorsOptions()
|
||||
})
|
||||
|
||||
await serverApp.initDatabase()
|
||||
|
||||
@@ -18,3 +18,28 @@ export function sanitizeMiddleware(req: Request, res: Response, next: NextFuncti
|
||||
}
|
||||
next()
|
||||
}
|
||||
|
||||
export function getAllowedCorsOrigins(): string {
|
||||
// Expects FQDN separated by commas, otherwise nothing or * for all.
|
||||
return process.env.CORS_ORIGINS ?? '*'
|
||||
}
|
||||
|
||||
export function getCorsOptions(): any {
|
||||
const corsOptions = {
|
||||
origin: function (origin: string | undefined, callback: (err: Error | null, allow?: boolean) => void) {
|
||||
const allowedOrigins = getAllowedCorsOrigins()
|
||||
if (!origin || allowedOrigins == '*' || allowedOrigins.indexOf(origin) !== -1) {
|
||||
callback(null, true)
|
||||
} else {
|
||||
callback(null, false)
|
||||
}
|
||||
}
|
||||
}
|
||||
return corsOptions
|
||||
}
|
||||
|
||||
export function getAllowedIframeOrigins(): string {
|
||||
// Expects FQDN separated by commas, otherwise nothing or * for all.
|
||||
// Also CSP allowed values: self or none
|
||||
return process.env.IFRAME_ORIGINS ?? '*'
|
||||
}
|
||||
|
||||
@@ -273,6 +273,7 @@ export const buildLangchain = async (
|
||||
question: string,
|
||||
chatHistory: IMessage[],
|
||||
chatId: string,
|
||||
sessionId: string,
|
||||
chatflowid: string,
|
||||
appDataSource: DataSource,
|
||||
overrideConfig?: ICommonObject,
|
||||
@@ -317,6 +318,7 @@ export const buildLangchain = async (
|
||||
logger.debug(`[server]: Upserting ${reactFlowNode.data.label} (${reactFlowNode.data.id})`)
|
||||
await newNodeInstance.vectorStoreMethods!['upsert']!.call(newNodeInstance, reactFlowNodeData, {
|
||||
chatId,
|
||||
sessionId,
|
||||
chatflowid,
|
||||
chatHistory,
|
||||
logger,
|
||||
@@ -331,6 +333,7 @@ export const buildLangchain = async (
|
||||
logger.debug(`[server]: Initializing ${reactFlowNode.data.label} (${reactFlowNode.data.id})`)
|
||||
let outputResult = await newNodeInstance.init(reactFlowNodeData, question, {
|
||||
chatId,
|
||||
sessionId,
|
||||
chatflowid,
|
||||
chatHistory,
|
||||
logger,
|
||||
@@ -607,28 +610,35 @@ export const resolveVariables = (
|
||||
export const replaceInputsWithConfig = (flowNodeData: INodeData, overrideConfig: ICommonObject) => {
|
||||
const types = 'inputs'
|
||||
|
||||
const getParamValues = (paramsObj: ICommonObject) => {
|
||||
const getParamValues = (inputsObj: ICommonObject) => {
|
||||
for (const config in overrideConfig) {
|
||||
// If overrideConfig[key] is object
|
||||
if (overrideConfig[config] && typeof overrideConfig[config] === 'object') {
|
||||
const nodeIds = Object.keys(overrideConfig[config])
|
||||
if (nodeIds.includes(flowNodeData.id)) {
|
||||
paramsObj[config] = overrideConfig[config][flowNodeData.id]
|
||||
inputsObj[config] = overrideConfig[config][flowNodeData.id]
|
||||
continue
|
||||
} else if (nodeIds.some((nodeId) => nodeId.includes(flowNodeData.name))) {
|
||||
/*
|
||||
* "systemMessagePrompt": {
|
||||
* "chatPromptTemplate_0": "You are an assistant" <---- continue for loop if current node is chatPromptTemplate_1
|
||||
* }
|
||||
*/
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
let paramValue = overrideConfig[config] ?? paramsObj[config]
|
||||
let paramValue = overrideConfig[config] ?? inputsObj[config]
|
||||
// Check if boolean
|
||||
if (paramValue === 'true') paramValue = true
|
||||
else if (paramValue === 'false') paramValue = false
|
||||
paramsObj[config] = paramValue
|
||||
inputsObj[config] = paramValue
|
||||
}
|
||||
}
|
||||
|
||||
const paramsObj = flowNodeData[types] ?? {}
|
||||
const inputsObj = flowNodeData[types] ?? {}
|
||||
|
||||
getParamValues(paramsObj)
|
||||
getParamValues(inputsObj)
|
||||
|
||||
return flowNodeData
|
||||
}
|
||||
@@ -1079,6 +1089,10 @@ export const getAllValuesFromJson = (obj: any): any[] => {
|
||||
return values
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete file & folder recursively
|
||||
* @param {string} directory
|
||||
*/
|
||||
export const deleteFolderRecursive = (directory: string) => {
|
||||
if (fs.existsSync(directory)) {
|
||||
fs.readdir(directory, (error, files) => {
|
||||
@@ -1102,3 +1116,60 @@ export const deleteFolderRecursive = (directory: string) => {
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get only essential flow data items for telemetry
|
||||
* @param {IReactFlowNode[]} nodes
|
||||
* @param {IReactFlowEdge[]} edges
|
||||
*/
|
||||
export const getTelemetryFlowObj = (nodes: IReactFlowNode[], edges: IReactFlowEdge[]) => {
|
||||
const nodeData = nodes.map((node) => node.id)
|
||||
const edgeData = edges.map((edge) => ({ source: edge.source, target: edge.target }))
|
||||
return { nodes: nodeData, edges: edgeData }
|
||||
}
|
||||
|
||||
/**
|
||||
* Get user settings file
|
||||
* TODO: move env variables to settings json file, easier configuration
|
||||
*/
|
||||
export const getUserSettingsFilePath = () => {
|
||||
if (process.env.SECRETKEY_PATH) return path.join(process.env.SECRETKEY_PATH, 'settings.json')
|
||||
const checkPaths = [path.join(getUserHome(), '.flowise', 'settings.json')]
|
||||
for (const checkPath of checkPaths) {
|
||||
if (fs.existsSync(checkPath)) {
|
||||
return checkPath
|
||||
}
|
||||
}
|
||||
return ''
|
||||
}
|
||||
|
||||
/**
|
||||
* Get app current version
|
||||
*/
|
||||
export const getAppVersion = async () => {
|
||||
const getPackageJsonPath = (): string => {
|
||||
const checkPaths = [
|
||||
path.join(__dirname, '..', 'package.json'),
|
||||
path.join(__dirname, '..', '..', 'package.json'),
|
||||
path.join(__dirname, '..', '..', '..', 'package.json'),
|
||||
path.join(__dirname, '..', '..', '..', '..', 'package.json'),
|
||||
path.join(__dirname, '..', '..', '..', '..', '..', 'package.json')
|
||||
]
|
||||
for (const checkPath of checkPaths) {
|
||||
if (fs.existsSync(checkPath)) {
|
||||
return checkPath
|
||||
}
|
||||
}
|
||||
return ''
|
||||
}
|
||||
|
||||
const packagejsonPath = getPackageJsonPath()
|
||||
if (!packagejsonPath) return ''
|
||||
try {
|
||||
const content = await fs.promises.readFile(packagejsonPath, 'utf8')
|
||||
const parsedContent = JSON.parse(content)
|
||||
return parsedContent.version
|
||||
} catch (error) {
|
||||
return ''
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
import { v4 as uuidv4 } from 'uuid'
|
||||
import { PostHog } from 'posthog-node'
|
||||
import path from 'path'
|
||||
import fs from 'fs'
|
||||
import { getUserHome, getUserSettingsFilePath } from '.'
|
||||
|
||||
export class Telemetry {
|
||||
postHog?: PostHog
|
||||
|
||||
constructor() {
|
||||
if (process.env.DISABLE_FLOWISE_TELEMETRY !== 'true') {
|
||||
this.postHog = new PostHog('phc_jEDuFYnOnuXsws986TLWzuisbRjwFqTl9JL8tDMgqme')
|
||||
} else {
|
||||
this.postHog = undefined
|
||||
}
|
||||
}
|
||||
|
||||
async id(): Promise<string> {
|
||||
try {
|
||||
const settingsContent = await fs.promises.readFile(getUserSettingsFilePath(), 'utf8')
|
||||
const settings = JSON.parse(settingsContent)
|
||||
return settings.instanceId
|
||||
} catch (error) {
|
||||
const instanceId = uuidv4()
|
||||
const settings = {
|
||||
instanceId
|
||||
}
|
||||
const defaultLocation = process.env.SECRETKEY_PATH
|
||||
? path.join(process.env.SECRETKEY_PATH, 'settings.json')
|
||||
: path.join(getUserHome(), '.flowise', 'settings.json')
|
||||
await fs.promises.writeFile(defaultLocation, JSON.stringify(settings, null, 2))
|
||||
return instanceId
|
||||
}
|
||||
}
|
||||
|
||||
async sendTelemetry(event: string, properties = {}): Promise<void> {
|
||||
if (this.postHog) {
|
||||
const distinctId = await this.id()
|
||||
this.postHog.capture({
|
||||
event,
|
||||
distinctId,
|
||||
properties
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
async flush(): Promise<void> {
|
||||
if (this.postHog) {
|
||||
await this.postHog.shutdownAsync()
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user