mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
feat: Update tool vector store
This commit is contained in:
parent
752b87a248
commit
c2efb7cab0
|
@ -1,3 +1,7 @@
|
||||||
|
import type { BaseLanguageModel } from '@langchain/core/language_models/base';
|
||||||
|
import type { VectorStore } from '@langchain/core/vectorstores';
|
||||||
|
import { VectorDBQAChain } from 'langchain/chains';
|
||||||
|
import { VectorStoreQATool } from 'langchain/tools';
|
||||||
import type {
|
import type {
|
||||||
INodeType,
|
INodeType,
|
||||||
INodeTypeDescription,
|
INodeTypeDescription,
|
||||||
|
@ -6,23 +10,19 @@ import type {
|
||||||
} from 'n8n-workflow';
|
} from 'n8n-workflow';
|
||||||
import { NodeConnectionType } from 'n8n-workflow';
|
import { NodeConnectionType } from 'n8n-workflow';
|
||||||
|
|
||||||
import { VectorStoreQATool } from 'langchain/tools';
|
|
||||||
import type { VectorStore } from '@langchain/core/vectorstores';
|
|
||||||
import type { BaseLanguageModel } from '@langchain/core/language_models/base';
|
|
||||||
import { VectorDBQAChain } from 'langchain/chains';
|
|
||||||
import { getConnectionHintNoticeField } from '../../../utils/sharedFields';
|
|
||||||
import { logWrapper } from '../../../utils/logWrapper';
|
import { logWrapper } from '../../../utils/logWrapper';
|
||||||
|
import { getConnectionHintNoticeField } from '../../../utils/sharedFields';
|
||||||
|
|
||||||
export class ToolVectorStore implements INodeType {
|
export class ToolVectorStore implements INodeType {
|
||||||
description: INodeTypeDescription = {
|
description: INodeTypeDescription = {
|
||||||
displayName: 'Vector Store Tool',
|
displayName: 'Vector Store QA Tool',
|
||||||
name: 'toolVectorStore',
|
name: 'toolVectorStore',
|
||||||
icon: 'fa:database',
|
icon: 'fa:database',
|
||||||
group: ['transform'],
|
group: ['transform'],
|
||||||
version: [1],
|
version: [1],
|
||||||
description: 'Retrieve context from vector store',
|
description: 'Answers queries on vector store and summarizes response',
|
||||||
defaults: {
|
defaults: {
|
||||||
name: 'Vector Store Tool',
|
name: 'Vector Store QA Tool',
|
||||||
},
|
},
|
||||||
codex: {
|
codex: {
|
||||||
categories: ['AI'],
|
categories: ['AI'],
|
||||||
|
@ -59,20 +59,23 @@ export class ToolVectorStore implements INodeType {
|
||||||
properties: [
|
properties: [
|
||||||
getConnectionHintNoticeField([NodeConnectionType.AiAgent]),
|
getConnectionHintNoticeField([NodeConnectionType.AiAgent]),
|
||||||
{
|
{
|
||||||
displayName: 'Name',
|
displayName: 'Data Name',
|
||||||
name: 'name',
|
name: 'name',
|
||||||
type: 'string',
|
type: 'string',
|
||||||
default: '',
|
default: '',
|
||||||
placeholder: 'e.g. company_knowledge_base',
|
placeholder: 'e.g. users_info',
|
||||||
validateType: 'string-alphanumeric',
|
validateType: 'string-alphanumeric',
|
||||||
description: 'Name of the vector store',
|
description:
|
||||||
|
'Name of the data type in vector store. This will be used to fill this tool description: Useful for when you need to answer questions about [name]. Whenever you need information about [data description], you should ALWAYS use this. Input should be a fully formed question.',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
displayName: 'Description',
|
displayName: "Data's Description",
|
||||||
name: 'description',
|
name: 'description',
|
||||||
type: 'string',
|
type: 'string',
|
||||||
default: '',
|
default: '',
|
||||||
placeholder: 'Retrieves data about [insert information about your data here]...',
|
placeholder: "[Describe your data here, e.g. a user's name, email, etc.]",
|
||||||
|
description:
|
||||||
|
'Describe data in vector store here. This will be used to fill this tool description: Useful for when you need to answer questions about [name]. Whenever you need information about [data description], you should ALWAYS use this. Input should be a fully formed question.',
|
||||||
typeOptions: {
|
typeOptions: {
|
||||||
rows: 3,
|
rows: 3,
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue