diff --git a/docs/src/content/docs/reference/components/pinecone.md b/docs/src/content/docs/reference/components/pinecone.md new file mode 100644 index 00000000000..4d66c8ccaa6 --- /dev/null +++ b/docs/src/content/docs/reference/components/pinecone.md @@ -0,0 +1,75 @@ +--- +title: "Pinecone" +description: "Pinecone is a vector database designed for efficient similarity search and storage of high-dimensional data, commonly used in machine learning and AI applications." +--- +## Reference +
+ +Pinecone is a vector database designed for efficient similarity search and storage of high-dimensional data, commonly used in machine learning and AI applications. + + +Categories: [artificial-intelligence] + + +Version: 1 + +
+ + + +## Connections + +Version: 1 + + +### null + +#### Properties + +| Name | Type | Control Type | Description | +|:--------------:|:------------:|:--------------------:|:-------------------:| +| Open AI API Key | STRING | TEXT | The API key for the OpenAI API which is used to generate embeddings. | +| Pinecone API Key | STRING | TEXT | The API key for the Pinecone API. | +| Environment | STRING | TEXT | Pinecone environment. | +| Project ID | STRING | TEXT | Pinecone project ID. | +| Index Name | STRING | TEXT | Pinecone index name. | + + + + + +
+ + + + + +## Actions + + +### Data Query +Query data from a Pinecone vector store using OpenAI embeddings. + +#### Properties + +| Name | Type | Control Type | Description | +|:--------------:|:------------:|:--------------------:|:-------------------:| +| Query | STRING | TEXT | The query to be executed. | + + + + +### Load Data +Loads data into a Pinecone vector store using OpenAI embeddings. + +#### Properties + +| Name | Type | Control Type | Description | +|:--------------:|:------------:|:--------------------:|:-------------------:| +| Document Type | STRING | SELECT | The type of the document. | +| JSON Keys to Use | [STRING] | ARRAY_BUILDER | Json keys on which extraction of content is based. If no keys are specified, it uses the entire JSON object as content. | +| FILE_ENTRY | FILE_ENTRY | + + + + diff --git a/server/libs/modules/components/ai/vector-store/build.gradle.kts b/server/libs/modules/components/ai/vector-store/build.gradle.kts index bbb662cb344..f399dfefdbe 100644 --- a/server/libs/modules/components/ai/vector-store/build.gradle.kts +++ b/server/libs/modules/components/ai/vector-store/build.gradle.kts @@ -2,6 +2,7 @@ version="1.0" dependencies { implementation("org.springframework.ai:spring-ai-openai:${rootProject.libs.versions.spring.ai.get()}") + implementation("org.springframework.ai:spring-ai-markdown-document-reader:${rootProject.libs.versions.spring.ai.get()}") implementation("org.springframework.ai:spring-ai-pdf-document-reader:${rootProject.libs.versions.spring.ai.get()}") implementation("org.springframework.ai:spring-ai-tika-document-reader:${rootProject.libs.versions.spring.ai.get()}") } diff --git a/server/libs/modules/components/ai/vector-store/pinecone/build.gradle.kts b/server/libs/modules/components/ai/vector-store/pinecone/build.gradle.kts index 75ad9ecd15c..75ca6c00517 100644 --- a/server/libs/modules/components/ai/vector-store/pinecone/build.gradle.kts +++ b/server/libs/modules/components/ai/vector-store/pinecone/build.gradle.kts @@ -3,7 +3,5 @@ version="1.0" dependencies { implementation("io.grpc:grpc-netty:1.69.0") implementation("org.springframework.ai:spring-ai-openai:${rootProject.libs.versions.spring.ai.get()}") - implementation("org.springframework.ai:spring-ai-pdf-document-reader:${rootProject.libs.versions.spring.ai.get()}") implementation("org.springframework.ai:spring-ai-pinecone-store:${rootProject.libs.versions.spring.ai.get()}") - implementation("org.springframework.ai:spring-ai-tika-document-reader:${rootProject.libs.versions.spring.ai.get()}") } diff --git a/server/libs/modules/components/ai/vector-store/pinecone/src/main/java/com/bytechef/component/ai/vectorstore/pinecone/action/PineconeDataQueryAction.java b/server/libs/modules/components/ai/vector-store/pinecone/src/main/java/com/bytechef/component/ai/vectorstore/pinecone/action/PineconeDataQueryAction.java index a6065d20dc5..5b6b7dd7f53 100644 --- a/server/libs/modules/components/ai/vector-store/pinecone/src/main/java/com/bytechef/component/ai/vectorstore/pinecone/action/PineconeDataQueryAction.java +++ b/server/libs/modules/components/ai/vector-store/pinecone/src/main/java/com/bytechef/component/ai/vectorstore/pinecone/action/PineconeDataQueryAction.java @@ -16,9 +16,10 @@ package com.bytechef.component.ai.vectorstore.pinecone.action; +import static com.bytechef.component.ai.vectorstore.constant.VectorStoreConstants.DATA_QUERY; +import static com.bytechef.component.ai.vectorstore.constant.VectorStoreConstants.EMBEDDING_API_KEY; import static com.bytechef.component.ai.vectorstore.constant.VectorStoreConstants.QUERY; import static com.bytechef.component.ai.vectorstore.pinecone.constant.PineconeConstants.API_KEY; -import static com.bytechef.component.ai.vectorstore.pinecone.constant.PineconeConstants.EMBEDDING_API_KEY; import static com.bytechef.component.ai.vectorstore.pinecone.constant.PineconeConstants.ENVIRONMENT; import static com.bytechef.component.ai.vectorstore.pinecone.constant.PineconeConstants.INDEX_NAME; import static com.bytechef.component.ai.vectorstore.pinecone.constant.PineconeConstants.PROJECT_ID; @@ -38,9 +39,9 @@ */ public class PineconeDataQueryAction { - public static final ModifiableActionDefinition ACTION_DEFINITION = action("dataQuery") + public static final ModifiableActionDefinition ACTION_DEFINITION = action(DATA_QUERY) .title("Data Query") - .description("Loads data into a Pinecone vector store using OpenAI embeddings.") + .description("Query data from a Pinecone vector store using OpenAI embeddings.") .properties( string(QUERY) .label("Query") diff --git a/server/libs/modules/components/ai/vector-store/pinecone/src/main/java/com/bytechef/component/ai/vectorstore/pinecone/action/PineconeLoadDataAction.java b/server/libs/modules/components/ai/vector-store/pinecone/src/main/java/com/bytechef/component/ai/vectorstore/pinecone/action/PineconeLoadDataAction.java index 516d7cb0bea..e67f6b2dd62 100644 --- a/server/libs/modules/components/ai/vector-store/pinecone/src/main/java/com/bytechef/component/ai/vectorstore/pinecone/action/PineconeLoadDataAction.java +++ b/server/libs/modules/components/ai/vector-store/pinecone/src/main/java/com/bytechef/component/ai/vectorstore/pinecone/action/PineconeLoadDataAction.java @@ -18,9 +18,10 @@ import static com.bytechef.component.ai.vectorstore.constant.VectorStoreConstants.DOCUMENT_PROPERTY; import static com.bytechef.component.ai.vectorstore.constant.VectorStoreConstants.DOCUMENT_TYPE_PROPERTY; +import static com.bytechef.component.ai.vectorstore.constant.VectorStoreConstants.EMBEDDING_API_KEY; import static com.bytechef.component.ai.vectorstore.constant.VectorStoreConstants.JSON_KEYS_TO_USE_PROPERTY; +import static com.bytechef.component.ai.vectorstore.constant.VectorStoreConstants.LOAD_DATA; import static com.bytechef.component.ai.vectorstore.pinecone.constant.PineconeConstants.API_KEY; -import static com.bytechef.component.ai.vectorstore.pinecone.constant.PineconeConstants.EMBEDDING_API_KEY; import static com.bytechef.component.ai.vectorstore.pinecone.constant.PineconeConstants.ENVIRONMENT; import static com.bytechef.component.ai.vectorstore.pinecone.constant.PineconeConstants.INDEX_NAME; import static com.bytechef.component.ai.vectorstore.pinecone.constant.PineconeConstants.PROJECT_ID; @@ -40,7 +41,7 @@ */ public class PineconeLoadDataAction { - public static final ModifiableActionDefinition ACTION_DEFINITION = action("loadData") + public static final ModifiableActionDefinition ACTION_DEFINITION = action(LOAD_DATA) .title("Load Data") .description("Loads data into a Pinecone vector store using OpenAI embeddings.") .properties( diff --git a/server/libs/modules/components/ai/vector-store/pinecone/src/main/java/com/bytechef/component/ai/vectorstore/pinecone/connection/PineconeConnection.java b/server/libs/modules/components/ai/vector-store/pinecone/src/main/java/com/bytechef/component/ai/vectorstore/pinecone/connection/PineconeConnection.java index 65f25c0baea..d83fab0b669 100644 --- a/server/libs/modules/components/ai/vector-store/pinecone/src/main/java/com/bytechef/component/ai/vectorstore/pinecone/connection/PineconeConnection.java +++ b/server/libs/modules/components/ai/vector-store/pinecone/src/main/java/com/bytechef/component/ai/vectorstore/pinecone/connection/PineconeConnection.java @@ -16,8 +16,8 @@ package com.bytechef.component.ai.vectorstore.pinecone.connection; +import static com.bytechef.component.ai.vectorstore.constant.VectorStoreConstants.EMBEDDING_API_KEY_PROPERTY; import static com.bytechef.component.ai.vectorstore.pinecone.constant.PineconeConstants.API_KEY; -import static com.bytechef.component.ai.vectorstore.pinecone.constant.PineconeConstants.EMBEDDING_API_KEY; import static com.bytechef.component.ai.vectorstore.pinecone.constant.PineconeConstants.ENVIRONMENT; import static com.bytechef.component.ai.vectorstore.pinecone.constant.PineconeConstants.INDEX_NAME; import static com.bytechef.component.ai.vectorstore.pinecone.constant.PineconeConstants.PROJECT_ID; @@ -37,10 +37,7 @@ public class PineconeConnection { .authorizations( authorization(CUSTOM) .properties( - string(EMBEDDING_API_KEY) - .label("Open AI API Key") - .description("The API key for the OpenAI API which is used to generate embeddings.") - .required(true), + EMBEDDING_API_KEY_PROPERTY, string(API_KEY) .label("Pinecone API Key") .description("The API key for the Pinecone API.") diff --git a/server/libs/modules/components/ai/vector-store/pinecone/src/main/java/com/bytechef/component/ai/vectorstore/pinecone/constant/PineconeConstants.java b/server/libs/modules/components/ai/vector-store/pinecone/src/main/java/com/bytechef/component/ai/vectorstore/pinecone/constant/PineconeConstants.java index 4660df57e5a..e75c71f6392 100644 --- a/server/libs/modules/components/ai/vector-store/pinecone/src/main/java/com/bytechef/component/ai/vectorstore/pinecone/constant/PineconeConstants.java +++ b/server/libs/modules/components/ai/vector-store/pinecone/src/main/java/com/bytechef/component/ai/vectorstore/pinecone/constant/PineconeConstants.java @@ -25,7 +25,6 @@ private PineconeConstants() { } public static final String API_KEY = "apiKey"; - public static final String EMBEDDING_API_KEY = "embeddingApiKey"; public static final String ENVIRONMENT = "environment"; public static final String INDEX_NAME = "indexName"; public static final String PROJECT_ID = "projectId"; diff --git a/server/libs/modules/components/ai/vector-store/pinecone/src/test/resources/definition/pinecone_v1.json b/server/libs/modules/components/ai/vector-store/pinecone/src/test/resources/definition/pinecone_v1.json new file mode 100644 index 00000000000..60c32d1e428 --- /dev/null +++ b/server/libs/modules/components/ai/vector-store/pinecone/src/test/resources/definition/pinecone_v1.json @@ -0,0 +1,377 @@ +{ + "categories" : [ { + "key" : "artificial-intelligence", + "label" : "artificial-intelligence" + } ], + "customAction" : null, + "customActionHelp" : null, + "description" : "Pinecone is a vector database designed for efficient similarity search and storage of high-dimensional data, commonly used in machine learning and AI applications.", + "icon" : "path:assets/pinecone.svg", + "tags" : null, + "metadata" : null, + "name" : "pinecone", + "resources" : null, + "version" : 1, + "title" : "Pinecone", + "actions" : [ { + "batch" : null, + "deprecated" : null, + "description" : "Query data from a Pinecone vector store using OpenAI embeddings.", + "help" : null, + "metadata" : null, + "name" : "dataQuery", + "outputDefinition" : { + "output" : null, + "outputResponse" : null, + "outputSchema" : null, + "sampleOutput" : null + }, + "properties" : [ { + "advancedOption" : null, + "description" : "The query to be executed.", + "displayCondition" : null, + "expressionEnabled" : null, + "hidden" : null, + "metadata" : { }, + "required" : true, + "name" : "query", + "type" : "STRING", + "defaultValue" : null, + "exampleValue" : null, + "label" : "Query", + "placeholder" : null, + "controlType" : "TEXT", + "languageId" : null, + "maxLength" : null, + "minLength" : null, + "options" : null, + "optionsDataSource" : null + } ], + "title" : "Data Query", + "processErrorResponse" : null, + "perform" : { }, + "workflowNodeDescription" : null + }, { + "batch" : null, + "deprecated" : null, + "description" : "Loads data into a Pinecone vector store using OpenAI embeddings.", + "help" : null, + "metadata" : null, + "name" : "loadData", + "outputDefinition" : null, + "properties" : [ { + "advancedOption" : null, + "description" : "The type of the document.", + "displayCondition" : null, + "expressionEnabled" : null, + "hidden" : null, + "metadata" : { }, + "required" : true, + "name" : "documentType", + "type" : "STRING", + "defaultValue" : null, + "exampleValue" : null, + "label" : "Document Type", + "placeholder" : null, + "controlType" : "SELECT", + "languageId" : null, + "maxLength" : null, + "minLength" : null, + "options" : [ { + "description" : null, + "label" : "JSON document", + "value" : "json" + }, { + "description" : null, + "label" : "Markdown document", + "value" : "md" + }, { + "description" : null, + "label" : "PDF document", + "value" : "pdf" + }, { + "description" : null, + "label" : "text document", + "value" : "txt" + }, { + "description" : null, + "label" : "Tika (DOCX, PPTX, HTML...)", + "value" : "tika" + } ], + "optionsDataSource" : null + }, { + "advancedOption" : null, + "description" : "Json keys on which extraction of content is based. If no keys are specified, it uses the entire JSON object as content.", + "displayCondition" : "document == 'json'", + "expressionEnabled" : null, + "hidden" : null, + "metadata" : { }, + "required" : false, + "name" : "jsonKeysToUse", + "type" : "ARRAY", + "defaultValue" : null, + "exampleValue" : null, + "label" : "JSON Keys to Use", + "placeholder" : null, + "items" : [ { + "advancedOption" : null, + "description" : null, + "displayCondition" : null, + "expressionEnabled" : null, + "hidden" : null, + "metadata" : { }, + "required" : null, + "name" : null, + "type" : "STRING", + "defaultValue" : null, + "exampleValue" : null, + "label" : null, + "placeholder" : null, + "controlType" : "TEXT", + "languageId" : null, + "maxLength" : null, + "minLength" : null, + "options" : null, + "optionsDataSource" : null + } ], + "maxItems" : null, + "minItems" : null, + "multipleValues" : null, + "options" : null, + "controlType" : "ARRAY_BUILDER", + "optionsDataSource" : null + }, { + "advancedOption" : null, + "description" : null, + "displayCondition" : null, + "expressionEnabled" : null, + "hidden" : null, + "metadata" : { }, + "required" : true, + "name" : "document", + "type" : "FILE_ENTRY", + "defaultValue" : null, + "exampleValue" : null, + "label" : null, + "placeholder" : null, + "properties" : [ { + "advancedOption" : null, + "description" : null, + "displayCondition" : null, + "expressionEnabled" : null, + "hidden" : null, + "metadata" : { }, + "required" : true, + "name" : "extension", + "type" : "STRING", + "defaultValue" : null, + "exampleValue" : null, + "label" : null, + "placeholder" : null, + "controlType" : "TEXT", + "languageId" : null, + "maxLength" : null, + "minLength" : null, + "options" : null, + "optionsDataSource" : null + }, { + "advancedOption" : null, + "description" : null, + "displayCondition" : null, + "expressionEnabled" : null, + "hidden" : null, + "metadata" : { }, + "required" : true, + "name" : "mimeType", + "type" : "STRING", + "defaultValue" : null, + "exampleValue" : null, + "label" : null, + "placeholder" : null, + "controlType" : "TEXT", + "languageId" : null, + "maxLength" : null, + "minLength" : null, + "options" : null, + "optionsDataSource" : null + }, { + "advancedOption" : null, + "description" : null, + "displayCondition" : null, + "expressionEnabled" : null, + "hidden" : null, + "metadata" : { }, + "required" : true, + "name" : "name", + "type" : "STRING", + "defaultValue" : null, + "exampleValue" : null, + "label" : null, + "placeholder" : null, + "controlType" : "TEXT", + "languageId" : null, + "maxLength" : null, + "minLength" : null, + "options" : null, + "optionsDataSource" : null + }, { + "advancedOption" : null, + "description" : null, + "displayCondition" : null, + "expressionEnabled" : null, + "hidden" : null, + "metadata" : { }, + "required" : true, + "name" : "url", + "type" : "STRING", + "defaultValue" : null, + "exampleValue" : null, + "label" : null, + "placeholder" : null, + "controlType" : "TEXT", + "languageId" : null, + "maxLength" : null, + "minLength" : null, + "options" : null, + "optionsDataSource" : null + } ], + "controlType" : "FILE_ENTRY" + } ], + "title" : "Load Data", + "processErrorResponse" : null, + "perform" : { }, + "workflowNodeDescription" : null + } ], + "dataStream" : null, + "triggers" : null, + "unifiedApi" : null, + "connection" : { + "authorizations" : [ { + "detectOn" : null, + "description" : null, + "name" : "custom", + "properties" : [ { + "advancedOption" : null, + "description" : "The API key for the OpenAI API which is used to generate embeddings.", + "displayCondition" : null, + "expressionEnabled" : null, + "hidden" : null, + "metadata" : { }, + "required" : true, + "name" : "embeddingApiKey", + "type" : "STRING", + "defaultValue" : null, + "exampleValue" : null, + "label" : "Open AI API Key", + "placeholder" : null, + "controlType" : "TEXT", + "languageId" : null, + "maxLength" : null, + "minLength" : null, + "options" : null, + "optionsDataSource" : null + }, { + "advancedOption" : null, + "description" : "The API key for the Pinecone API.", + "displayCondition" : null, + "expressionEnabled" : null, + "hidden" : null, + "metadata" : { }, + "required" : true, + "name" : "apiKey", + "type" : "STRING", + "defaultValue" : null, + "exampleValue" : null, + "label" : "Pinecone API Key", + "placeholder" : null, + "controlType" : "TEXT", + "languageId" : null, + "maxLength" : null, + "minLength" : null, + "options" : null, + "optionsDataSource" : null + }, { + "advancedOption" : null, + "description" : "Pinecone environment.", + "displayCondition" : null, + "expressionEnabled" : null, + "hidden" : null, + "metadata" : { }, + "required" : true, + "name" : "environment", + "type" : "STRING", + "defaultValue" : "gcp-starter", + "exampleValue" : null, + "label" : "Environment", + "placeholder" : null, + "controlType" : "TEXT", + "languageId" : null, + "maxLength" : null, + "minLength" : null, + "options" : null, + "optionsDataSource" : null + }, { + "advancedOption" : null, + "description" : "Pinecone project ID.", + "displayCondition" : null, + "expressionEnabled" : null, + "hidden" : null, + "metadata" : { }, + "required" : true, + "name" : "projectId", + "type" : "STRING", + "defaultValue" : null, + "exampleValue" : null, + "label" : "Project ID", + "placeholder" : null, + "controlType" : "TEXT", + "languageId" : null, + "maxLength" : null, + "minLength" : null, + "options" : null, + "optionsDataSource" : null + }, { + "advancedOption" : null, + "description" : "Pinecone index name.", + "displayCondition" : null, + "expressionEnabled" : null, + "hidden" : null, + "metadata" : { }, + "required" : true, + "name" : "indexName", + "type" : "STRING", + "defaultValue" : null, + "exampleValue" : null, + "label" : "Index Name", + "placeholder" : null, + "controlType" : "TEXT", + "languageId" : null, + "maxLength" : null, + "minLength" : null, + "options" : null, + "optionsDataSource" : null + } ], + "refreshOn" : null, + "title" : null, + "type" : "CUSTOM", + "acquire" : null, + "pkce" : null, + "apply" : null, + "refresh" : null, + "authorizationCallback" : null, + "scopes" : null, + "authorizationUrl" : null, + "clientId" : null, + "clientSecret" : null, + "oauth2AuthorizationExtraQueryParameters" : null, + "refreshUrl" : null, + "refreshToken" : null, + "tokenUrl" : null + } ], + "properties" : null, + "version" : 1, + "authorizationRequired" : null, + "baseUri" : null, + "test" : null + } +} \ No newline at end of file diff --git a/server/libs/modules/components/ai/vector-store/src/main/java/com/bytechef/component/ai/vectorstore/VectorStore.java b/server/libs/modules/components/ai/vector-store/src/main/java/com/bytechef/component/ai/vectorstore/VectorStore.java index 9563940eeca..0256d2d6901 100644 --- a/server/libs/modules/components/ai/vector-store/src/main/java/com/bytechef/component/ai/vectorstore/VectorStore.java +++ b/server/libs/modules/components/ai/vector-store/src/main/java/com/bytechef/component/ai/vectorstore/VectorStore.java @@ -20,6 +20,7 @@ import static com.bytechef.component.ai.vectorstore.constant.VectorStoreConstants.DOCUMENT_TYPE; import static com.bytechef.component.ai.vectorstore.constant.VectorStoreConstants.JSON; import static com.bytechef.component.ai.vectorstore.constant.VectorStoreConstants.JSON_KEYS_TO_USE; +import static com.bytechef.component.ai.vectorstore.constant.VectorStoreConstants.MD; import static com.bytechef.component.ai.vectorstore.constant.VectorStoreConstants.PDF; import static com.bytechef.component.ai.vectorstore.constant.VectorStoreConstants.QUERY; import static com.bytechef.component.ai.vectorstore.constant.VectorStoreConstants.TIKA; @@ -35,6 +36,8 @@ import org.springframework.ai.reader.ExtractedTextFormatter; import org.springframework.ai.reader.JsonReader; import org.springframework.ai.reader.TextReader; +import org.springframework.ai.reader.markdown.MarkdownDocumentReader; +import org.springframework.ai.reader.markdown.config.MarkdownDocumentReaderConfig; import org.springframework.ai.reader.pdf.PagePdfDocumentReader; import org.springframework.ai.reader.pdf.config.PdfDocumentReaderConfig; import org.springframework.ai.reader.tika.TikaDocumentReader; @@ -72,6 +75,21 @@ default void loadData(Parameters inputParameters, Parameters connectionParameter vectorStore.add(documents); } + case MD -> { + MarkdownDocumentReaderConfig markdownDocumentReaderConfig = MarkdownDocumentReaderConfig.builder() + .withHorizontalRuleCreateDocument(true) + .withIncludeCodeBlock(false) + .withIncludeBlockquote(false) + .withAdditionalMetadata("filename", fileEntry.getName()) + .build(); + + MarkdownDocumentReader markdownDocumentReader = + new MarkdownDocumentReader(fileSystemResource, markdownDocumentReaderConfig); + + List documents = markdownDocumentReader.get(); + + vectorStore.add(documents); + } case PDF -> { PagePdfDocumentReader pdfReader = new PagePdfDocumentReader( fileSystemResource, diff --git a/server/libs/modules/components/ai/vector-store/src/main/java/com/bytechef/component/ai/vectorstore/constant/VectorStoreConstants.java b/server/libs/modules/components/ai/vector-store/src/main/java/com/bytechef/component/ai/vectorstore/constant/VectorStoreConstants.java index 34b3378599f..a0570ffb907 100644 --- a/server/libs/modules/components/ai/vector-store/src/main/java/com/bytechef/component/ai/vectorstore/constant/VectorStoreConstants.java +++ b/server/libs/modules/components/ai/vector-store/src/main/java/com/bytechef/component/ai/vectorstore/constant/VectorStoreConstants.java @@ -30,10 +30,14 @@ */ public class VectorStoreConstants { + public static final String DATA_QUERY = "dataQuery"; public static final String DOCUMENT = "document"; public static final String DOCUMENT_TYPE = "documentType"; + public static final String EMBEDDING_API_KEY = "embeddingApiKey"; public static final String JSON = "json"; public static final String JSON_KEYS_TO_USE = "jsonKeysToUse"; + public static final String LOAD_DATA = "loadData"; + public static final String MD = "md"; public static final String PDF = "pdf"; public static final String TIKA = "tika"; public static final String TXT = "txt"; @@ -47,17 +51,23 @@ public class VectorStoreConstants { .description("The type of the document.") .options( option("JSON document", JSON), - option("text document", TXT), + option("Markdown document", MD), option("PDF document", PDF), + option("text document", TXT), option("Tika (DOCX, PPTX, HTML...)", TIKA)) .required(true); + public static final ModifiableStringProperty EMBEDDING_API_KEY_PROPERTY = string(EMBEDDING_API_KEY) + .label("Open AI API Key") + .description("The API key for the OpenAI API which is used to generate embeddings.") + .required(true); + public static final ModifiableArrayProperty JSON_KEYS_TO_USE_PROPERTY = array(JSON_KEYS_TO_USE) .label("JSON Keys to Use") .description( "Json keys on which extraction of content is based. If no keys are specified, it uses the entire " + "JSON object as content.") - .displayCondition("%s == '%s".formatted(DOCUMENT, JSON)) + .displayCondition("%s == '%s'".formatted(DOCUMENT, JSON)) .items(string()) .required(false);