AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents
TypeScript ai-agentai-agent-toolsai-agentsai-agents-frameworkmcpmcp-servermcp-toolsmcpsn8n-alternativeno-code-automationworkflowworkflow-automationworkflows
feat(pinecone): add AI actions and output schemas (#16665)
Kishan Parmarfcb6744f0f8e
diff --git a/bun.lock b/bun.lockindex 025f1980bc2..d7667b2246d 100644--- a/bun.lock+++ b/bun.lock@@ -7110,16 +7110,16 @@},"packages/pieces/community/pinecone": {"name": "@activepieces/piece-pinecone",- "version": "0.1.7",+ "version": "0.2.0","dependencies": {"@activepieces/core-piece-types": "workspace:*","@activepieces/core-utils": "workspace:*","@activepieces/pieces-common": "workspace:*","@activepieces/pieces-framework": "workspace:*",- "@pinecone-database/pinecone": "^6.1.1",+ "@pinecone-database/pinecone": "9.0.0",},"devDependencies": {- "tslib": "^2.3.0",+ "tslib": "2.8.1",},},"packages/pieces/community/pinterest": {@@ -13979,7 +13979,7 @@"@pdf-lib/upng": ["@pdf-lib/[email protected]", "", { "dependencies": { "pako": "^1.0.10" } }, "sha512-dQK2FUMQtowVP00mtIksrlZhdFXQZPC+taih1q4CvPZ5vqdxR/LKBaFg0oAfzd1GlHZXXSPdQfzQnt+ViGvEIQ=="],- "@pinecone-database/pinecone": ["@pinecone-database/[email protected]", "", {}, "sha512-wkipvpkBYNGYDeYj4azVVyCzSrekJE3Pgo0HImkbw80SGnTo9gz5kSbDCXCfVvFnhqC2q4nGikdTUvFCDiuruA=="],+ "@pinecone-database/pinecone": ["@pinecone-database/[email protected]", "", {}, "sha512-2SEZEGbQPJTXWiRKSQJghqe7XjfmMRtLvkCdjPc5o+vxTa4ufgSid8j2wd+uQkX2B+n6h8+82SGGeTLttvGZGA=="],"@pinojs/redact": ["@pinojs/[email protected]", "", {}, "sha512-k2ENnmBugE/rzQfEcdWHcCY+/FM3VLzH9cYEsbdsoqrvzAKRhUZeRNhAZvB8OitQJ1TBed3yqWtdjzS6wJKBwg=="],diff --git a/packages/pieces/community/pinecone/package.json b/packages/pieces/community/pinecone/package.jsonindex f78ec3dc02a..2a283cf658d 100644--- a/packages/pieces/community/pinecone/package.json+++ b/packages/pieces/community/pinecone/package.json@@ -1,18 +1,18 @@{"name": "@activepieces/piece-pinecone",- "version": "0.1.7",+ "version": "0.2.0","type": "commonjs","main": "./dist/src/index.js","types": "./dist/src/index.d.ts","dependencies": {"@activepieces/pieces-common": "workspace:*","@activepieces/pieces-framework": "workspace:*",- "@pinecone-database/pinecone": "^6.1.1",+ "@pinecone-database/pinecone": "9.0.0","@activepieces/core-piece-types": "workspace:*","@activepieces/core-utils": "workspace:*"},"devDependencies": {- "tslib": "^2.3.0"+ "tslib": "2.8.1"},"scripts": {"build": "tsc -p tsconfig.lib.json && cp package.json dist/",diff --git a/packages/pieces/community/pinecone/src/i18n/translation.json b/packages/pieces/community/pinecone/src/i18n/translation.jsonindex f7ca71100fa..7032be98e6e 100644--- a/packages/pieces/community/pinecone/src/i18n/translation.json+++ b/packages/pieces/community/pinecone/src/i18n/translation.json@@ -10,6 +10,60 @@"Delete a Vector": "Delete a Vector","Search Vectors": "Search Vectors","Search Index": "Search Index",+ "List Indexes": "List Indexes",+ "Get Index": "Get Index",+ "Create Index for Embedding Model": "Create Index for Embedding Model",+ "Configure Index": "Configure Index",+ "Delete Index": "Delete Index",+ "Get Index Stats": "Get Index Stats",+ "Upsert Vectors": "Upsert Vectors",+ "Fetch Vectors": "Fetch Vectors",+ "Fetch Vectors by Metadata": "Fetch Vectors by Metadata",+ "List Vector IDs": "List Vector IDs",+ "Update Vector": "Update Vector",+ "Delete Vectors": "Delete Vectors",+ "Query Vectors": "Query Vectors",+ "List Namespaces": "List Namespaces",+ "Create Namespace": "Create Namespace",+ "Get Namespace": "Get Namespace",+ "Delete Namespace": "Delete Namespace",+ "List Namespace Aliases": "List Namespace Aliases",+ "Create Namespace Alias": "Create Namespace Alias",+ "Get Namespace Alias": "Get Namespace Alias",+ "Repoint Namespace Alias": "Repoint Namespace Alias",+ "Delete Namespace Alias": "Delete Namespace Alias",+ "Upsert Documents": "Upsert Documents",+ "Fetch Documents": "Fetch Documents",+ "List Documents": "List Documents",+ "Search Documents": "Search Documents",+ "Update Documents": "Update Documents",+ "Delete Documents": "Delete Documents",+ "Upsert Text Records": "Upsert Text Records",+ "Search Text Records": "Search Text Records",+ "Start Import": "Start Import",+ "List Imports": "List Imports",+ "Get Import": "Get Import",+ "Cancel Import": "Cancel Import",+ "Generate Embeddings": "Generate Embeddings",+ "Rerank Documents": "Rerank Documents",+ "List Models": "List Models",+ "Get Model": "Get Model",+ "List Assistants": "List Assistants",+ "Create Assistant": "Create Assistant",+ "Get Assistant": "Get Assistant",+ "Update Assistant": "Update Assistant",+ "Delete Assistant": "Delete Assistant",+ "Chat with Assistant": "Chat with Assistant",+ "Chat with Assistant (OpenAI Format)": "Chat with Assistant (OpenAI Format)",+ "Retrieve Assistant Context": "Retrieve Assistant Context",+ "List Assistant Files": "List Assistant Files",+ "Upload Assistant File": "Upload Assistant File",+ "Get Assistant File": "Get Assistant File",+ "Replace Assistant File": "Replace Assistant File",+ "Delete Assistant File": "Delete Assistant File",+ "List Assistant Operations": "List Assistant Operations",+ "Get Assistant Operation": "Get Assistant Operation",+ "Custom API Call": "Custom API Call","Creates a new Pinecone index with custom settings.": "Creates a new Pinecone index with custom settings.","Upsert vectors into a namespace. Overwrites existing vectors with the same ID.": "Upsert vectors into a namespace. Overwrites existing vectors with the same ID.","Updates a vector in a namespace. Overwrites existing values and metadata.": "Updates a vector in a namespace. Overwrites existing values and metadata.",@@ -17,6 +71,61 @@"Delete vectors by ID from a namespace.": "Delete vectors by ID from a namespace.","Search a namespace using a query vector to find similar records.": "Search a namespace using a query vector to find similar records.","Search indexes by name or list all indexes in your project.": "Search indexes by name or list all indexes in your project.",+ "Lists every index in the Pinecone project.": "Lists every index in the Pinecone project.",+ "Gets one index by name.": "Gets one index by name.",+ "Creates a serverless index for vectors or for documents with full-text search.": "Creates a serverless index for vectors or for documents with full-text search.",+ "Creates an integrated index that embeds text with a Pinecone-hosted model.": "Creates an integrated index that embeds text with a Pinecone-hosted model.",+ "Changes deletion protection, tags, read capacity or embedding parameters of an index.": "Changes deletion protection, tags, read capacity or embedding parameters of an index.",+ "Permanently deletes an index and all of its data.": "Permanently deletes an index and all of its data.",+ "Gets record counts per namespace and fullness for an index.": "Gets record counts per namespace and fullness for an index.",+ "Inserts or overwrites vector records in a namespace.": "Inserts or overwrites vector records in a namespace.",+ "Gets vector records by ID.": "Gets vector records by ID.",+ "Gets vector records whose metadata matches a filter.": "Gets vector records whose metadata matches a filter.",+ "Lists the record IDs in a namespace.": "Lists the record IDs in a namespace.",+ "Updates the values or metadata of one record, or the metadata of all records matching a filter.": "Updates the values or metadata of one record, or the metadata of all records matching a filter.",+ "Deletes records by ID, by metadata filter, or all records in a namespace.": "Deletes records by ID, by metadata filter, or all records in a namespace.",+ "Finds the records most similar to a query vector or to a stored record.": "Finds the records most similar to a query vector or to a stored record.",+ "Lists the namespaces in an index.": "Lists the namespaces in an index.",+ "Creates an empty namespace in a serverless index.": "Creates an empty namespace in a serverless index.",+ "Gets one namespace of an index.": "Gets one namespace of an index.",+ "Permanently deletes a namespace and all its records.": "Permanently deletes a namespace and all its records.",+ "Lists the namespace aliases of an index.": "Lists the namespace aliases of an index.",+ "Creates an alias name that points to a namespace.": "Creates an alias name that points to a namespace.",+ "Gets one namespace alias.": "Gets one namespace alias.",+ "Points an existing alias at a different namespace.": "Points an existing alias at a different namespace.",+ "Deletes a namespace alias.": "Deletes a namespace alias.",+ "Inserts or replaces documents in a namespace of a documents index.": "Inserts or replaces documents in a namespace of a documents index.",+ "Gets documents by ID or by metadata filter.": "Gets documents by ID or by metadata filter.",+ "Lists document IDs in a namespace.": "Lists document IDs in a namespace.",+ "Searches documents by full-text query or by vector similarity.": "Searches documents by full-text query or by vector similarity.",+ "Patches fields of documents by ID or of every document matching a filter.": "Patches fields of documents by ID or of every document matching a filter.",+ "Deletes documents by ID, by filter, or all documents in a namespace.": "Deletes documents by ID, by filter, or all documents in a namespace.",+ "Writes text records that Pinecone embeds with the index's hosted model.": "Writes text records that Pinecone embeds with the index's hosted model.",+ "Searches records by text, vector or record ID, with optional reranking.": "Searches records by text, vector or record ID, with optional reranking.",+ "Starts a bulk import of records from object storage into an index.": "Starts a bulk import of records from object storage into an index.",+ "Lists the bulk imports of an index.": "Lists the bulk imports of an index.",+ "Gets the status of one bulk import.": "Gets the status of one bulk import.",+ "Cancels a running bulk import.": "Cancels a running bulk import.",+ "Turns text into vectors with a Pinecone-hosted embedding model.": "Turns text into vectors with a Pinecone-hosted embedding model.",+ "Orders documents by relevance to a query with a hosted reranking model.": "Orders documents by relevance to a query with a hosted reranking model.",+ "Lists the hosted embedding and reranking models.": "Lists the hosted embedding and reranking models.",+ "Gets details of one hosted model.": "Gets details of one hosted model.",+ "Lists the assistants in the project.": "Lists the assistants in the project.",+ "Creates a knowledge assistant.": "Creates a knowledge assistant.",+ "Gets one assistant and its status.": "Gets one assistant and its status.",+ "Changes an assistant's instructions or metadata.": "Changes an assistant's instructions or metadata.",+ "Permanently deletes an assistant and its files.": "Permanently deletes an assistant and its files.",+ "Asks an assistant a question and gets an answer with citations.": "Asks an assistant a question and gets an answer with citations.",+ "Asks an assistant a question and gets an OpenAI-style chat completion.": "Asks an assistant a question and gets an OpenAI-style chat completion.",+ "Gets the file snippets most relevant to a query, without generating an answer.": "Gets the file snippets most relevant to a query, without generating an answer.",+ "Lists the files of an assistant.": "Lists the files of an assistant.",+ "Adds a file to an assistant's knowledge.": "Adds a file to an assistant's knowledge.",+ "Gets one file of an assistant and its processing status.": "Gets one file of an assistant and its processing status.",+ "Replaces the content of an assistant file, keeping its ID.": "Replaces the content of an assistant file, keeping its ID.",+ "Removes a file from an assistant.": "Removes a file from an assistant.",+ "Lists file processing operations of an assistant.": "Lists file processing operations of an assistant.",+ "Gets the status of one assistant file operation.": "Gets the status of one assistant file operation.",+ "Make a custom API call to a specific endpoint": "Make a custom API call to a specific endpoint","Index Name": "Index Name","Dimension": "Dimension","Index Type": "Index Type",@@ -55,6 +164,86 @@"Include Metadata": "Include Metadata","Search Mode": "Search Mode","Name Filter": "Name Filter",+ "Dense Dimension": "Dense Dimension",+ "Include Sparse Vectors": "Include Sparse Vectors",+ "Full-Text Fields": "Full-Text Fields",+ "Full-Text Language": "Full-Text Language",+ "Cloud": "Cloud",+ "Dedicated Node Type": "Dedicated Node Type",+ "Read Replicas": "Read Replicas",+ "Read Shards": "Read Shards",+ "Model": "Model",+ "Text Field": "Text Field",+ "Read Parameters": "Read Parameters",+ "Write Parameters": "Write Parameters",+ "Read Capacity Mode": "Read Capacity Mode",+ "Pod Replicas": "Pod Replicas",+ "Embedded Field Name": "Embedded Field Name",+ "Embedding Read Parameters": "Embedding Read Parameters",+ "Embedding Write Parameters": "Embedding Write Parameters",+ "Limit": "Limit",+ "Pagination Token": "Pagination Token",+ "ID Prefix": "ID Prefix",+ "Filter": "Filter",+ "Values": "Values",+ "Set Metadata": "Set Metadata",+ "Delete All": "Delete All",+ "Name Prefix": "Name Prefix",+ "Namespace Name": "Namespace Name",+ "Filterable Metadata Fields": "Filterable Metadata Fields",+ "Target Namespace": "Target Namespace",+ "Alias Name": "Alias Name",+ "Documents": "Documents",+ "Document IDs": "Document IDs",+ "Include Fields": "Include Fields",+ "Scoring Method": "Scoring Method",+ "Query": "Query",+ "Fields": "Fields",+ "Field": "Field",+ "Set Fields": "Set Fields",+ "Remove Fields": "Remove Fields",+ "Records": "Records",+ "Query Text": "Query Text",+ "Query Record ID": "Query Record ID",+ "Rerank Model": "Rerank Model",+ "Rerank Fields": "Rerank Fields",+ "Rerank Top N": "Rerank Top N",+ "Storage URI": "Storage URI",+ "Storage Integration ID": "Storage Integration ID",+ "On Error": "On Error",+ "Import ID": "Import ID",+ "Texts": "Texts",+ "Input Type": "Input Type",+ "Other Parameters": "Other Parameters",+ "Rank Fields": "Rank Fields",+ "Top N": "Top N",+ "Return Documents": "Return Documents",+ "Type": "Type",+ "Model Name": "Model Name",+ "Assistant Name": "Assistant Name",+ "Instructions": "Instructions",+ "Messages": "Messages",+ "Temperature": "Temperature",+ "File Metadata Filter": "File Metadata Filter",+ "JSON Answer": "JSON Answer",+ "Include Highlights": "Include Highlights",+ "Snippet Size": "Snippet Size",+ "File": "File",+ "Multimodal": "Multimodal",+ "File ID": "File ID",+ "Include Download URL": "Include Download URL",+ "Operation Type": "Operation Type",+ "Status": "Status",+ "Operation ID": "Operation ID",+ "Method": "Method",+ "Headers": "Headers",+ "Query Parameters": "Query Parameters",+ "Body Type": "Body Type",+ "Body": "Body",+ "Response is Binary": "Response is Binary",+ "Return Error as Output": "Return Error as Output",+ "Timeout": "Timeout",+ "Follow redirects": "Follow redirects","You must pass a non-empty string for name in order to create an index": "You must pass a non-empty string for name in order to create an index","You must pass a positive integer for dimension in order to create an index. For dense indexes, this is required.": "You must pass a positive integer for dimension in order to create an index. For dense indexes, this is required.","Choose between serverless or pod-based index deployment": "Choose between serverless or pod-based index deployment",@@ -109,6 +298,147 @@"Choose how to search for indexes": "Choose how to search for indexes","The name of the specific index to search for (when using Find Specific Index mode)": "The name of the specific index to search for (when using Find Specific Index mode)","Filter indexes by name (partial match, case-insensitive)": "Filter indexes by name (partial match, case-insensitive)",+ "Name of the index, from List Indexes. The action looks up the index host itself.": "Name of the index, from List Indexes. The action looks up the index host itself.",+ "Unique name, 1-45 lowercase letters, digits or \"-\", starting and ending with a letter or digit.": "Unique name, 1-45 lowercase letters, digits or \"-\", starting and ending with a letter or digit.",+ "Dimension of the dense vectors, e.g. 1536. Must match the embedding model you use.": "Dimension of the dense vectors, e.g. 1536. Must match the embedding model you use.",+ "Distance metric for the dense vectors: cosine, euclidean or dotproduct. Defaults to cosine.": "Distance metric for the dense vectors: cosine, euclidean or dotproduct. Defaults to cosine.",+ "Add a sparse vector field for keyword or hybrid search.": "Add a sparse vector field for keyword or hybrid search.",+ "Names of document text fields searched by full-text search, e.g. [\"title\", \"body\"]. Setting this makes a documents index.": "Names of document text fields searched by full-text search, e.g. [\"title\", \"body\"]. Setting this makes a documents index.",+ "Language code for full-text search, e.g. \"en\". Defaults to \"en\".": "Language code for full-text search, e.g. \"en\". Defaults to \"en\".",+ "Public cloud for the index: aws, gcp or azure. Set together with Region; defaults to aws us-east-1.": "Public cloud for the index: aws, gcp or azure. Set together with Region; defaults to aws us-east-1.",+ "Cloud region for the index, e.g. \"us-east-1\" on aws, \"us-central1\" on gcp, \"eastus2\" on azure.": "Cloud region for the index, e.g. \"us-east-1\" on aws, \"us-central1\" on gcp, \"eastus2\" on azure.",+ "Set to \"enabled\" to block deleting the index until it is set back to \"disabled\". Leave empty to keep the default (disabled) or the current value.": "Set to \"enabled\" to block deleting the index until it is set back to \"disabled\". Leave empty to keep the default (disabled) or the current value.",+ "Index tags as a JSON object of string values, e.g. {\"team\": \"search\"}. At most 20 tags; set a value to \"\" to remove that tag.": "Index tags as a JSON object of string values, e.g. {\"team\": \"search\"}. At most 20 tags; set a value to \"\" to remove that tag.",+ "Set to use dedicated read nodes instead of on-demand reads: \"b1\" (balanced) or \"t1\" (higher throughput). Needs Read Replicas and Read Shards too.": "Set to use dedicated read nodes instead of on-demand reads: \"b1\" (balanced) or \"t1\" (higher throughput). Needs Read Replicas and Read Shards too.",+ "Number of dedicated read replicas. Used only with Dedicated Node Type.": "Number of dedicated read replicas. Used only with Dedicated Node Type.",+ "Number of dedicated read shards. Used only with Dedicated Node Type.": "Number of dedicated read shards. Used only with Dedicated Node Type.",+ "Public cloud that hosts the index: aws, gcp or azure.": "Public cloud that hosts the index: aws, gcp or azure.",+ "Hosted embedding model name, from List Models, e.g. \"llama-text-embed-v2\" or \"pinecone-sparse-english-v0\".": "Hosted embedding model name, from List Models, e.g. \"llama-text-embed-v2\" or \"pinecone-sparse-english-v0\".",+ "Name of the record field that holds the text to embed, e.g. \"chunk_text\".": "Name of the record field that holds the text to embed, e.g. \"chunk_text\".",+ "Distance metric. Defaults to the model's recommended metric.": "Distance metric. Defaults to the model's recommended metric.",+ "Embedding dimension, for models that support several. Defaults to the model's default.": "Embedding dimension, for models that support several. Defaults to the model's default.",+ "Model parameters used when embedding queries, e.g. {\"input_type\": \"query\", \"truncate\": \"END\"}.": "Model parameters used when embedding queries, e.g. {\"input_type\": \"query\", \"truncate\": \"END\"}.",+ "Model parameters used when embedding records, e.g. {\"input_type\": \"passage\", \"truncate\": \"END\"}.": "Model parameters used when embedding records, e.g. {\"input_type\": \"passage\", \"truncate\": \"END\"}.",+ "Switch read capacity. \"Dedicated\" also needs Dedicated Node Type, Read Replicas and Read Shards.": "Switch read capacity. \"Dedicated\" also needs Dedicated Node Type, Read Replicas and Read Shards.",+ "New replica count, for existing pod-based indexes only.": "New replica count, for existing pod-based indexes only.",+ "New pod size, e.g. \"p1.x2\", for existing pod-based indexes only.": "New pod size, e.g. \"p1.x2\", for existing pod-based indexes only.",+ "Name of the embedded text field of a legacy integrated index (shown in Get Index schema) whose parameters you change.": "Name of the embedded text field of a legacy integrated index (shown in Get Index schema) whose parameters you change.",+ "New query-time model parameters for Embedded Field Name, e.g. {\"input_type\": \"query\"}.": "New query-time model parameters for Embedded Field Name, e.g. {\"input_type\": \"query\"}.",+ "New write-time model parameters for Embedded Field Name, e.g. {\"input_type\": \"passage\"}.": "New write-time model parameters for Embedded Field Name, e.g. {\"input_type\": \"passage\"}.",+ "Pod-based indexes only: count only records whose metadata matches this filter, e.g. {\"genre\": {\"$eq\": \"drama\"}}. Serverless indexes reject it.": "Pod-based indexes only: count only records whose metadata matches this filter, e.g. {\"genre\": {\"$eq\": \"drama\"}}. Serverless indexes reject it.",+ "Namespace inside the index, from List Namespaces. Leave empty for the default namespace (\"__default__\").": "Namespace inside the index, from List Namespaces. Leave empty for the default namespace (\"__default__\").",+ "Records to write, e.g. [{\"id\": \"vec-1\", \"values\": [0.1, 0.2, 0.3], \"metadata\": {\"genre\": \"drama\", \"year\": 2020}}]. Metadata values are strings, numbers, booleans or lists of strings.": "Records to write, e.g. [{\"id\": \"vec-1\", \"values\": [0.1, 0.2, 0.3], \"metadata\": {\"genre\": \"drama\", \"year\": 2020}}]. Metadata values are strings, numbers, booleans or lists of strings.",+ "IDs of the records to get, e.g. [\"vec-1\", \"vec-2\"], from List Vector IDs or Query Vectors.": "IDs of the records to get, e.g. [\"vec-1\", \"vec-2\"], from List Vector IDs or Query Vectors.",+ "Metadata filter, e.g. {\"genre\": {\"$eq\": \"drama\"}, \"year\": {\"$gte\": 2020}}.": "Metadata filter, e.g. {\"genre\": {\"$eq\": \"drama\"}, \"year\": {\"$gte\": 2020}}.",+ "Maximum number of items to return, 1-10000. Defaults to 100.": "Maximum number of items to return, 1-10000. Defaults to 100.",+ "The `next` token from the previous page of this same list, to fetch the following page.": "The `next` token from the previous page of this same list, to fetch the following page.",+ "Only list IDs that start with this text, e.g. \"doc1#\".": "Only list IDs that start with this text, e.g. \"doc1#\".",+ "Maximum number of items to return, 1-100. Defaults to 100.": "Maximum number of items to return, 1-100. Defaults to 100.",+ "ID of the record to update, from List Vector IDs or Query Vectors.": "ID of the record to update, from List Vector IDs or Query Vectors.",+ "Update every record matching this metadata filter instead of one ID, e.g. {\"genre\": {\"$eq\": \"drama\"}}.": "Update every record matching this metadata filter instead of one ID, e.g. {\"genre\": {\"$eq\": \"drama\"}}.",+ "New dense values, e.g. [0.1, 0.2, 0.3]. Must match the index dimension.": "New dense values, e.g. [0.1, 0.2, 0.3]. Must match the index dimension.",+ "Sparse vector positions, e.g. [10, 45]. Same length as Sparse Values.": "Sparse vector positions, e.g. [10, 45]. Same length as Sparse Values.",+ "Sparse vector values, e.g. [0.5, 0.3]. Same length as Sparse Indices.": "Sparse vector values, e.g. [0.5, 0.3]. Same length as Sparse Indices.",+ "Metadata keys to set or overwrite, e.g. {\"genre\": \"comedy\"}. Keys not listed are kept.": "Metadata keys to set or overwrite, e.g. {\"genre\": \"comedy\"}. Keys not listed are kept.",+ "IDs of the records to delete, e.g. [\"vec-1\", \"vec-2\"], up to 1000.": "IDs of the records to delete, e.g. [\"vec-1\", \"vec-2\"], up to 1000.",+ "Delete every record matching this metadata filter, e.g. {\"genre\": {\"$eq\": \"drama\"}}.": "Delete every record matching this metadata filter, e.g. {\"genre\": {\"$eq\": \"drama\"}}.",+ "Delete every record in the namespace.": "Delete every record in the namespace.",+ "Number of matches to return, 1-10000.": "Number of matches to return, 1-10000.",+ "Dense query vector, e.g. [0.1, 0.2, 0.3]. Must match the index dimension.": "Dense query vector, e.g. [0.1, 0.2, 0.3]. Must match the index dimension.",+ "ID of a stored record to use as the query, instead of Query Vector.": "ID of a stored record to use as the query, instead of Query Vector.",+ "Only match records whose metadata matches, e.g. {\"genre\": {\"$in\": [\"comedy\", \"drama\"]}}.": "Only match records whose metadata matches, e.g. {\"genre\": {\"$in\": [\"comedy\", \"drama\"]}}.",+ "Return each match's vector values.": "Return each match's vector values.",+ "Return each match's metadata.": "Return each match's metadata.",+ "Only list namespaces whose name starts with this text.": "Only list namespaces whose name starts with this text.",+ "Name of the new namespace.": "Name of the new namespace.",+ "Metadata field names to index for filtering, e.g. [\"genre\", \"year\"]. Leave empty to index every field.": "Metadata field names to index for filtering, e.g. [\"genre\", \"year\"]. Leave empty to index every field.",+ "Namespace name, from List Namespaces.": "Namespace name, from List Namespaces.",+ "Only list aliases whose name starts with this text.": "Only list aliases whose name starts with this text.",+ "Only list aliases that point to this namespace.": "Only list aliases that point to this namespace.",+ "Name of the new alias.": "Name of the new alias.",+ "Namespace the alias points to, from List Namespaces.": "Namespace the alias points to, from List Namespaces.",+ "Namespace alias name, from List Namespace Aliases.": "Namespace alias name, from List Namespace Aliases.",+ "Documents to write, e.g. [{\"_id\": \"doc-1\", \"title\": \"Intro\", \"body\": \"Pinecone is a vector database.\", \"year\": 2024}].": "Documents to write, e.g. [{\"_id\": \"doc-1\", \"title\": \"Intro\", \"body\": \"Pinecone is a vector database.\", \"year\": 2024}].",+ "IDs of the documents to get, e.g. [\"doc-1\"], from List Documents or Search Documents.": "IDs of the documents to get, e.g. [\"doc-1\"], from List Documents or Search Documents.",+ "Metadata filter selecting documents, e.g. {\"year\": {\"$gte\": 2020}}.": "Metadata filter selecting documents, e.g. {\"year\": {\"$gte\": 2020}}.",+ "Document fields to return, e.g. [\"title\", \"body\"]. Leave empty to return only IDs and scores.": "Document fields to return, e.g. [\"title\", \"body\"]. Leave empty to return only IDs and scores.",+ "Maximum number of items to return, 1-100. Defaults to 10.": "Maximum number of items to return, 1-100. Defaults to 10.",+ "Only list IDs that start with this text.": "Only list IDs that start with this text.",+ "How documents are ranked: text, query_string, dense_vector or sparse_vector.": "How documents are ranked: text, query_string, dense_vector or sparse_vector.",+ "Number of documents to return, 1-10000.": "Number of documents to return, 1-10000.",+ "Text query, for text and query_string scoring.": "Text query, for text and query_string scoring.",+ "Full-text fields to search, for text scoring, e.g. [\"title\", \"body\"].": "Full-text fields to search, for text scoring, e.g. [\"title\", \"body\"].",+ "Vector field to score against, for dense_vector or sparse_vector scoring, e.g. \"embedding\".": "Vector field to score against, for dense_vector or sparse_vector scoring, e.g. \"embedding\".",+ "Dense query vector, for dense_vector scoring.": "Dense query vector, for dense_vector scoring.",+ "Sparse query positions, for sparse_vector scoring.": "Sparse query positions, for sparse_vector scoring.",+ "Sparse query values, for sparse_vector scoring.": "Sparse query values, for sparse_vector scoring.",+ "Only return documents matching this filter, e.g. {\"year\": {\"$gte\": 2020}}.": "Only return documents matching this filter, e.g. {\"year\": {\"$gte\": 2020}}.",+ "Per-ID patches, e.g. [{\"_id\": \"doc-1\", \"year\": 2025, \"_remove_fields\": [\"draft\"]}].": "Per-ID patches, e.g. [{\"_id\": \"doc-1\", \"year\": 2025, \"_remove_fields\": [\"draft\"]}].",+ "Patch every document matching this metadata filter, e.g. {\"status\": \"draft\"}.": "Patch every document matching this metadata filter, e.g. {\"status\": \"draft\"}.",+ "With Filter: fields to set, e.g. {\"status\": \"published\"}.": "With Filter: fields to set, e.g. {\"status\": \"published\"}.",+ "With Filter: metadata field names to remove, e.g. [\"draft_notes\"]. Full-text and vector fields can only be removed per document, with \"_remove_fields\" in Documents.": "With Filter: metadata field names to remove, e.g. [\"draft_notes\"]. Full-text and vector fields can only be removed per document, with \"_remove_fields\" in Documents.",+ "IDs of the documents to delete, e.g. [\"doc-1\"].": "IDs of the documents to delete, e.g. [\"doc-1\"].",+ "Delete every document matching this metadata filter.": "Delete every document matching this metadata filter.",+ "Delete every document in the namespace.": "Delete every document in the namespace.",+ "Records to write, e.g. [{\"_id\": \"rec-1\", \"chunk_text\": \"Apples are rich in fiber.\", \"category\": \"nutrition\"}]. The text field name is the one given when the index was created.": "Records to write, e.g. [{\"_id\": \"rec-1\", \"chunk_text\": \"Apples are rich in fiber.\", \"category\": \"nutrition\"}]. The text field name is the one given when the index was created.",+ "Number of records to return.": "Number of records to return.",+ "Text to search for; Pinecone embeds it with the index's model.": "Text to search for; Pinecone embeds it with the index's model.",+ "Dense query vector, e.g. [0.1, 0.2].": "Dense query vector, e.g. [0.1, 0.2].",+ "ID of a stored record to use as the query.": "ID of a stored record to use as the query.",+ "Only match records whose metadata matches, e.g. {\"category\": {\"$eq\": \"nutrition\"}}.": "Only match records whose metadata matches, e.g. {\"category\": {\"$eq\": \"nutrition\"}}.",+ "Record fields to return, e.g. [\"chunk_text\", \"category\"]. Leave empty for all.": "Record fields to return, e.g. [\"chunk_text\", \"category\"]. Leave empty for all.",+ "Hosted reranking model, from List Models, e.g. \"bge-reranker-v2-m3\". Needs Rerank Fields and Query Text.": "Hosted reranking model, from List Models, e.g. \"bge-reranker-v2-m3\". Needs Rerank Fields and Query Text.",+ "Record fields the reranker reads, e.g. [\"chunk_text\"].": "Record fields the reranker reads, e.g. [\"chunk_text\"].",+ "Number of reranked records to return. Defaults to Top K.": "Number of reranked records to return. Defaults to Top K.",+ "Directory prefix to import, e.g. \"s3://my-bucket/vectors/\". Use s3:// for an aws index, gs:// for gcp, https:// for azure.": "Directory prefix to import, e.g. \"s3://my-bucket/vectors/\". Use s3:// for an aws index, gs:// for gcp, https:// for azure.",+ "ID of the storage integration set up in the Pinecone console, for private buckets.": "ID of the storage integration set up in the Pinecone console, for private buckets.",+ "\"continue\" skips bad records, \"abort\" stops the import. Defaults to continue.": "\"continue\" skips bad records, \"abort\" stops the import. Defaults to continue.",+ "Import operation ID, from Start Import or List Imports.": "Import operation ID, from Start Import or List Imports.",+ "Embedding model, from List Models, e.g. \"llama-text-embed-v2\", \"multilingual-e5-large\" or \"pinecone-sparse-english-v0\".": "Embedding model, from List Models, e.g. \"llama-text-embed-v2\", \"multilingual-e5-large\" or \"pinecone-sparse-english-v0\".",+ "Texts to embed, e.g. [\"Apples are rich in fiber.\"].": "Texts to embed, e.g. [\"Apples are rich in fiber.\"].",+ "\"passage\" for text you store, \"query\" for text you search with.": "\"passage\" for text you store, \"query\" for text you search with.",+ "Other model parameters as strings, e.g. {\"truncate\": \"END\", \"dimension\": \"512\"}.": "Other model parameters as strings, e.g. {\"truncate\": \"END\", \"dimension\": \"512\"}.",+ "Reranking model, from List Models, e.g. \"bge-reranker-v2-m3\" or \"cohere-rerank-3.5\".": "Reranking model, from List Models, e.g. \"bge-reranker-v2-m3\" or \"cohere-rerank-3.5\".",+ "The question the documents are ranked against.": "The question the documents are ranked against.",+ "Texts, or objects of string fields, e.g. [\"Apples are…\"] or [{\"id\": \"1\", \"text\": \"Apples are…\"}].": "Texts, or objects of string fields, e.g. [\"Apples are…\"] or [{\"id\": \"1\", \"text\": \"Apples are…\"}].",+ "For object documents: the field(s) holding the text. Defaults to [\"text\"].": "For object documents: the field(s) holding the text. Defaults to [\"text\"].",+ "Number of documents to return. Defaults to all.": "Number of documents to return. Defaults to all.",+ "Include each document in the result, not just its index and score.": "Include each document in the result, not just its index and score.",+ "Only list embedding or reranking models.": "Only list embedding or reranking models.",+ "Only list embedding models producing dense or sparse vectors.": "Only list embedding models producing dense or sparse vectors.",+ "Hosted model name, from List Models, e.g. \"llama-text-embed-v2\".": "Hosted model name, from List Models, e.g. \"llama-text-embed-v2\".",+ "Unique name, lowercase letters, digits or \"-\".": "Unique name, lowercase letters, digits or \"-\".",+ "Directions for how the assistant answers, e.g. \"Answer in one paragraph and cite the policy.\"": "Directions for how the assistant answers, e.g. \"Answer in one paragraph and cite the policy.\"",+ "String key-value pairs to store, e.g. {\"team\": \"support\"}.": "String key-value pairs to store, e.g. {\"team\": \"support\"}.",+ "Where the assistant's data is stored. Defaults to us.": "Where the assistant's data is stored. Defaults to us.",+ "Name of the assistant, from List Assistants.": "Name of the assistant, from List Assistants.",+ "New directions for how the assistant answers.": "New directions for how the assistant answers.",+ "New string key-value pairs; replaces the current metadata.": "New string key-value pairs; replaces the current metadata.",+ "Conversation so far, oldest first, e.g. [{\"role\": \"user\", \"content\": \"What is our refund policy?\"}]. Roles are \"user\" or \"assistant\".": "Conversation so far, oldest first, e.g. [{\"role\": \"user\", \"content\": \"What is our refund policy?\"}]. Roles are \"user\" or \"assistant\".",+ "Large language model to answer with, e.g. \"gpt-4o\", \"claude-3-5-sonnet\" or \"gemini-2.5-pro\". Defaults to gpt-4o.": "Large language model to answer with, e.g. \"gpt-4o\", \"claude-3-5-sonnet\" or \"gemini-2.5-pro\". Defaults to gpt-4o.",+ "Randomness of the answer, 0-2. Lower is more deterministic.": "Randomness of the answer, 0-2. Lower is more deterministic.",+ "Only use files whose metadata matches, e.g. {\"department\": \"support\"}.": "Only use files whose metadata matches, e.g. {\"department\": \"support\"}.",+ "Ask for the answer as a JSON string.": "Ask for the answer as a JSON string.",+ "Include the cited text snippets in the citations.": "Include the cited text snippets in the citations.",+ "Text to find relevant snippets for.": "Text to find relevant snippets for.",+ "Conversation to find snippets for, e.g. [{\"role\": \"user\", \"content\": \"…\"}], instead of Query.": "Conversation to find snippets for, e.g. [{\"role\": \"user\", \"content\": \"…\"}], instead of Query.",+ "Maximum number of snippets, 1-64. Defaults to 16.": "Maximum number of snippets, 1-64. Defaults to 16.",+ "Maximum tokens per snippet. Defaults to 2048.": "Maximum tokens per snippet. Defaults to 2048.",+ "Only list files whose metadata matches, e.g. {\"department\": \"support\"}.": "Only list files whose metadata matches, e.g. {\"department\": \"support\"}.",+ "File to add: PDF, DOCX, TXT, Markdown or JSON.": "File to add: PDF, DOCX, TXT, Markdown or JSON.",+ "Also extract images from a PDF so the assistant can use them.": "Also extract images from a PDF so the assistant can use them.",+ "Key-value pairs (strings or numbers) to filter on later, e.g. {\"department\": \"support\"}.": "Key-value pairs (strings or numbers) to filter on later, e.g. {\"department\": \"support\"}.",+ "Assistant file ID, from List Assistant Files or Upload Assistant File.": "Assistant file ID, from List Assistant Files or Upload Assistant File.",+ "Also return a temporary signed URL to download the file.": "Also return a temporary signed URL to download the file.",+ "Only list this type: upload_file, upsert_file, delete_file or update_file_metadata.": "Only list this type: upload_file, upsert_file, delete_file or update_file_metadata.",+ "Only list this status: Processing, Completed or Failed.": "Only list this status: Processing, Completed or Failed.",+ "Operation ID, from Upload, Replace or Delete Assistant File, or List Assistant Operations.": "Operation ID, from Upload, Replace or Delete Assistant File, or List Assistant Operations.",+ "Authorization headers are injected automatically from your connection.": "Authorization headers are injected automatically from your connection.",+ "Appended to the URL as ?key=value.": "Appended to the URL as ?key=value.",+ "Enable for files like PDFs, images, etc.": "Enable for files like PDFs, images, etc.",+ "On a failed request, output the error instead of failing the step.": "On a failed request, output the error instead of failing the step.",+ "Seconds to wait for a response. Empty: up to the flow limit (10 min).": "Seconds to wait for a response. Empty: up to the flow limit (10 min).",+ "Follow 3xx redirects instead of returning them as the response.": "Follow 3xx redirects instead of returning them as the response.","Serverless": "Serverless","Pod-based": "Pod-based","AWS": "AWS",@@ -139,5 +469,37 @@"Delete by Filter": "Delete by Filter","Query by ID": "Query by ID","List All Indexes": "List All Indexes",- "Find Specific Index": "Find Specific Index"+ "Find Specific Index": "Find Specific Index",+ "Enabled": "Enabled",+ "Disabled": "Disabled",+ "b1": "b1",+ "t1": "t1",+ "On-demand": "On-demand",+ "Dedicated": "Dedicated",+ "Full-text (BM25)": "Full-text (BM25)",+ "Lucene query string": "Lucene query string",+ "Dense vector": "Dense vector",+ "Sparse vector": "Sparse vector",+ "Continue": "Continue",+ "Abort": "Abort",+ "Passage": "Passage",+ "Embed": "Embed",+ "Rerank": "Rerank",+ "US": "US",+ "EU": "EU",+ "Upload File": "Upload File",+ "Upsert File": "Upsert File",+ "Delete File": "Delete File",+ "Update File Metadata": "Update File Metadata",+ "Processing": "Processing",+ "Completed": "Completed",+ "Failed": "Failed",+ "GET": "GET",+ "POST": "POST",+ "PATCH": "PATCH",+ "PUT": "PUT",+ "DELETE": "DELETE",+ "HEAD": "HEAD",+ "Request": "Request",+ "Data to send": "Data to send"}\ No newline at end of filediff --git a/packages/pieces/community/pinecone/src/index.ts b/packages/pieces/community/pinecone/src/index.tsindex b65e6035023..dd60d5cce6d 100644--- a/packages/pieces/community/pinecone/src/index.ts+++ b/packages/pieces/community/pinecone/src/index.ts@@ -1,22 +1,42 @@-import { createPiece, PieceAuth, Property } from '@activepieces/pieces-framework';+import { createCustomApiCallAction } from '@activepieces/pieces-common';+import { createPiece } from '@activepieces/pieces-framework';import { PieceCategory } from '@activepieces/pieces-framework';-import { createIndex } from './lib/actions/create-index';-import { upsertVector } from './lib/actions/upsert-vector';-import { updateVector } from './lib/actions/update-vector';-import { getVector } from './lib/actions/get-vector';-import { deleteVector } from './lib/actions/delete-vector';-import { searchVector } from './lib/actions/search-vector';-import { searchIndex } from './lib/actions/search-index';+import { createIndexAction } from './lib/actions/create-index';+import { upsertVectorAction } from './lib/actions/upsert-vector';+import { updateVectorAction } from './lib/actions/update-vector';+import { getVectorAction } from './lib/actions/get-vector';+import { deleteVectorAction } from './lib/actions/delete-vector';+import { searchVectorAction } from './lib/actions/search-vector';+import { searchIndexAction } from './lib/actions/search-index';+import { pineconeAiActions } from './lib/actions/ai';import { pineconeAuth } from './lib/auth';+import { pineconeClient } from './lib/common/client';export const pinecone = createPiece({displayName: 'Pinecone',description: 'Manage vector databases, store embeddings, and perform similarity searches',categories: [PieceCategory.ARTIFICIAL_INTELLIGENCE],auth: pineconeAuth,- minimumSupportedRelease: '0.36.1',+ minimumSupportedRelease: '0.88.2',logoUrl: 'https://cdn.activepieces.com/pieces/pinecone.png',authors: ['fortunamide', 'onyedikachi-david'],- actions: [createIndex, upsertVector, updateVector, getVector, deleteVector, searchVector, searchIndex],+ actions: [+ createIndexAction,+ upsertVectorAction,+ updateVectorAction,+ getVectorAction,+ deleteVectorAction,+ searchVectorAction,+ searchIndexAction,+ ...pineconeAiActions,+ createCustomApiCallAction({+ auth: pineconeAuth,+ baseUrl: () => pineconeClient.baseUrl(),+ authMapping: async (auth) => ({+ 'Api-Key': auth.props.apiKey,+ 'X-Pinecone-Api-Version': pineconeClient.apiVersion(),+ }),+ }),+ ],triggers: []});diff --git a/packages/pieces/community/pinecone/src/lib/actions/ai/cancel-import.ts b/packages/pieces/community/pinecone/src/lib/actions/ai/cancel-import.tsnew file mode 100644index 00000000000..9e92f8cb4ff--- /dev/null+++ b/packages/pieces/community/pinecone/src/lib/actions/ai/cancel-import.ts@@ -0,0 +1,36 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { pineconeAuth } from '../../auth';+import { pineconeAiProps } from '../../common/ai-props';+import { pineconeClient } from '../../common/client';+import { pineconeCancelImportOutputSchema } from '../../output-schemas';++export const pineconeCancelImportAction = createAction({+ auth: pineconeAuth,+ name: 'pinecone_cancel_import',+ outputSchema: pineconeCancelImportOutputSchema,+ displayName: 'Cancel Import',+ description: 'Cancels a running bulk import.',+ audience: 'ai',+ classification: 'DESTRUCTIVE',+ aiMetadata: {+ description:+ 'Cancels a bulk import that has not finished. Records already imported stay in the index.',+ idempotent: true,+ },+ props: {+ indexName: pineconeAiProps.indexName({ required: true }),+ importId: Property.ShortText({+ displayName: 'Import ID',+ description: 'Import operation ID, from Start Import or List Imports.',+ required: true,+ }),+ },+ async run(context) {+ const p = context.propsValue;+ const client = pineconeClient.create({ auth: context.auth });+ const index = client.index({ name: p.indexName });+ await index.cancelImport(p.importId);+ return { cancelled: true, importId: p.importId };+ },+});diff --git a/packages/pieces/community/pinecone/src/lib/actions/ai/chat-completion-with-assistant.ts b/packages/pieces/community/pinecone/src/lib/actions/ai/chat-completion-with-assistant.tsnew file mode 100644index 00000000000..cb74602a62c--- /dev/null+++ b/packages/pieces/community/pinecone/src/lib/actions/ai/chat-completion-with-assistant.ts@@ -0,0 +1,61 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { pineconeAuth } from '../../auth';+import { pineconeClient } from '../../common/client';+import { pineconeUtils } from '../../common/utils';+import { pineconeChatCompletionWithAssistantOutputSchema } from '../../output-schemas';++export const pineconeChatCompletionWithAssistantAction = createAction({+ auth: pineconeAuth,+ name: 'pinecone_chat_completion_with_assistant',+ outputSchema: pineconeChatCompletionWithAssistantOutputSchema,+ displayName: 'Chat with Assistant (OpenAI Format)',+ description: 'Asks an assistant a question and gets an OpenAI-style chat completion.',+ audience: 'ai',+ classification: 'READ',+ aiMetadata: {+ description:+ "Same as Chat with Assistant but returns an OpenAI-compatible chat completion (choices, usage) without citations. Use it when the next step expects OpenAI's format.",+ idempotent: false,+ },+ props: {+ assistantName: Property.ShortText({+ displayName: 'Assistant Name',+ description: 'Name of the assistant, from List Assistants.',+ required: true,+ }),+ messages: Property.Array({+ displayName: 'Messages',+ description:+ 'Conversation so far, oldest first, e.g. [{"role": "user", "content": "What is our refund policy?"}]. Roles are "user" or "assistant".',+ required: true,+ }),+ model: Property.ShortText({+ displayName: 'Model',+ description:+ 'Large language model to answer with, e.g. "gpt-4o", "claude-3-5-sonnet" or "gemini-2.5-pro". Defaults to gpt-4o.',+ required: false,+ }),+ temperature: Property.Number({+ displayName: 'Temperature',+ description: 'Randomness of the answer, 0-2. Lower is more deterministic.',+ required: false,+ }),+ filter: Property.Json({+ displayName: 'File Metadata Filter',+ description: 'Only use files whose metadata matches, e.g. {"department": "support"}.',+ required: false,+ }),+ },+ async run(context) {+ const p = context.propsValue;+ const client = pineconeClient.create({ auth: context.auth });+ const assistant = client.assistant({ name: p.assistantName });+ return await assistant.chatCompletion({+ messages: pineconeUtils.toMessages({ value: p.messages, propName: 'Messages' }),+ ...(p.model !== undefined ? { model: p.model } : {}),+ ...(p.temperature !== undefined ? { temperature: p.temperature } : {}),+ ...(p.filter !== undefined ? { filter: p.filter } : {}),+ });+ },+});diff --git a/packages/pieces/community/pinecone/src/lib/actions/ai/chat-with-assistant.ts b/packages/pieces/community/pinecone/src/lib/actions/ai/chat-with-assistant.tsnew file mode 100644index 00000000000..53971b6aea0--- /dev/null+++ b/packages/pieces/community/pinecone/src/lib/actions/ai/chat-with-assistant.ts@@ -0,0 +1,73 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { pineconeAuth } from '../../auth';+import { pineconeClient } from '../../common/client';+import { pineconeUtils } from '../../common/utils';+import { pineconeChatWithAssistantOutputSchema } from '../../output-schemas';++export const pineconeChatWithAssistantAction = createAction({+ auth: pineconeAuth,+ name: 'pinecone_chat_with_assistant',+ outputSchema: pineconeChatWithAssistantOutputSchema,+ displayName: 'Chat with Assistant',+ description: 'Asks an assistant a question and gets an answer with citations.',+ audience: 'ai',+ classification: 'READ',+ aiMetadata: {+ description:+ "Sends the conversation to an assistant and returns its answer grounded in the assistant's files, with citations to the file pages used. Not streamed.",+ idempotent: false,+ },+ props: {+ assistantName: Property.ShortText({+ displayName: 'Assistant Name',+ description: 'Name of the assistant, from List Assistants.',+ required: true,+ }),+ messages: Property.Array({+ displayName: 'Messages',+ description:+ 'Conversation so far, oldest first, e.g. [{"role": "user", "content": "What is our refund policy?"}]. Roles are "user" or "assistant".',+ required: true,+ }),+ model: Property.ShortText({+ displayName: 'Model',+ description:+ 'Large language model to answer with, e.g. "gpt-4o", "claude-3-5-sonnet" or "gemini-2.5-pro". Defaults to gpt-4o.',+ required: false,+ }),+ temperature: Property.Number({+ displayName: 'Temperature',+ description: 'Randomness of the answer, 0-2. Lower is more deterministic.',+ required: false,+ }),+ filter: Property.Json({+ displayName: 'File Metadata Filter',+ description: 'Only use files whose metadata matches, e.g. {"department": "support"}.',+ required: false,+ }),+ jsonResponse: Property.Checkbox({+ displayName: 'JSON Answer',+ description: 'Ask for the answer as a JSON string.',+ required: false,+ }),+ includeHighlights: Property.Checkbox({+ displayName: 'Include Highlights',+ description: 'Include the cited text snippets in the citations.',+ required: false,+ }),+ },+ async run(context) {+ const p = context.propsValue;+ const client = pineconeClient.create({ auth: context.auth });+ const assistant = client.assistant({ name: p.assistantName });+ return await assistant.chat({+ messages: pineconeUtils.toMessages({ value: p.messages, propName: 'Messages' }),+ ...(p.model !== undefined ? { model: p.model } : {}),+ ...(p.temperature !== undefined ? { temperature: p.temperature } : {}),+ ...(p.filter !== undefined ? { filter: p.filter } : {}),+ ...(p.jsonResponse !== undefined ? { jsonResponse: p.jsonResponse } : {}),+ ...(p.includeHighlights !== undefined ? { includeHighlights: p.includeHighlights } : {}),+ });+ },+});diff --git a/packages/pieces/community/pinecone/src/lib/actions/ai/configure-index.ts b/packages/pieces/community/pinecone/src/lib/actions/ai/configure-index.tsnew file mode 100644index 00000000000..8e4c67eceaf--- /dev/null+++ b/packages/pieces/community/pinecone/src/lib/actions/ai/configure-index.ts@@ -0,0 +1,123 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { pineconeAuth } from '../../auth';+import { pineconeAiProps } from '../../common/ai-props';+import { pineconeClient } from '../../common/client';+import { pineconeUtils } from '../../common/utils';+import { pineconeConfigureIndexOutputSchema } from '../../output-schemas';++import type { ReadCapacity } from '../../common/types';++export const pineconeConfigureIndexAction = createAction({+ auth: pineconeAuth,+ name: 'pinecone_configure_index',+ outputSchema: pineconeConfigureIndexOutputSchema,+ displayName: 'Configure Index',+ description:+ 'Changes deletion protection, tags, read capacity or embedding parameters of an index.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description:+ 'Updates only the settings you set on an existing index: deletion protection, tags (a tag set to "" is removed), read capacity (on-demand or dedicated read nodes), pod replicas and pod type (existing pod-based indexes only), and the read/write parameters of a legacy integrated index\'s embedded field. Settings left empty stay as they are.',+ idempotent: true,+ },+ props: {+ indexName: pineconeAiProps.indexName({ required: true }),+ deletionProtection: pineconeAiProps.deletionProtection({ required: false }),+ tags: pineconeAiProps.tags({ required: false }),+ readCapacityMode: Property.StaticDropdown<'OnDemand' | 'Dedicated', false>({+ displayName: 'Read Capacity Mode',+ description:+ 'Switch read capacity. "Dedicated" also needs Dedicated Node Type, Read Replicas and Read Shards.',+ required: false,+ options: {+ options: [+ { label: 'On-demand', value: 'OnDemand' },+ { label: 'Dedicated', value: 'Dedicated' },+ ],+ },+ }),+ readNodeType: pineconeAiProps.readNodeType({ required: false }),+ readReplicas: pineconeAiProps.readReplicas({ required: false }),+ readShards: pineconeAiProps.readShards({ required: false }),+ podReplicas: Property.Number({+ displayName: 'Pod Replicas',+ description: 'New replica count, for existing pod-based indexes only.',+ required: false,+ }),+ podType: Property.ShortText({+ displayName: 'Pod Type',+ description: 'New pod size, e.g. "p1.x2", for existing pod-based indexes only.',+ required: false,+ }),+ embedFieldName: Property.ShortText({+ displayName: 'Embedded Field Name',+ description:+ 'Name of the embedded text field of a legacy integrated index (shown in Get Index schema) whose parameters you change.',+ required: false,+ }),+ embedReadParameters: Property.Json({+ displayName: 'Embedding Read Parameters',+ description:+ 'New query-time model parameters for Embedded Field Name, e.g. {"input_type": "query"}.',+ required: false,+ }),+ embedWriteParameters: Property.Json({+ displayName: 'Embedding Write Parameters',+ description:+ 'New write-time model parameters for Embedded Field Name, e.g. {"input_type": "passage"}.',+ required: false,+ }),+ },+ async run(context) {+ const p = context.propsValue;+ if (p.readCapacityMode === 'OnDemand' && p.readNodeType !== undefined) {+ throw new Error('"Dedicated Node Type" cannot be used with "Read Capacity Mode" On-demand.');+ }+ if (p.readCapacityMode === 'Dedicated' && p.readNodeType === undefined) {+ throw new Error('"Read Capacity Mode" Dedicated needs "Dedicated Node Type".');+ }+ const hasEmbedParameters =+ p.embedReadParameters !== undefined || p.embedWriteParameters !== undefined;+ if (hasEmbedParameters !== (p.embedFieldName !== undefined)) {+ throw new Error('Set "Embedded Field Name" together with its read or write parameters.');+ }+ const onDemand: ReadCapacity = { mode: 'OnDemand' };+ const readCapacity =+ p.readCapacityMode === 'OnDemand'+ ? onDemand+ : pineconeUtils.toReadCapacity({+ nodeType: p.readNodeType,+ replicas: p.readReplicas,+ shards: p.readShards,+ });+ const client = pineconeClient.create({ auth: context.auth });+ return await client.indexes.configure(p.indexName, {+ ...(p.deletionProtection !== undefined ? { deletionProtection: p.deletionProtection } : {}),+ ...(p.tags !== undefined+ ? { tags: pineconeUtils.toStringMap({ value: p.tags, propName: 'Tags' }) }+ : {}),+ ...(readCapacity !== undefined ? { readCapacity } : {}),+ ...(p.podReplicas !== undefined ? { podReplicas: p.podReplicas } : {}),+ ...(p.podType !== undefined ? { podType: p.podType } : {}),+ ...(p.embedFieldName !== undefined+ ? {+ schema: {+ fields: {+ [p.embedFieldName]: {+ type: 'semantic_text',+ ...(p.embedReadParameters !== undefined+ ? { readParameters: p.embedReadParameters }+ : {}),+ ...(p.embedWriteParameters !== undefined+ ? { writeParameters: p.embedWriteParameters }+ : {}),+ },+ },+ },+ }+ : {}),+ });+ },+});diff --git a/packages/pieces/community/pinecone/src/lib/actions/ai/create-assistant.ts b/packages/pieces/community/pinecone/src/lib/actions/ai/create-assistant.tsnew file mode 100644index 00000000000..5405c2a9d48--- /dev/null+++ b/packages/pieces/community/pinecone/src/lib/actions/ai/create-assistant.ts@@ -0,0 +1,62 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { pineconeAuth } from '../../auth';+import { pineconeClient } from '../../common/client';+import { pineconeUtils } from '../../common/utils';+import { pineconeCreateAssistantOutputSchema } from '../../output-schemas';++export const pineconeCreateAssistantAction = createAction({+ auth: pineconeAuth,+ name: 'pinecone_create_assistant',+ outputSchema: pineconeCreateAssistantOutputSchema,+ displayName: 'Create Assistant',+ description: 'Creates a knowledge assistant.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description:+ 'Creates an assistant that answers questions from files you add with Upload Assistant File. It starts initializing; check readiness with Get Assistant.',+ idempotent: false,+ },+ props: {+ name: Property.ShortText({+ displayName: 'Assistant Name',+ description: 'Unique name, lowercase letters, digits or "-".',+ required: true,+ }),+ instructions: Property.LongText({+ displayName: 'Instructions',+ description:+ 'Directions for how the assistant answers, e.g. "Answer in one paragraph and cite the policy."',+ required: false,+ }),+ metadata: Property.Json({+ displayName: 'Metadata',+ description: 'String key-value pairs to store, e.g. {"team": "support"}.',+ required: false,+ }),+ region: Property.StaticDropdown<'us' | 'eu', false>({+ displayName: 'Region',+ description: "Where the assistant's data is stored. Defaults to us.",+ required: false,+ options: {+ options: [+ { label: 'US', value: 'us' },+ { label: 'EU', value: 'eu' },+ ],+ },+ }),+ },+ async run(context) {+ const p = context.propsValue;+ const client = pineconeClient.create({ auth: context.auth });+ return await client.assistants.create({+ name: p.name,+ ...(p.instructions !== undefined ? { instructions: p.instructions } : {}),+ ...(p.metadata !== undefined+ ? { metadata: pineconeUtils.toStringMap({ value: p.metadata, propName: 'Metadata' }) }+ : {}),+ ...(p.region !== undefined ? { region: p.region } : {}),+ });+ },+});diff --git a/packages/pieces/community/pinecone/src/lib/actions/ai/create-index-for-model.ts b/packages/pieces/community/pinecone/src/lib/actions/ai/create-index-for-model.tsnew file mode 100644index 00000000000..8594abb8e83--- /dev/null+++ b/packages/pieces/community/pinecone/src/lib/actions/ai/create-index-for-model.ts@@ -0,0 +1,97 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { pineconeAuth } from '../../auth';+import { pineconeAiProps } from '../../common/ai-props';+import { pineconeClient } from '../../common/client';+import { pineconeUtils } from '../../common/utils';+import { pineconeCreateIndexForModelOutputSchema } from '../../output-schemas';++export const pineconeCreateIndexForModelAction = createAction({+ auth: pineconeAuth,+ name: 'pinecone_create_index_for_model',+ outputSchema: pineconeCreateIndexForModelOutputSchema,+ displayName: 'Create Index for Embedding Model',+ description: 'Creates an integrated index that embeds text with a Pinecone-hosted model.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description:+ 'Creates a legacy integrated index: Pinecone embeds the text in Text Field with the hosted Model on write and on search. Use Upsert Text Records and Search Text Records with it. Pick a model from List Models. The index starts initializing; check readiness with Get Index.',+ idempotent: false,+ },+ props: {+ name: Property.ShortText({+ displayName: 'Index Name',+ description:+ 'Unique name, 1-45 lowercase letters, digits or "-", starting and ending with a letter or digit.',+ required: true,+ }),+ cloud: pineconeAiProps.cloud({ required: true }),+ region: pineconeAiProps.region({ required: true }),+ model: Property.ShortText({+ displayName: 'Model',+ description:+ 'Hosted embedding model name, from List Models, e.g. "llama-text-embed-v2" or "pinecone-sparse-english-v0".',+ required: true,+ }),+ textField: Property.ShortText({+ displayName: 'Text Field',+ description: 'Name of the record field that holds the text to embed, e.g. "chunk_text".',+ required: true,+ }),+ metric: pineconeAiProps.metric({+ required: false,+ description: "Distance metric. Defaults to the model's recommended metric.",+ }),+ dimension: Property.Number({+ displayName: 'Dimension',+ description:+ "Embedding dimension, for models that support several. Defaults to the model's default.",+ required: false,+ }),+ readParameters: Property.Json({+ displayName: 'Read Parameters',+ description:+ 'Model parameters used when embedding queries, e.g. {"input_type": "query", "truncate": "END"}.',+ required: false,+ }),+ writeParameters: Property.Json({+ displayName: 'Write Parameters',+ description:+ 'Model parameters used when embedding records, e.g. {"input_type": "passage", "truncate": "END"}.',+ required: false,+ }),+ deletionProtection: pineconeAiProps.deletionProtection({ required: false }),+ tags: pineconeAiProps.tags({ required: false }),+ readNodeType: pineconeAiProps.readNodeType({ required: false }),+ readReplicas: pineconeAiProps.readReplicas({ required: false }),+ readShards: pineconeAiProps.readShards({ required: false }),+ },+ async run(context) {+ const p = context.propsValue;+ const readCapacity = pineconeUtils.toReadCapacity({+ nodeType: p.readNodeType,+ replicas: p.readReplicas,+ shards: p.readShards,+ });+ const client = pineconeClient.create({ auth: context.auth });+ return await client.indexes.createForModel({+ name: p.name,+ cloud: p.cloud,+ region: p.region,+ embed: {+ model: p.model,+ fieldMap: { text: p.textField },+ ...(p.metric !== undefined ? { metric: p.metric } : {}),+ ...(p.dimension !== undefined ? { dimension: p.dimension } : {}),+ ...(p.readParameters !== undefined ? { readParameters: p.readParameters } : {}),+ ...(p.writeParameters !== undefined ? { writeParameters: p.writeParameters } : {}),+ },+ ...(p.deletionProtection !== undefined ? { deletionProtection: p.deletionProtection } : {}),+ ...(p.tags !== undefined+ ? { tags: pineconeUtils.toStringMap({ value: p.tags, propName: 'Tags' }) }+ : {}),+ ...(readCapacity !== undefined ? { readCapacity } : {}),+ });+ },+});diff --git a/packages/pieces/community/pinecone/src/lib/actions/ai/create-index.ts b/packages/pieces/community/pinecone/src/lib/actions/ai/create-index.tsnew file mode 100644index 00000000000..b1783bb93b0--- /dev/null+++ b/packages/pieces/community/pinecone/src/lib/actions/ai/create-index.ts@@ -0,0 +1,120 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { pineconeAuth } from '../../auth';+import { pineconeAiProps } from '../../common/ai-props';+import { pineconeClient } from '../../common/client';+import { pineconeUtils } from '../../common/utils';+import { pineconeCreateIndexOutputSchema } from '../../output-schemas';++import type { CreateIndexSchemaField, PineconeIndexDeployment } from '../../common/types';++export const pineconeCreateIndexAction = createAction({+ auth: pineconeAuth,+ name: 'pinecone_create_index',+ outputSchema: pineconeCreateIndexOutputSchema,+ displayName: 'Create Index',+ description: 'Creates a serverless index for vectors or for documents with full-text search.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description:+ 'Creates a serverless index. Without Full-Text Fields it is a vectors index (dense "_values" and/or sparse "_sparse_values"), which the vector actions (Upsert Vectors, Query Vectors…) work with. With Full-Text Fields it is a documents index, which only the document actions work with; its dense field is named "embedding" and its sparse field "sparse_embedding". Set at least one of Dense Dimension, Include Sparse Vectors or Full-Text Fields. The index starts initializing; check readiness with Get Index.',+ idempotent: false,+ },+ props: {+ name: Property.ShortText({+ displayName: 'Index Name',+ description:+ 'Unique name, 1-45 lowercase letters, digits or "-", starting and ending with a letter or digit.',+ required: true,+ }),+ denseDimension: Property.Number({+ displayName: 'Dense Dimension',+ description:+ 'Dimension of the dense vectors, e.g. 1536. Must match the embedding model you use.',+ required: false,+ }),+ metric: pineconeAiProps.metric({+ required: false,+ description:+ 'Distance metric for the dense vectors: cosine, euclidean or dotproduct. Defaults to cosine.',+ }),+ includeSparseVectors: Property.Checkbox({+ displayName: 'Include Sparse Vectors',+ description: 'Add a sparse vector field for keyword or hybrid search.',+ required: false,+ }),+ fullTextFields: Property.Array({+ displayName: 'Full-Text Fields',+ description:+ 'Names of document text fields searched by full-text search, e.g. ["title", "body"]. Setting this makes a documents index.',+ required: false,+ }),+ fullTextLanguage: Property.ShortText({+ displayName: 'Full-Text Language',+ description: 'Language code for full-text search, e.g. "en". Defaults to "en".',+ required: false,+ }),+ cloud: pineconeAiProps.cloud({+ required: false,+ description:+ 'Public cloud for the index: aws, gcp or azure. Set together with Region; defaults to aws us-east-1.',+ }),+ region: pineconeAiProps.region({ required: false }),+ deletionProtection: pineconeAiProps.deletionProtection({ required: false }),+ tags: pineconeAiProps.tags({ required: false }),+ readNodeType: pineconeAiProps.readNodeType({ required: false }),+ readReplicas: pineconeAiProps.readReplicas({ required: false }),+ readShards: pineconeAiProps.readShards({ required: false }),+ },+ async run(context) {+ const p = context.propsValue;+ if ((p.cloud === undefined) !== (p.region === undefined)) {+ throw new Error('Set "Cloud" and "Region" together, or leave both empty.');+ }+ const textFields = p.fullTextFields+ ? pineconeUtils.toStringList({ value: p.fullTextFields, propName: 'Full-Text Fields' })+ : [];+ const isDocumentsIndex = textFields.length > 0;+ const fields: Record<string, CreateIndexSchemaField> = {+ ...(p.denseDimension !== undefined+ ? {+ [isDocumentsIndex ? 'embedding' : '_values']: {+ type: 'dense_vector',+ dimension: p.denseDimension,+ metric: p.metric ?? 'cosine',+ },+ }+ : {}),+ ...(p.includeSparseVectors+ ? { [isDocumentsIndex ? 'sparse_embedding' : '_sparse_values']: { type: 'sparse_vector' } }+ : {}),+ ...Object.fromEntries(+ textFields.map((field): [string, CreateIndexSchemaField] => [+ field,+ { type: 'string', fullTextSearch: { language: p.fullTextLanguage ?? 'en' } },+ ]),+ ),+ };+ const readCapacity = pineconeUtils.toReadCapacity({+ nodeType: p.readNodeType,+ replicas: p.readReplicas,+ shards: p.readShards,+ });+ const deployment: PineconeIndexDeployment =+ p.cloud !== undefined && p.region !== undefined+ ? { deploymentType: 'managed', cloud: p.cloud, region: p.region }+ : undefined;+ const client = pineconeClient.create({ auth: context.auth });+ return await client.indexes.create({+ name: p.name,+ schema: { fields },+ ...(deployment !== undefined ? { deployment } : {}),+ ...(p.deletionProtection !== undefined ? { deletionProtection: p.deletionProtection } : {}),+ ...(p.tags !== undefined+ ? { tags: pineconeUtils.toStringMap({ value: p.tags, propName: 'Tags' }) }+ : {}),+ ...(readCapacity !== undefined ? { readCapacity } : {}),+ });+ },+});diff --git a/packages/pieces/community/pinecone/src/lib/actions/ai/create-namespace-alias.ts b/packages/pieces/community/pinecone/src/lib/actions/ai/create-namespace-alias.tsnew file mode 100644index 00000000000..95be31289b7--- /dev/null+++ b/packages/pieces/community/pinecone/src/lib/actions/ai/create-namespace-alias.ts@@ -0,0 +1,43 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { pineconeAuth } from '../../auth';+import { pineconeAiProps } from '../../common/ai-props';+import { pineconeApi } from '../../common/api';+import { pineconeCreateNamespaceAliasOutputSchema } from '../../output-schemas';++export const pineconeCreateNamespaceAliasAction = createAction({+ auth: pineconeAuth,+ name: 'pinecone_create_namespace_alias',+ outputSchema: pineconeCreateNamespaceAliasOutputSchema,+ displayName: 'Create Namespace Alias',+ description: 'Creates an alias name that points to a namespace.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description:+ 'Creates a namespace alias: a second name that reads and writes go to the target namespace through. Repoint it later with Repoint Namespace Alias to switch traffic without changing callers.',+ idempotent: false,+ },+ props: {+ indexName: pineconeAiProps.indexName({ required: true }),+ aliasName: Property.ShortText({+ displayName: 'Alias Name',+ description: 'Name of the new alias.',+ required: true,+ }),+ targetNamespace: Property.ShortText({+ displayName: 'Target Namespace',+ description: 'Namespace the alias points to, from List Namespaces.',+ required: true,+ }),+ },+ async run(context) {+ const p = context.propsValue;+ return await pineconeApi.createNamespaceAlias({+ auth: context.auth,+ indexName: p.indexName,+ aliasName: p.aliasName,+ targetNamespace: p.targetNamespace,+ });+ },+});diff --git a/packages/pieces/community/pinecone/src/lib/actions/ai/create-namespace.ts b/packages/pieces/community/pinecone/src/lib/actions/ai/create-namespace.tsnew file mode 100644index 00000000000..ab23589b066--- /dev/null+++ b/packages/pieces/community/pinecone/src/lib/actions/ai/create-namespace.ts@@ -0,0 +1,59 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { pineconeAuth } from '../../auth';+import { pineconeAiProps } from '../../common/ai-props';+import { pineconeClient } from '../../common/client';+import { pineconeUtils } from '../../common/utils';+import { pineconeCreateNamespaceOutputSchema } from '../../output-schemas';++export const pineconeCreateNamespaceAction = createAction({+ auth: pineconeAuth,+ name: 'pinecone_create_namespace',+ outputSchema: pineconeCreateNamespaceOutputSchema,+ displayName: 'Create Namespace',+ description: 'Creates an empty namespace in a serverless index.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description:+ 'Creates an empty namespace in a serverless index, optionally listing the metadata fields to index for filtering (other fields are then not filterable). Writing records to a new namespace also creates it, so this is only needed to set filterable fields up front.',+ idempotent: false,+ },+ props: {+ indexName: pineconeAiProps.indexName({ required: true }),+ name: Property.ShortText({+ displayName: 'Namespace Name',+ description: 'Name of the new namespace.',+ required: true,+ }),+ filterableFields: Property.Array({+ displayName: 'Filterable Metadata Fields',+ description:+ 'Metadata field names to index for filtering, e.g. ["genre", "year"]. Leave empty to index every field.',+ required: false,+ }),+ },+ async run(context) {+ const p = context.propsValue;+ const client = pineconeClient.create({ auth: context.auth });+ const index = client.index({ name: p.indexName });+ const filterableFields = p.filterableFields+ ? pineconeUtils.toStringList({+ value: p.filterableFields,+ propName: 'Filterable Metadata Fields',+ })+ : undefined;+ return await index.createNamespace({+ name: p.name,+ ...(filterableFields !== undefined+ ? {+ schema: {+ fields: Object.fromEntries(+ filterableFields.map((field) => [field, { filterable: true }]),+ ),+ },+ }+ : {}),+ });+ },+});diff --git a/packages/pieces/community/pinecone/src/lib/actions/ai/delete-assistant-file.ts b/packages/pieces/community/pinecone/src/lib/actions/ai/delete-assistant-file.tsnew file mode 100644index 00000000000..9394cf5095c--- /dev/null+++ b/packages/pieces/community/pinecone/src/lib/actions/ai/delete-assistant-file.ts@@ -0,0 +1,38 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { pineconeAuth } from '../../auth';+import { pineconeClient } from '../../common/client';+import { pineconeDeleteAssistantFileOutputSchema } from '../../output-schemas';++export const pineconeDeleteAssistantFileAction = createAction({+ auth: pineconeAuth,+ name: 'pinecone_delete_assistant_file',+ outputSchema: pineconeDeleteAssistantFileOutputSchema,+ displayName: 'Delete Assistant File',+ description: 'Removes a file from an assistant.',+ audience: 'ai',+ classification: 'DESTRUCTIVE',+ aiMetadata: {+ description:+ 'Removes a file from an assistant so it is no longer used in answers, and returns the deletion operation. Cannot be undone.',+ idempotent: false,+ },+ props: {+ assistantName: Property.ShortText({+ displayName: 'Assistant Name',+ description: 'Name of the assistant, from List Assistants.',+ required: true,+ }),+ fileId: Property.ShortText({+ displayName: 'File ID',+ description: 'Assistant file ID, from List Assistant Files or Upload Assistant File.',+ required: true,+ }),+ },+ async run(context) {+ const p = context.propsValue;+ const client = pineconeClient.create({ auth: context.auth });+ const assistant = client.assistant({ name: p.assistantName });+ return await assistant.deleteFile(p.fileId);+ },+});diff --git a/packages/pieces/community/pinecone/src/lib/actions/ai/delete-assistant.ts b/packages/pieces/community/pinecone/src/lib/actions/ai/delete-assistant.tsnew file mode 100644index 00000000000..8fe5ca574ae--- /dev/null+++ b/packages/pieces/community/pinecone/src/lib/actions/ai/delete-assistant.ts@@ -0,0 +1,33 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { pineconeAuth } from '../../auth';+import { pineconeClient } from '../../common/client';+import { pineconeDeleteAssistantOutputSchema } from '../../output-schemas';++export const pineconeDeleteAssistantAction = createAction({+ auth: pineconeAuth,+ name: 'pinecone_delete_assistant',+ outputSchema: pineconeDeleteAssistantOutputSchema,+ displayName: 'Delete Assistant',+ description: 'Permanently deletes an assistant and its files.',+ audience: 'ai',+ classification: 'DESTRUCTIVE',+ aiMetadata: {+ description:+ 'Permanently deletes an assistant and every file uploaded to it; this cannot be undone.',+ idempotent: false,+ },+ props: {+ assistantName: Property.ShortText({+ displayName: 'Assistant Name',+ description: 'Name of the assistant, from List Assistants.',+ required: true,+ }),+ },+ async run(context) {+ const p = context.propsValue;+ const client = pineconeClient.create({ auth: context.auth });+ await client.assistants.delete(p.assistantName);+ return { deleted: true, assistantName: p.assistantName };+ },+});diff --git a/packages/pieces/community/pinecone/src/lib/actions/ai/delete-documents.ts b/packages/pieces/community/pinecone/src/lib/actions/ai/delete-documents.tsnew file mode 100644index 00000000000..1bd8aaa4ca2--- /dev/null+++ b/packages/pieces/community/pinecone/src/lib/actions/ai/delete-documents.ts@@ -0,0 +1,66 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { pineconeAuth } from '../../auth';+import { pineconeAiProps } from '../../common/ai-props';+import { pineconeClient } from '../../common/client';+import { pineconeUtils } from '../../common/utils';+import { pineconeDeleteDocumentsOutputSchema } from '../../output-schemas';++export const pineconeDeleteDocumentsAction = createAction({+ auth: pineconeAuth,+ name: 'pinecone_delete_documents',+ outputSchema: pineconeDeleteDocumentsOutputSchema,+ displayName: 'Delete Documents',+ description: 'Deletes documents by ID, by filter, or all documents in a namespace.',+ audience: 'ai',+ classification: 'DESTRUCTIVE',+ aiMetadata: {+ description:+ 'Permanently deletes documents from a namespace: the listed IDs, every document matching a metadata filter, or every document in the namespace. Set exactly one of Document IDs, Filter or Delete All. Cannot be undone. Works only on documents indexes (created by Create Index with Full-Text Fields).',+ idempotent: false,+ },+ props: {+ indexName: pineconeAiProps.indexName({ required: true }),+ namespace: pineconeAiProps.namespace({ required: false }),+ ids: Property.Array({+ displayName: 'Document IDs',+ description: 'IDs of the documents to delete, e.g. ["doc-1"].',+ required: false,+ }),+ filter: Property.Json({+ displayName: 'Filter',+ description: 'Delete every document matching this metadata filter.',+ required: false,+ }),+ deleteAll: Property.Checkbox({+ displayName: 'Delete All',+ description: 'Delete every document in the namespace.',+ required: false,+ }),+ },+ async run(context) {+ const p = context.propsValue;+ const client = pineconeClient.create({ auth: context.auth });+ const modes = [p.ids !== undefined, p.filter !== undefined, p.deleteAll === true].filter(+ Boolean,+ ).length;+ if (modes !== 1) {+ throw new Error('Set exactly one of "Document IDs", "Filter" or "Delete All".');+ }+ const documents = client.index({+ name: p.indexName,+ ...(p.namespace !== undefined ? { namespace: p.namespace } : {}),+ }).documents;+ if (p.deleteAll === true) {+ const response = await documents.delete({ deleteAll: true });+ return { deleted: true, ...response, mode: 'all', namespace: p.namespace ?? '__default__' };+ }+ if (p.filter !== undefined) {+ const response = await documents.delete({ filter: p.filter });+ return { deleted: true, ...response, mode: 'filter', filter: p.filter };+ }+ const ids = pineconeUtils.toStringList({ value: p.ids ?? [], propName: 'Document IDs' });+ const response = await documents.delete({ ids });+ return { deleted: true, ...response, mode: 'ids', ids };+ },+});diff --git a/packages/pieces/community/pinecone/src/lib/actions/ai/delete-index.ts b/packages/pieces/community/pinecone/src/lib/actions/ai/delete-index.tsnew file mode 100644index 00000000000..ab9cde211db--- /dev/null+++ b/packages/pieces/community/pinecone/src/lib/actions/ai/delete-index.ts@@ -0,0 +1,30 @@+import { createAction } from '@activepieces/pieces-framework';++import { pineconeAuth } from '../../auth';+import { pineconeAiProps } from '../../common/ai-props';+import { pineconeClient } from '../../common/client';+import { pineconeDeleteIndexOutputSchema } from '../../output-schemas';++export const pineconeDeleteIndexAction = createAction({+ auth: pineconeAuth,+ name: 'pinecone_delete_index',+ outputSchema: pineconeDeleteIndexOutputSchema,+ displayName: 'Delete Index',+ description: 'Permanently deletes an index and all of its data.',+ audience: 'ai',+ classification: 'DESTRUCTIVE',+ aiMetadata: {+ description:+ 'Permanently deletes an index and every record in it; this cannot be undone. Fails while deletion protection is enabled (turn it off with Configure Index first).',+ idempotent: false,+ },+ props: {+ indexName: pineconeAiProps.indexName({ required: true }),+ },+ async run(context) {+ const { indexName } = context.propsValue;+ const client = pineconeClient.create({ auth: context.auth });+ await client.indexes.delete(indexName);+ return { deleted: true, indexName };+ },+});diff --git a/packages/pieces/community/pinecone/src/lib/actions/ai/delete-namespace-alias.ts b/packages/pieces/community/pinecone/src/lib/actions/ai/delete-namespace-alias.tsnew file mode 100644index 00000000000..4aa6cee2f10--- /dev/null+++ b/packages/pieces/community/pinecone/src/lib/actions/ai/delete-namespace-alias.ts@@ -0,0 +1,37 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { pineconeAuth } from '../../auth';+import { pineconeAiProps } from '../../common/ai-props';+import { pineconeApi } from '../../common/api';+import { pineconeDeleteNamespaceAliasOutputSchema } from '../../output-schemas';++export const pineconeDeleteNamespaceAliasAction = createAction({+ auth: pineconeAuth,+ name: 'pinecone_delete_namespace_alias',+ outputSchema: pineconeDeleteNamespaceAliasOutputSchema,+ displayName: 'Delete Namespace Alias',+ description: 'Deletes a namespace alias.',+ audience: 'ai',+ classification: 'DESTRUCTIVE',+ aiMetadata: {+ description: 'Deletes a namespace alias. The namespace it pointed to and its records are kept.',+ idempotent: false,+ },+ props: {+ indexName: pineconeAiProps.indexName({ required: true }),+ aliasName: Property.ShortText({+ displayName: 'Alias Name',+ description: 'Namespace alias name, from List Namespace Aliases.',+ required: true,+ }),+ },+ async run(context) {+ const p = context.propsValue;+ await pineconeApi.deleteNamespaceAlias({+ auth: context.auth,+ indexName: p.indexName,+ aliasName: p.aliasName,+ });+ return { deleted: true, aliasName: p.aliasName };+ },+});diff --git a/packages/pieces/community/pinecone/src/lib/actions/ai/delete-namespace.ts b/packages/pieces/community/pinecone/src/lib/actions/ai/delete-namespace.tsnew file mode 100644index 00000000000..a309f899f4a--- /dev/null+++ b/packages/pieces/community/pinecone/src/lib/actions/ai/delete-namespace.ts@@ -0,0 +1,36 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { pineconeAuth } from '../../auth';+import { pineconeAiProps } from '../../common/ai-props';+import { pineconeClient } from '../../common/client';+import { pineconeDeleteNamespaceOutputSchema } from '../../output-schemas';++export const pineconeDeleteNamespaceAction = createAction({+ auth: pineconeAuth,+ name: 'pinecone_delete_namespace',+ outputSchema: pineconeDeleteNamespaceOutputSchema,+ displayName: 'Delete Namespace',+ description: 'Permanently deletes a namespace and all its records.',+ audience: 'ai',+ classification: 'DESTRUCTIVE',+ aiMetadata: {+ description:+ 'Permanently deletes a namespace and every record in it; this cannot be undone. Serverless indexes only.',+ idempotent: false,+ },+ props: {+ indexName: pineconeAiProps.indexName({ required: true }),+ namespace: Property.ShortText({+ displayName: 'Namespace',+ description: 'Namespace name, from List Namespaces.',+ required: true,+ }),+ },+ async run(context) {+ const p = context.propsValue;+ const client = pineconeClient.create({ auth: context.auth });+ const index = client.index({ name: p.indexName });+ await index.deleteNamespace(p.namespace);+ return { deleted: true, namespace: p.namespace };+ },+});diff --git a/packages/pieces/community/pinecone/src/lib/actions/ai/delete-vectors.ts b/packages/pieces/community/pinecone/src/lib/actions/ai/delete-vectors.tsnew file mode 100644index 00000000000..75a9e1bd973--- /dev/null+++ b/packages/pieces/community/pinecone/src/lib/actions/ai/delete-vectors.ts@@ -0,0 +1,67 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { pineconeAuth } from '../../auth';+import { pineconeAiProps } from '../../common/ai-props';+import { pineconeClient } from '../../common/client';+import { pineconeUtils } from '../../common/utils';+import { pineconeDeleteVectorsOutputSchema } from '../../output-schemas';++export const pineconeDeleteVectorsAction = createAction({+ auth: pineconeAuth,+ name: 'pinecone_delete_vectors',+ outputSchema: pineconeDeleteVectorsOutputSchema,+ displayName: 'Delete Vectors',+ description: 'Deletes records by ID, by metadata filter, or all records in a namespace.',+ audience: 'ai',+ classification: 'DESTRUCTIVE',+ aiMetadata: {+ description:+ 'Permanently deletes records from a namespace: the listed IDs, every record matching a metadata filter, or every record in the namespace. Set exactly one of Vector IDs, Filter or Delete All. Cannot be undone.',+ idempotent: false,+ },+ props: {+ indexName: pineconeAiProps.indexName({ required: true }),+ namespace: pineconeAiProps.namespace({ required: false }),+ ids: Property.Array({+ displayName: 'Vector IDs',+ description: 'IDs of the records to delete, e.g. ["vec-1", "vec-2"], up to 1000.',+ required: false,+ }),+ filter: Property.Json({+ displayName: 'Filter',+ description:+ 'Delete every record matching this metadata filter, e.g. {"genre": {"$eq": "drama"}}.',+ required: false,+ }),+ deleteAll: Property.Checkbox({+ displayName: 'Delete All',+ description: 'Delete every record in the namespace.',+ required: false,+ }),+ },+ async run(context) {+ const p = context.propsValue;+ const client = pineconeClient.create({ auth: context.auth });+ const modes = [p.ids !== undefined, p.filter !== undefined, p.deleteAll === true].filter(+ Boolean,+ ).length;+ if (modes !== 1) {+ throw new Error('Set exactly one of "Vector IDs", "Filter" or "Delete All".');+ }+ const index = client.index({+ name: p.indexName,+ ...(p.namespace !== undefined ? { namespace: p.namespace } : {}),+ });+ if (p.deleteAll === true) {+ await index.deleteAll();+ return { deleted: true, mode: 'all', namespace: p.namespace ?? '__default__' };+ }+ if (p.filter !== undefined) {+ await index.deleteMany({ filter: p.filter });+ return { deleted: true, mode: 'filter', filter: p.filter };+ }+ const ids = pineconeUtils.toStringList({ value: p.ids ?? [], propName: 'Vector IDs' });+ await index.deleteMany({ ids });+ return { deleted: true, mode: 'ids', ids };+ },+});diff --git a/packages/pieces/community/pinecone/src/lib/actions/ai/fetch-documents.ts b/packages/pieces/community/pinecone/src/lib/actions/ai/fetch-documents.tsnew file mode 100644index 00000000000..06883c3755c--- /dev/null+++ b/packages/pieces/community/pinecone/src/lib/actions/ai/fetch-documents.ts@@ -0,0 +1,75 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { pineconeAuth } from '../../auth';+import { pineconeAiProps } from '../../common/ai-props';+import { pineconeClient } from '../../common/client';+import { pineconeUtils } from '../../common/utils';+import { pineconeFetchDocumentsOutputSchema } from '../../output-schemas';++export const pineconeFetchDocumentsAction = createAction({+ auth: pineconeAuth,+ name: 'pinecone_fetch_documents',+ outputSchema: pineconeFetchDocumentsOutputSchema,+ displayName: 'Fetch Documents',+ description: 'Gets documents by ID or by metadata filter.',+ audience: 'ai',+ classification: 'SEARCH',+ aiMetadata: {+ description:+ 'Gets documents from a namespace by exact IDs or by a metadata filter (set exactly one), returning the fields you ask for, one page at a time. Works only on documents indexes (created by Create Index with Full-Text Fields).',+ idempotent: true,+ },+ props: {+ indexName: pineconeAiProps.indexName({ required: true }),+ namespace: pineconeAiProps.namespace({ required: false }),+ ids: Property.Array({+ displayName: 'Document IDs',+ description:+ 'IDs of the documents to get, e.g. ["doc-1"], from List Documents or Search Documents.',+ required: false,+ }),+ filter: Property.Json({+ displayName: 'Filter',+ description: 'Metadata filter selecting documents, e.g. {"year": {"$gte": 2020}}.',+ required: false,+ }),+ includeFields: Property.Array({+ displayName: 'Include Fields',+ description:+ 'Document fields to return, e.g. ["title", "body"]. Leave empty to return only IDs and scores.',+ required: false,+ }),+ limit: pineconeAiProps.limit({+ required: false,+ description: 'Maximum number of items to return, 1-100. Defaults to 10.',+ }),+ paginationToken: pineconeAiProps.paginationToken({ required: false }),+ },+ async run(context) {+ const p = context.propsValue;+ const client = pineconeClient.create({ auth: context.auth });+ if ((p.ids === undefined) === (p.filter === undefined)) {+ throw new Error('Set exactly one of "Document IDs" or "Filter".');+ }+ const documents = client.index({+ name: p.indexName,+ ...(p.namespace !== undefined ? { namespace: p.namespace } : {}),+ }).documents;+ return await documents.fetch({+ ...(p.ids !== undefined+ ? { ids: pineconeUtils.toStringList({ value: p.ids, propName: 'Document IDs' }) }+ : {}),+ ...(p.filter !== undefined ? { filter: p.filter } : {}),+ ...(p.includeFields !== undefined+ ? {+ includeFields: pineconeUtils.toStringList({+ value: p.includeFields,+ propName: 'Include Fields',+ }),+ }+ : {}),+ ...(p.limit !== undefined ? { limit: p.limit } : {}),+ ...(p.paginationToken !== undefined ? { paginationToken: p.paginationToken } : {}),+ });+ },+});diff --git a/packages/pieces/community/pinecone/src/lib/actions/ai/fetch-vectors-by-metadata.ts b/packages/pieces/community/pinecone/src/lib/actions/ai/fetch-vectors-by-metadata.tsnew file mode 100644index 00000000000..d9f3e99cd28--- /dev/null+++ b/packages/pieces/community/pinecone/src/lib/actions/ai/fetch-vectors-by-metadata.ts@@ -0,0 +1,48 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { pineconeAuth } from '../../auth';+import { pineconeAiProps } from '../../common/ai-props';+import { pineconeClient } from '../../common/client';+import { pineconeFetchVectorsByMetadataOutputSchema } from '../../output-schemas';++export const pineconeFetchVectorsByMetadataAction = createAction({+ auth: pineconeAuth,+ name: 'pinecone_fetch_vectors_by_metadata',+ outputSchema: pineconeFetchVectorsByMetadataOutputSchema,+ displayName: 'Fetch Vectors by Metadata',+ description: 'Gets vector records whose metadata matches a filter.',+ audience: 'ai',+ classification: 'SEARCH',+ aiMetadata: {+ description:+ 'Gets vector records whose metadata matches a filter, one page at a time, without a query vector. Pass the returned pagination token with the same filter for the next page.',+ idempotent: true,+ },+ props: {+ indexName: pineconeAiProps.indexName({ required: true }),+ namespace: pineconeAiProps.namespace({ required: false }),+ filter: Property.Json({+ displayName: 'Metadata Filter',+ description: 'Metadata filter, e.g. {"genre": {"$eq": "drama"}, "year": {"$gte": 2020}}.',+ required: true,+ }),+ limit: pineconeAiProps.limit({+ required: false,+ description: 'Maximum number of items to return, 1-10000. Defaults to 100.',+ }),+ paginationToken: pineconeAiProps.paginationToken({ required: false }),+ },+ async run(context) {+ const p = context.propsValue;+ const client = pineconeClient.create({ auth: context.auth });+ const index = client.index({+ name: p.indexName,+ ...(p.namespace !== undefined ? { namespace: p.namespace } : {}),+ });+ return await index.fetchByMetadata({+ filter: p.filter,+ ...(p.limit !== undefined ? { limit: p.limit } : {}),+ ...(p.paginationToken !== undefined ? { paginationToken: p.paginationToken } : {}),+ });+ },+});diff --git a/packages/pieces/community/pinecone/src/lib/actions/ai/fetch-vectors.ts b/packages/pieces/community/pinecone/src/lib/actions/ai/fetch-vectors.tsnew file mode 100644index 00000000000..e88075c79a2--- /dev/null+++ b/packages/pieces/community/pinecone/src/lib/actions/ai/fetch-vectors.ts@@ -0,0 +1,43 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { pineconeAuth } from '../../auth';+import { pineconeAiProps } from '../../common/ai-props';+import { pineconeClient } from '../../common/client';+import { pineconeUtils } from '../../common/utils';+import { pineconeFetchVectorsOutputSchema } from '../../output-schemas';++export const pineconeFetchVectorsAction = createAction({+ auth: pineconeAuth,+ name: 'pinecone_fetch_vectors',+ outputSchema: pineconeFetchVectorsOutputSchema,+ displayName: 'Fetch Vectors',+ description: 'Gets vector records by ID.',+ audience: 'ai',+ classification: 'READ',+ aiMetadata: {+ description:+ 'Gets vector records by exact ID from a namespace, with their values and metadata. IDs that do not exist are simply missing from the result. For similarity search use Query Vectors.',+ idempotent: true,+ },+ props: {+ indexName: pineconeAiProps.indexName({ required: true }),+ namespace: pineconeAiProps.namespace({ required: false }),+ ids: Property.Array({+ displayName: 'Vector IDs',+ description:+ 'IDs of the records to get, e.g. ["vec-1", "vec-2"], from List Vector IDs or Query Vectors.',+ required: true,+ }),+ },+ async run(context) {+ const p = context.propsValue;+ const client = pineconeClient.create({ auth: context.auth });+ const index = client.index({+ name: p.indexName,+ ...(p.namespace !== undefined ? { namespace: p.namespace } : {}),+ });+ return await index.fetch({+ ids: pineconeUtils.toStringList({ value: p.ids, propName: 'Vector IDs' }),+ });+ },+});diff --git a/packages/pieces/community/pinecone/src/lib/actions/ai/generate-embeddings.ts b/packages/pieces/community/pinecone/src/lib/actions/ai/generate-embeddings.tsnew file mode 100644index 00000000000..33f4f5d440d--- /dev/null+++ b/packages/pieces/community/pinecone/src/lib/actions/ai/generate-embeddings.ts@@ -0,0 +1,66 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { pineconeAuth } from '../../auth';+import { pineconeClient } from '../../common/client';+import { pineconeUtils } from '../../common/utils';+import { pineconeGenerateEmbeddingsOutputSchema } from '../../output-schemas';++export const pineconeGenerateEmbeddingsAction = createAction({+ auth: pineconeAuth,+ name: 'pinecone_generate_embeddings',+ outputSchema: pineconeGenerateEmbeddingsOutputSchema,+ displayName: 'Generate Embeddings',+ description: 'Turns text into vectors with a Pinecone-hosted embedding model.',+ audience: 'ai',+ classification: 'READ',+ aiMetadata: {+ description:+ 'Embeds up to 96 texts with a hosted model (from List Models) and returns one vector per input, in order. Most models (e.g. llama-text-embed-v2, multilingual-e5-large) require Input Type. Use the vectors with Upsert Vectors or Query Vectors on an index of the same dimension.',+ idempotent: true,+ },+ props: {+ model: Property.ShortText({+ displayName: 'Model',+ description:+ 'Embedding model, from List Models, e.g. "llama-text-embed-v2", "multilingual-e5-large" or "pinecone-sparse-english-v0".',+ required: true,+ }),+ inputs: Property.Array({+ displayName: 'Texts',+ description: 'Texts to embed, e.g. ["Apples are rich in fiber."].',+ required: true,+ }),+ inputType: Property.StaticDropdown<'passage' | 'query', false>({+ displayName: 'Input Type',+ description: '"passage" for text you store, "query" for text you search with.',+ required: false,+ options: {+ options: [+ { label: 'Passage', value: 'passage' },+ { label: 'Query', value: 'query' },+ ],+ },+ }),+ parameters: Property.Json({+ displayName: 'Other Parameters',+ description:+ 'Other model parameters as strings, e.g. {"truncate": "END", "dimension": "512"}.',+ required: false,+ }),+ },+ async run(context) {+ const p = context.propsValue;+ const client = pineconeClient.create({ auth: context.auth });+ const parameters = {+ ...(p.parameters !== undefined+ ? pineconeUtils.toStringMap({ value: p.parameters, propName: 'Other Parameters' })+ : {}),+ ...(p.inputType !== undefined ? { input_type: p.inputType } : {}),+ };+ return await client.inference.embed({+ model: p.model,+ inputs: pineconeUtils.toStringList({ value: p.inputs, propName: 'Texts' }),+ ...(Object.keys(parameters).length > 0 ? { parameters } : {}),+ });+ },+});diff --git a/packages/pieces/community/pinecone/src/lib/actions/ai/get-assistant-file.ts b/packages/pieces/community/pinecone/src/lib/actions/ai/get-assistant-file.tsnew file mode 100644index 00000000000..5f094dbed2a--- /dev/null+++ b/packages/pieces/community/pinecone/src/lib/actions/ai/get-assistant-file.ts@@ -0,0 +1,43 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { pineconeAuth } from '../../auth';+import { pineconeClient } from '../../common/client';+import { pineconeGetAssistantFileOutputSchema } from '../../output-schemas';++export const pineconeGetAssistantFileAction = createAction({+ auth: pineconeAuth,+ name: 'pinecone_get_assistant_file',+ outputSchema: pineconeGetAssistantFileOutputSchema,+ displayName: 'Get Assistant File',+ description: 'Gets one file of an assistant and its processing status.',+ audience: 'ai',+ classification: 'READ',+ aiMetadata: {+ description:+ 'Gets one assistant file by ID: name, status (Processing, Available, Failed\u2026), percent done, metadata and, optionally, a temporary download URL.',+ idempotent: true,+ },+ props: {+ assistantName: Property.ShortText({+ displayName: 'Assistant Name',+ description: 'Name of the assistant, from List Assistants.',+ required: true,+ }),+ fileId: Property.ShortText({+ displayName: 'File ID',+ description: 'Assistant file ID, from List Assistant Files or Upload Assistant File.',+ required: true,+ }),+ includeUrl: Property.Checkbox({+ displayName: 'Include Download URL',+ description: 'Also return a temporary signed URL to download the file.',+ required: false,+ }),+ },+ async run(context) {+ const p = context.propsValue;+ const client = pineconeClient.create({ auth: context.auth });+ const assistant = client.assistant({ name: p.assistantName });+ return await assistant.describeFile(p.fileId, p.includeUrl ?? false);+ },+});diff --git a/packages/pieces/community/pinecone/src/lib/actions/ai/get-assistant-operation.ts b/packages/pieces/community/pinecone/src/lib/actions/ai/get-assistant-operation.tsnew file mode 100644index 00000000000..7fbd660336a--- /dev/null+++ b/packages/pieces/community/pinecone/src/lib/actions/ai/get-assistant-operation.ts@@ -0,0 +1,39 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { pineconeAuth } from '../../auth';+import { pineconeClient } from '../../common/client';+import { pineconeGetAssistantOperationOutputSchema } from '../../output-schemas';++export const pineconeGetAssistantOperationAction = createAction({+ auth: pineconeAuth,+ name: 'pinecone_get_assistant_operation',+ outputSchema: pineconeGetAssistantOperationOutputSchema,+ displayName: 'Get Assistant Operation',+ description: 'Gets the status of one assistant file operation.',+ audience: 'ai',+ classification: 'READ',+ aiMetadata: {+ description:+ 'Gets one assistant file operation by ID, once: status, percent done and any error. Use it to poll Upload, Replace or Delete Assistant File.',+ idempotent: true,+ },+ props: {+ assistantName: Property.ShortText({+ displayName: 'Assistant Name',+ description: 'Name of the assistant, from List Assistants.',+ required: true,+ }),+ operationId: Property.ShortText({+ displayName: 'Operation ID',+ description:+ 'Operation ID, from Upload, Replace or Delete Assistant File, or List Assistant Operations.',+ required: true,+ }),+ },+ async run(context) {+ const p = context.propsValue;+ const client = pineconeClient.create({ auth: context.auth });+ const assistant = client.assistant({ name: p.assistantName });+ return await assistant.describeOperation(p.operationId);+ },+});diff --git a/packages/pieces/community/pinecone/src/lib/actions/ai/get-assistant.ts b/packages/pieces/community/pinecone/src/lib/actions/ai/get-assistant.tsnew file mode 100644index 00000000000..5198dd183eb--- /dev/null+++ b/packages/pieces/community/pinecone/src/lib/actions/ai/get-assistant.ts@@ -0,0 +1,32 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { pineconeAuth } from '../../auth';+import { pineconeClient } from '../../common/client';+import { pineconeCreateAssistantOutputSchema } from '../../output-schemas';++export const pineconeGetAssistantAction = createAction({+ auth: pineconeAuth,+ name: 'pinecone_get_assistant',+ outputSchema: pineconeCreateAssistantOutputSchema,+ displayName: 'Get Assistant',+ description: 'Gets one assistant and its status.',+ audience: 'ai',+ classification: 'READ',+ aiMetadata: {+ description:+ 'Gets one assistant by name: status (Initializing, Ready, Failed\u2026), host, instructions and metadata.',+ idempotent: true,+ },+ props: {+ assistantName: Property.ShortText({+ displayName: 'Assistant Name',+ description: 'Name of the assistant, from List Assistants.',+ required: true,+ }),+ },+ async run(context) {+ const p = context.propsValue;+ const client = pineconeClient.create({ auth: context.auth });+ return await client.assistants.describe(p.assistantName);+ },+});diff --git a/packages/pieces/community/pinecone/src/lib/actions/ai/get-import.ts b/packages/pieces/community/pinecone/src/lib/actions/ai/get-import.tsnew file mode 100644index 00000000000..3c4e8d18ff9--- /dev/null+++ b/packages/pieces/community/pinecone/src/lib/actions/ai/get-import.ts@@ -0,0 +1,35 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { pineconeAuth } from '../../auth';+import { pineconeAiProps } from '../../common/ai-props';+import { pineconeClient } from '../../common/client';+import { pineconeGetImportOutputSchema } from '../../output-schemas';++export const pineconeGetImportAction = createAction({+ auth: pineconeAuth,+ name: 'pinecone_get_import',+ outputSchema: pineconeGetImportOutputSchema,+ displayName: 'Get Import',+ description: 'Gets the status of one bulk import.',+ audience: 'ai',+ classification: 'READ',+ aiMetadata: {+ description:+ 'Gets one bulk import by ID, once: status, percent complete, records imported and any error. Use it to poll an import started with Start Import.',+ idempotent: true,+ },+ props: {+ indexName: pineconeAiProps.indexName({ required: true }),+ importId: Property.ShortText({+ displayName: 'Import ID',+ description: 'Import operation ID, from Start Import or List Imports.',+ required: true,+ }),+ },+ async run(context) {+ const p = context.propsValue;+ const client = pineconeClient.create({ auth: context.auth });+ const index = client.index({ name: p.indexName });+ return await index.describeImport(p.importId);+ },+});diff --git a/packages/pieces/community/pinecone/src/lib/actions/ai/get-index-stats.ts b/packages/pieces/community/pinecone/src/lib/actions/ai/get-index-stats.tsnew file mode 100644index 00000000000..fd3b466abd4--- /dev/null+++ b/packages/pieces/community/pinecone/src/lib/actions/ai/get-index-stats.ts@@ -0,0 +1,36 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { pineconeAuth } from '../../auth';+import { pineconeAiProps } from '../../common/ai-props';+import { pineconeClient } from '../../common/client';+import { pineconeGetIndexStatsOutputSchema } from '../../output-schemas';++export const pineconeGetIndexStatsAction = createAction({+ auth: pineconeAuth,+ name: 'pinecone_get_index_stats',+ outputSchema: pineconeGetIndexStatsOutputSchema,+ displayName: 'Get Index Stats',+ description: 'Gets record counts per namespace and fullness for an index.',+ audience: 'ai',+ classification: 'READ',+ aiMetadata: {+ description:+ 'Gets statistics for a vector index: total record count, record count per namespace, dimension, metric and fullness. Optionally counts only records matching a metadata filter, on pod-based indexes only: serverless indexes reject a filter.',+ idempotent: true,+ },+ props: {+ indexName: pineconeAiProps.indexName({ required: true }),+ filter: Property.Json({+ displayName: 'Metadata Filter',+ description:+ 'Pod-based indexes only: count only records whose metadata matches this filter, e.g. {"genre": {"$eq": "drama"}}. Serverless indexes reject it.',+ required: false,+ }),+ },+ async run(context) {+ const { indexName, filter } = context.propsValue;+ const client = pineconeClient.create({ auth: context.auth });+ const index = client.index({ name: indexName });+ return await index.describeIndexStats(filter ? { filter } : undefined);+ },+});diff --git a/packages/pieces/community/pinecone/src/lib/actions/ai/get-index.ts b/packages/pieces/community/pinecone/src/lib/actions/ai/get-index.tsnew file mode 100644index 00000000000..0e6be10c2ab--- /dev/null+++ b/packages/pieces/community/pinecone/src/lib/actions/ai/get-index.ts@@ -0,0 +1,28 @@+import { createAction } from '@activepieces/pieces-framework';++import { pineconeAuth } from '../../auth';+import { pineconeAiProps } from '../../common/ai-props';+import { pineconeClient } from '../../common/client';+import { pineconeGetIndexOutputSchema } from '../../output-schemas';++export const pineconeGetIndexAction = createAction({+ auth: pineconeAuth,+ name: 'pinecone_get_index',+ outputSchema: pineconeGetIndexOutputSchema,+ displayName: 'Get Index',+ description: 'Gets one index by name.',+ audience: 'ai',+ classification: 'READ',+ aiMetadata: {+ description:+ 'Gets one index by its exact name: host, readiness status, deployment, schema, read capacity, tags and deletion protection. Use it to check an index is ready before writing to it.',+ idempotent: true,+ },+ props: {+ indexName: pineconeAiProps.indexName({ required: true }),+ },+ async run(context) {+ const client = pineconeClient.create({ auth: context.auth });+ return await client.indexes.describe(context.propsValue.indexName);+ },+});diff --git a/packages/pieces/community/pinecone/src/lib/actions/ai/get-model.ts b/packages/pieces/community/pinecone/src/lib/actions/ai/get-model.tsnew file mode 100644index 00000000000..821d882cd0e--- /dev/null+++ b/packages/pieces/community/pinecone/src/lib/actions/ai/get-model.ts@@ -0,0 +1,32 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { pineconeAuth } from '../../auth';+import { pineconeClient } from '../../common/client';+import { pineconeGetModelOutputSchema } from '../../output-schemas';++export const pineconeGetModelAction = createAction({+ auth: pineconeAuth,+ name: 'pinecone_get_model',+ outputSchema: pineconeGetModelOutputSchema,+ displayName: 'Get Model',+ description: 'Gets details of one hosted model.',+ audience: 'ai',+ classification: 'READ',+ aiMetadata: {+ description:+ 'Gets one hosted model by name: type, supported dimensions, metrics, parameters and limits.',+ idempotent: true,+ },+ props: {+ modelName: Property.ShortText({+ displayName: 'Model Name',+ description: 'Hosted model name, from List Models, e.g. "llama-text-embed-v2".',+ required: true,+ }),+ },+ async run(context) {+ const p = context.propsValue;+ const client = pineconeClient.create({ auth: context.auth });+ return await client.inference.getModel(p.modelName);+ },+});diff --git a/packages/pieces/community/pinecone/src/lib/actions/ai/get-namespace-alias.ts b/packages/pieces/community/pinecone/src/lib/actions/ai/get-namespace-alias.tsnew file mode 100644index 00000000000..2bcd25b955b--- /dev/null+++ b/packages/pieces/community/pinecone/src/lib/actions/ai/get-namespace-alias.ts@@ -0,0 +1,36 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { pineconeAuth } from '../../auth';+import { pineconeAiProps } from '../../common/ai-props';+import { pineconeApi } from '../../common/api';+import { pineconeCreateNamespaceAliasOutputSchema } from '../../output-schemas';++export const pineconeGetNamespaceAliasAction = createAction({+ auth: pineconeAuth,+ name: 'pinecone_get_namespace_alias',+ outputSchema: pineconeCreateNamespaceAliasOutputSchema,+ displayName: 'Get Namespace Alias',+ description: 'Gets one namespace alias.',+ audience: 'ai',+ classification: 'READ',+ aiMetadata: {+ description: 'Gets one namespace alias by name and the namespace it points to.',+ idempotent: true,+ },+ props: {+ indexName: pineconeAiProps.indexName({ required: true }),+ aliasName: Property.ShortText({+ displayName: 'Alias Name',+ description: 'Namespace alias name, from List Namespace Aliases.',+ required: true,+ }),+ },+ async run(context) {+ const p = context.propsValue;+ return await pineconeApi.getNamespaceAlias({+ auth: context.auth,+ indexName: p.indexName,+ aliasName: p.aliasName,+ });+ },+});diff --git a/packages/pieces/community/pinecone/src/lib/actions/ai/get-namespace.ts b/packages/pieces/community/pinecone/src/lib/actions/ai/get-namespace.tsnew file mode 100644index 00000000000..93e71f71ac7--- /dev/null+++ b/packages/pieces/community/pinecone/src/lib/actions/ai/get-namespace.ts@@ -0,0 +1,35 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { pineconeAuth } from '../../auth';+import { pineconeAiProps } from '../../common/ai-props';+import { pineconeClient } from '../../common/client';+import { pineconeGetNamespaceOutputSchema } from '../../output-schemas';++export const pineconeGetNamespaceAction = createAction({+ auth: pineconeAuth,+ name: 'pinecone_get_namespace',+ outputSchema: pineconeGetNamespaceOutputSchema,+ displayName: 'Get Namespace',+ description: 'Gets one namespace of an index.',+ audience: 'ai',+ classification: 'READ',+ aiMetadata: {+ description:+ 'Gets one namespace of an index by name: record count and indexed metadata fields.',+ idempotent: true,+ },+ props: {+ indexName: pineconeAiProps.indexName({ required: true }),+ namespace: Property.ShortText({+ displayName: 'Namespace',+ description: 'Namespace name, from List Namespaces.',+ required: true,+ }),+ },+ async run(context) {+ const p = context.propsValue;+ const client = pineconeClient.create({ auth: context.auth });+ const index = client.index({ name: p.indexName });+ return await index.describeNamespace(p.namespace);+ },+});diff --git a/packages/pieces/community/pinecone/src/lib/actions/ai/index.ts b/packages/pieces/community/pinecone/src/lib/actions/ai/index.tsnew file mode 100644index 00000000000..914de0a5089--- /dev/null+++ b/packages/pieces/community/pinecone/src/lib/actions/ai/index.ts@@ -0,0 +1,111 @@+import { pineconeCancelImportAction } from './cancel-import';+import { pineconeChatCompletionWithAssistantAction } from './chat-completion-with-assistant';+import { pineconeChatWithAssistantAction } from './chat-with-assistant';+import { pineconeConfigureIndexAction } from './configure-index';+import { pineconeCreateAssistantAction } from './create-assistant';+import { pineconeCreateIndexAction } from './create-index';+import { pineconeCreateIndexForModelAction } from './create-index-for-model';+import { pineconeCreateNamespaceAction } from './create-namespace';+import { pineconeCreateNamespaceAliasAction } from './create-namespace-alias';+import { pineconeDeleteAssistantAction } from './delete-assistant';+import { pineconeDeleteAssistantFileAction } from './delete-assistant-file';+import { pineconeDeleteDocumentsAction } from './delete-documents';+import { pineconeDeleteIndexAction } from './delete-index';+import { pineconeDeleteNamespaceAction } from './delete-namespace';+import { pineconeDeleteNamespaceAliasAction } from './delete-namespace-alias';+import { pineconeDeleteVectorsAction } from './delete-vectors';+import { pineconeFetchDocumentsAction } from './fetch-documents';+import { pineconeFetchVectorsAction } from './fetch-vectors';+import { pineconeFetchVectorsByMetadataAction } from './fetch-vectors-by-metadata';+import { pineconeGenerateEmbeddingsAction } from './generate-embeddings';+import { pineconeGetAssistantAction } from './get-assistant';+import { pineconeGetAssistantFileAction } from './get-assistant-file';+import { pineconeGetAssistantOperationAction } from './get-assistant-operation';+import { pineconeGetImportAction } from './get-import';+import { pineconeGetIndexAction } from './get-index';+import { pineconeGetIndexStatsAction } from './get-index-stats';+import { pineconeGetModelAction } from './get-model';+import { pineconeGetNamespaceAction } from './get-namespace';+import { pineconeGetNamespaceAliasAction } from './get-namespace-alias';+import { pineconeListAssistantFilesAction } from './list-assistant-files';+import { pineconeListAssistantOperationsAction } from './list-assistant-operations';+import { pineconeListAssistantsAction } from './list-assistants';+import { pineconeListDocumentsAction } from './list-documents';+import { pineconeListImportsAction } from './list-imports';+import { pineconeListIndexesAction } from './list-indexes';+import { pineconeListModelsAction } from './list-models';+import { pineconeListNamespaceAliasesAction } from './list-namespace-aliases';+import { pineconeListNamespacesAction } from './list-namespaces';+import { pineconeListVectorIdsAction } from './list-vector-ids';+import { pineconeQueryVectorsAction } from './query-vectors';+import { pineconeReplaceAssistantFileAction } from './replace-assistant-file';+import { pineconeRepointNamespaceAliasAction } from './repoint-namespace-alias';+import { pineconeRerankDocumentsAction } from './rerank-documents';+import { pineconeRetrieveAssistantContextAction } from './retrieve-assistant-context';+import { pineconeSearchDocumentsAction } from './search-documents';+import { pineconeSearchTextRecordsAction } from './search-text-records';+import { pineconeStartImportAction } from './start-import';+import { pineconeUpdateAssistantAction } from './update-assistant';+import { pineconeUpdateDocumentsAction } from './update-documents';+import { pineconeUpdateVectorAction } from './update-vector';+import { pineconeUploadAssistantFileAction } from './upload-assistant-file';+import { pineconeUpsertDocumentsAction } from './upsert-documents';+import { pineconeUpsertTextRecordsAction } from './upsert-text-records';+import { pineconeUpsertVectorsAction } from './upsert-vectors';++export const pineconeAiActions = [+ pineconeListIndexesAction,+ pineconeGetIndexAction,+ pineconeCreateIndexAction,+ pineconeCreateIndexForModelAction,+ pineconeConfigureIndexAction,+ pineconeDeleteIndexAction,+ pineconeGetIndexStatsAction,+ pineconeUpsertVectorsAction,+ pineconeFetchVectorsAction,+ pineconeFetchVectorsByMetadataAction,+ pineconeListVectorIdsAction,+ pineconeUpdateVectorAction,+ pineconeDeleteVectorsAction,+ pineconeQueryVectorsAction,+ pineconeListNamespacesAction,+ pineconeCreateNamespaceAction,+ pineconeGetNamespaceAction,+ pineconeDeleteNamespaceAction,+ pineconeListNamespaceAliasesAction,+ pineconeCreateNamespaceAliasAction,+ pineconeGetNamespaceAliasAction,+ pineconeRepointNamespaceAliasAction,+ pineconeDeleteNamespaceAliasAction,+ pineconeUpsertDocumentsAction,+ pineconeFetchDocumentsAction,+ pineconeListDocumentsAction,+ pineconeSearchDocumentsAction,+ pineconeUpdateDocumentsAction,+ pineconeDeleteDocumentsAction,+ pineconeUpsertTextRecordsAction,+ pineconeSearchTextRecordsAction,+ pineconeStartImportAction,+ pineconeListImportsAction,+ pineconeGetImportAction,+ pineconeCancelImportAction,+ pineconeGenerateEmbeddingsAction,+ pineconeRerankDocumentsAction,+ pineconeListModelsAction,+ pineconeGetModelAction,+ pineconeListAssistantsAction,+ pineconeCreateAssistantAction,+ pineconeGetAssistantAction,+ pineconeUpdateAssistantAction,+ pineconeDeleteAssistantAction,+ pineconeChatWithAssistantAction,+ pineconeChatCompletionWithAssistantAction,+ pineconeRetrieveAssistantContextAction,+ pineconeListAssistantFilesAction,+ pineconeUploadAssistantFileAction,+ pineconeGetAssistantFileAction,+ pineconeReplaceAssistantFileAction,+ pineconeDeleteAssistantFileAction,+ pineconeListAssistantOperationsAction,+ pineconeGetAssistantOperationAction,+];diff --git a/packages/pieces/community/pinecone/src/lib/actions/ai/list-assistant-files.ts b/packages/pieces/community/pinecone/src/lib/actions/ai/list-assistant-files.tsnew file mode 100644index 00000000000..3255c151225--- /dev/null+++ b/packages/pieces/community/pinecone/src/lib/actions/ai/list-assistant-files.ts@@ -0,0 +1,38 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { pineconeAuth } from '../../auth';+import { pineconeClient } from '../../common/client';+import { pineconeListAssistantFilesOutputSchema } from '../../output-schemas';++export const pineconeListAssistantFilesAction = createAction({+ auth: pineconeAuth,+ name: 'pinecone_list_assistant_files',+ outputSchema: pineconeListAssistantFilesOutputSchema,+ displayName: 'List Assistant Files',+ description: 'Lists the files of an assistant.',+ audience: 'ai',+ classification: 'SEARCH',+ aiMetadata: {+ description:+ 'Lists the files uploaded to an assistant with their IDs, status and metadata, optionally only files whose metadata matches a filter.',+ idempotent: true,+ },+ props: {+ assistantName: Property.ShortText({+ displayName: 'Assistant Name',+ description: 'Name of the assistant, from List Assistants.',+ required: true,+ }),+ filter: Property.Json({+ displayName: 'Metadata Filter',+ description: 'Only list files whose metadata matches, e.g. {"department": "support"}.',+ required: false,+ }),+ },+ async run(context) {+ const p = context.propsValue;+ const client = pineconeClient.create({ auth: context.auth });+ const assistant = client.assistant({ name: p.assistantName });+ return await assistant.listFiles(p.filter !== undefined ? { filter: p.filter } : undefined);+ },+});diff --git a/packages/pieces/community/pinecone/src/lib/actions/ai/list-assistant-operations.ts b/packages/pieces/community/pinecone/src/lib/actions/ai/list-assistant-operations.tsnew file mode 100644index 00000000000..f6d6b3da830--- /dev/null+++ b/packages/pieces/community/pinecone/src/lib/actions/ai/list-assistant-operations.ts@@ -0,0 +1,70 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { pineconeAuth } from '../../auth';+import { pineconeAiProps } from '../../common/ai-props';+import { pineconeClient } from '../../common/client';+import { pineconeListAssistantOperationsOutputSchema } from '../../output-schemas';++export const pineconeListAssistantOperationsAction = createAction({+ auth: pineconeAuth,+ name: 'pinecone_list_assistant_operations',+ outputSchema: pineconeListAssistantOperationsOutputSchema,+ displayName: 'List Assistant Operations',+ description: 'Lists file processing operations of an assistant.',+ audience: 'ai',+ classification: 'SEARCH',+ aiMetadata: {+ description:+ "Lists an assistant's file operations (uploads, replacements, deletions) with status, one page at a time, optionally filtered by type or status. Pass the returned pagination token with the same filters for the next page.",+ idempotent: true,+ },+ props: {+ assistantName: Property.ShortText({+ displayName: 'Assistant Name',+ description: 'Name of the assistant, from List Assistants.',+ required: true,+ }),+ operationType: Property.StaticDropdown({+ displayName: 'Operation Type',+ description:+ 'Only list this type: upload_file, upsert_file, delete_file or update_file_metadata.',+ required: false,+ options: {+ options: [+ { label: 'Upload File', value: 'upload_file' },+ { label: 'Upsert File', value: 'upsert_file' },+ { label: 'Delete File', value: 'delete_file' },+ { label: 'Update File Metadata', value: 'update_file_metadata' },+ ],+ },+ }),+ status: Property.StaticDropdown({+ displayName: 'Status',+ description: 'Only list this status: Processing, Completed or Failed.',+ required: false,+ options: {+ options: [+ { label: 'Processing', value: 'Processing' },+ { label: 'Completed', value: 'Completed' },+ { label: 'Failed', value: 'Failed' },+ ],+ },+ }),+ limit: pineconeAiProps.limit({+ required: false,+ description: 'Maximum number of items to return, 1-100. Defaults to 100.',+ }),+ paginationToken: pineconeAiProps.paginationToken({ required: false }),+ },+ async run(context) {+ const p = context.propsValue;+ const client = pineconeClient.create({ auth: context.auth });+ const assistant = client.assistant({ name: p.assistantName });+ return await assistant.listOperations({+ ...(p.operationType !== undefined ? { operationType: p.operationType } : {}),+ ...(p.status !== undefined ? { status: p.status } : {}),+ ...(p.limit !== undefined ? { limit: p.limit } : {}),+ ...(p.paginationToken !== undefined ? { paginationToken: p.paginationToken } : {}),+ });+ },+});diff --git a/packages/pieces/community/pinecone/src/lib/actions/ai/list-assistants.ts b/packages/pieces/community/pinecone/src/lib/actions/ai/list-assistants.tsnew file mode 100644index 00000000000..fe388b932d7--- /dev/null+++ b/packages/pieces/community/pinecone/src/lib/actions/ai/list-assistants.ts@@ -0,0 +1,25 @@+import { createAction } from '@activepieces/pieces-framework';++import { pineconeAuth } from '../../auth';+import { pineconeClient } from '../../common/client';+import { pineconeListAssistantsOutputSchema } from '../../output-schemas';++export const pineconeListAssistantsAction = createAction({+ auth: pineconeAuth,+ name: 'pinecone_list_assistants',+ outputSchema: pineconeListAssistantsOutputSchema,+ displayName: 'List Assistants',+ description: 'Lists the assistants in the project.',+ audience: 'ai',+ classification: 'SEARCH',+ aiMetadata: {+ description:+ 'Lists every assistant in the project with its name, status, host, instructions and metadata. Use the name with the other assistant actions.',+ idempotent: true,+ },+ props: {},+ async run(context) {+ const client = pineconeClient.create({ auth: context.auth });+ return await client.assistants.list();+ },+});diff --git a/packages/pieces/community/pinecone/src/lib/actions/ai/list-documents.ts b/packages/pieces/community/pinecone/src/lib/actions/ai/list-documents.tsnew file mode 100644index 00000000000..c4c53d2c2ab--- /dev/null+++ b/packages/pieces/community/pinecone/src/lib/actions/ai/list-documents.ts@@ -0,0 +1,48 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { pineconeAuth } from '../../auth';+import { pineconeAiProps } from '../../common/ai-props';+import { pineconeClient } from '../../common/client';+import { pineconeListDocumentsOutputSchema } from '../../output-schemas';++export const pineconeListDocumentsAction = createAction({+ auth: pineconeAuth,+ name: 'pinecone_list_documents',+ outputSchema: pineconeListDocumentsOutputSchema,+ displayName: 'List Documents',+ description: 'Lists document IDs in a namespace.',+ audience: 'ai',+ classification: 'SEARCH',+ aiMetadata: {+ description:+ 'Lists document IDs in a namespace, optionally only IDs starting with a prefix, one page at a time. Pass the returned pagination token with the same prefix for the next page. Works only on documents indexes (created by Create Index with Full-Text Fields).',+ idempotent: true,+ },+ props: {+ indexName: pineconeAiProps.indexName({ required: true }),+ namespace: pineconeAiProps.namespace({ required: false }),+ prefix: Property.ShortText({+ displayName: 'ID Prefix',+ description: 'Only list IDs that start with this text.',+ required: false,+ }),+ limit: pineconeAiProps.limit({+ required: false,+ description: 'Maximum number of items to return, 1-100. Defaults to 100.',+ }),+ paginationToken: pineconeAiProps.paginationToken({ required: false }),+ },+ async run(context) {+ const p = context.propsValue;+ const client = pineconeClient.create({ auth: context.auth });+ const documents = client.index({+ name: p.indexName,+ ...(p.namespace !== undefined ? { namespace: p.namespace } : {}),+ }).documents;+ return await documents.list({+ ...(p.prefix !== undefined ? { prefix: p.prefix } : {}),+ ...(p.limit !== undefined ? { limit: p.limit } : {}),+ ...(p.paginationToken !== undefined ? { paginationToken: p.paginationToken } : {}),+ });+ },+});diff --git a/packages/pieces/community/pinecone/src/lib/actions/ai/list-imports.ts b/packages/pieces/community/pinecone/src/lib/actions/ai/list-imports.tsnew file mode 100644index 00000000000..e4d6f48b451--- /dev/null+++ b/packages/pieces/community/pinecone/src/lib/actions/ai/list-imports.ts@@ -0,0 +1,35 @@+import { createAction } from '@activepieces/pieces-framework';++import { pineconeAuth } from '../../auth';+import { pineconeAiProps } from '../../common/ai-props';+import { pineconeClient } from '../../common/client';+import { pineconeListImportsOutputSchema } from '../../output-schemas';++export const pineconeListImportsAction = createAction({+ auth: pineconeAuth,+ name: 'pinecone_list_imports',+ outputSchema: pineconeListImportsOutputSchema,+ displayName: 'List Imports',+ description: 'Lists the bulk imports of an index.',+ audience: 'ai',+ classification: 'SEARCH',+ aiMetadata: {+ description:+ 'Lists the recent bulk imports of an index with status and progress, one page at a time. Pass the returned pagination token for the next page.',+ idempotent: true,+ },+ props: {+ indexName: pineconeAiProps.indexName({ required: true }),+ limit: pineconeAiProps.limit({+ required: false,+ description: 'Maximum number of items to return, 1-100. Defaults to 100.',+ }),+ paginationToken: pineconeAiProps.paginationToken({ required: false }),+ },+ async run(context) {+ const p = context.propsValue;+ const client = pineconeClient.create({ auth: context.auth });+ const index = client.index({ name: p.indexName });+ return await index.listImports(p.limit, p.paginationToken);+ },+});diff --git a/packages/pieces/community/pinecone/src/lib/actions/ai/list-indexes.ts b/packages/pieces/community/pinecone/src/lib/actions/ai/list-indexes.tsnew file mode 100644index 00000000000..557c4f60afb--- /dev/null+++ b/packages/pieces/community/pinecone/src/lib/actions/ai/list-indexes.ts@@ -0,0 +1,25 @@+import { createAction } from '@activepieces/pieces-framework';++import { pineconeAuth } from '../../auth';+import { pineconeClient } from '../../common/client';+import { pineconeListIndexesOutputSchema } from '../../output-schemas';++export const pineconeListIndexesAction = createAction({+ auth: pineconeAuth,+ name: 'pinecone_list_indexes',+ outputSchema: pineconeListIndexesOutputSchema,+ displayName: 'List Indexes',+ description: 'Lists every index in the Pinecone project.',+ audience: 'ai',+ classification: 'SEARCH',+ aiMetadata: {+ description:+ 'Lists every index in the connected Pinecone project with its name, host, status, deployment and schema. Use it to find the index name that other actions take.',+ idempotent: true,+ },+ props: {},+ async run(context) {+ const client = pineconeClient.create({ auth: context.auth });+ return await client.indexes.list();+ },+});diff --git a/packages/pieces/community/pinecone/src/lib/actions/ai/list-models.ts b/packages/pieces/community/pinecone/src/lib/actions/ai/list-models.tsnew file mode 100644index 00000000000..d8877153fe5--- /dev/null+++ b/packages/pieces/community/pinecone/src/lib/actions/ai/list-models.ts@@ -0,0 +1,52 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { pineconeAuth } from '../../auth';+import { pineconeClient } from '../../common/client';+import { pineconeListModelsOutputSchema } from '../../output-schemas';++export const pineconeListModelsAction = createAction({+ auth: pineconeAuth,+ name: 'pinecone_list_models',+ outputSchema: pineconeListModelsOutputSchema,+ displayName: 'List Models',+ description: 'Lists the hosted embedding and reranking models.',+ audience: 'ai',+ classification: 'SEARCH',+ aiMetadata: {+ description:+ 'Lists the Pinecone-hosted models with their type (embed or rerank), vector type, dimensions and limits. Use a model name with Generate Embeddings, Rerank Documents or Create Index for Embedding Model.',+ idempotent: true,+ },+ props: {+ type: Property.StaticDropdown<'embed' | 'rerank', false>({+ displayName: 'Type',+ description: 'Only list embedding or reranking models.',+ required: false,+ options: {+ options: [+ { label: 'Embed', value: 'embed' },+ { label: 'Rerank', value: 'rerank' },+ ],+ },+ }),+ vectorType: Property.StaticDropdown<'dense' | 'sparse', false>({+ displayName: 'Vector Type',+ description: 'Only list embedding models producing dense or sparse vectors.',+ required: false,+ options: {+ options: [+ { label: 'Dense', value: 'dense' },+ { label: 'Sparse', value: 'sparse' },+ ],+ },+ }),+ },+ async run(context) {+ const p = context.propsValue;+ const client = pineconeClient.create({ auth: context.auth });+ return await client.inference.listModels({+ ...(p.type !== undefined ? { type: p.type } : {}),+ ...(p.vectorType !== undefined ? { vectorType: p.vectorType } : {}),+ });+ },+});diff --git a/packages/pieces/community/pinecone/src/lib/actions/ai/list-namespace-aliases.ts b/packages/pieces/community/pinecone/src/lib/actions/ai/list-namespace-aliases.tsnew file mode 100644index 00000000000..720bc389a12--- /dev/null+++ b/packages/pieces/community/pinecone/src/lib/actions/ai/list-namespace-aliases.ts@@ -0,0 +1,50 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { pineconeAuth } from '../../auth';+import { pineconeAiProps } from '../../common/ai-props';+import { pineconeApi } from '../../common/api';+import { pineconeListNamespaceAliasesOutputSchema } from '../../output-schemas';++export const pineconeListNamespaceAliasesAction = createAction({+ auth: pineconeAuth,+ name: 'pinecone_list_namespace_aliases',+ outputSchema: pineconeListNamespaceAliasesOutputSchema,+ displayName: 'List Namespace Aliases',+ description: 'Lists the namespace aliases of an index.',+ audience: 'ai',+ classification: 'SEARCH',+ aiMetadata: {+ description:+ 'Lists the namespace aliases of an index and the namespace each points to, one page at a time, optionally filtered by name prefix or target namespace. Pass the returned pagination token with the same filters for the next page.',+ idempotent: true,+ },+ props: {+ indexName: pineconeAiProps.indexName({ required: true }),+ prefix: Property.ShortText({+ displayName: 'Name Prefix',+ description: 'Only list aliases whose name starts with this text.',+ required: false,+ }),+ targetNamespace: Property.ShortText({+ displayName: 'Target Namespace',+ description: 'Only list aliases that point to this namespace.',+ required: false,+ }),+ limit: pineconeAiProps.limit({+ required: false,+ description: 'Maximum number of items to return, 1-100. Defaults to 100.',+ }),+ paginationToken: pineconeAiProps.paginationToken({ required: false }),+ },+ async run(context) {+ const p = context.propsValue;+ return await pineconeApi.listNamespaceAliases({+ auth: context.auth,+ indexName: p.indexName,+ limit: p.limit,+ paginationToken: p.paginationToken,+ prefix: p.prefix,+ targetNamespace: p.targetNamespace,+ });+ },+});diff --git a/packages/pieces/community/pinecone/src/lib/actions/ai/list-namespaces.ts b/packages/pieces/community/pinecone/src/lib/actions/ai/list-namespaces.tsnew file mode 100644index 00000000000..c20175631e4--- /dev/null+++ b/packages/pieces/community/pinecone/src/lib/actions/ai/list-namespaces.ts@@ -0,0 +1,44 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { pineconeAuth } from '../../auth';+import { pineconeAiProps } from '../../common/ai-props';+import { pineconeClient } from '../../common/client';+import { pineconeListNamespacesOutputSchema } from '../../output-schemas';++export const pineconeListNamespacesAction = createAction({+ auth: pineconeAuth,+ name: 'pinecone_list_namespaces',+ outputSchema: pineconeListNamespacesOutputSchema,+ displayName: 'List Namespaces',+ description: 'Lists the namespaces in an index.',+ audience: 'ai',+ classification: 'SEARCH',+ aiMetadata: {+ description:+ 'Lists the namespaces of an index with their record counts, optionally only names starting with a prefix, one page at a time. Pass the returned pagination token with the same prefix for the next page.',+ idempotent: true,+ },+ props: {+ indexName: pineconeAiProps.indexName({ required: true }),+ prefix: Property.ShortText({+ displayName: 'Name Prefix',+ description: 'Only list namespaces whose name starts with this text.',+ required: false,+ }),+ limit: pineconeAiProps.limit({+ required: false,+ description: 'Maximum number of items to return, 1-100. Defaults to 100.',+ }),+ paginationToken: pineconeAiProps.paginationToken({ required: false }),+ },+ async run(context) {+ const p = context.propsValue;+ const client = pineconeClient.create({ auth: context.auth });+ const index = client.index({ name: p.indexName });+ return await index.listNamespaces({+ ...(p.limit !== undefined ? { limit: p.limit } : {}),+ ...(p.paginationToken !== undefined ? { paginationToken: p.paginationToken } : {}),+ ...(p.prefix !== undefined ? { prefix: p.prefix } : {}),+ });+ },+});diff --git a/packages/pieces/community/pinecone/src/lib/actions/ai/list-vector-ids.ts b/packages/pieces/community/pinecone/src/lib/actions/ai/list-vector-ids.tsnew file mode 100644index 00000000000..5594b171edc--- /dev/null+++ b/packages/pieces/community/pinecone/src/lib/actions/ai/list-vector-ids.ts@@ -0,0 +1,48 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { pineconeAuth } from '../../auth';+import { pineconeAiProps } from '../../common/ai-props';+import { pineconeClient } from '../../common/client';+import { pineconeListVectorIdsOutputSchema } from '../../output-schemas';++export const pineconeListVectorIdsAction = createAction({+ auth: pineconeAuth,+ name: 'pinecone_list_vector_ids',+ outputSchema: pineconeListVectorIdsOutputSchema,+ displayName: 'List Vector IDs',+ description: 'Lists the record IDs in a namespace.',+ audience: 'ai',+ classification: 'SEARCH',+ aiMetadata: {+ description:+ 'Lists record IDs in a namespace of a serverless vectors index, optionally only IDs starting with a prefix, one page at a time. Pass the returned pagination token with the same prefix for the next page.',+ idempotent: true,+ },+ props: {+ indexName: pineconeAiProps.indexName({ required: true }),+ namespace: pineconeAiProps.namespace({ required: false }),+ prefix: Property.ShortText({+ displayName: 'ID Prefix',+ description: 'Only list IDs that start with this text, e.g. "doc1#".',+ required: false,+ }),+ limit: pineconeAiProps.limit({+ required: false,+ description: 'Maximum number of items to return, 1-100. Defaults to 100.',+ }),+ paginationToken: pineconeAiProps.paginationToken({ required: false }),+ },+ async run(context) {+ const p = context.propsValue;+ const client = pineconeClient.create({ auth: context.auth });+ const index = client.index({+ name: p.indexName,+ ...(p.namespace !== undefined ? { namespace: p.namespace } : {}),+ });+ return await index.listPaginated({+ ...(p.prefix !== undefined ? { prefix: p.prefix } : {}),+ ...(p.limit !== undefined ? { limit: p.limit } : {}),+ ...(p.paginationToken !== undefined ? { paginationToken: p.paginationToken } : {}),+ });+ },+});diff --git a/packages/pieces/community/pinecone/src/lib/actions/ai/query-vectors.ts b/packages/pieces/community/pinecone/src/lib/actions/ai/query-vectors.tsnew file mode 100644index 00000000000..7e983fba396--- /dev/null+++ b/packages/pieces/community/pinecone/src/lib/actions/ai/query-vectors.ts@@ -0,0 +1,103 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { pineconeAuth } from '../../auth';+import { pineconeAiProps } from '../../common/ai-props';+import { pineconeClient } from '../../common/client';+import { pineconeUtils } from '../../common/utils';+import { pineconeQueryVectorsOutputSchema } from '../../output-schemas';++export const pineconeQueryVectorsAction = createAction({+ auth: pineconeAuth,+ name: 'pinecone_query_vectors',+ outputSchema: pineconeQueryVectorsOutputSchema,+ displayName: 'Query Vectors',+ description: 'Finds the records most similar to a query vector or to a stored record.',+ audience: 'ai',+ classification: 'SEARCH',+ aiMetadata: {+ description:+ 'Similarity search in a namespace of a vectors index: returns the Top K nearest records with scores. Query by a dense vector (optionally plus sparse values for hybrid search) or by the ID of a stored record; set exactly one of Query Vector or Query Vector ID. Optional metadata filter narrows matches.',+ idempotent: true,+ },+ props: {+ indexName: pineconeAiProps.indexName({ required: true }),+ namespace: pineconeAiProps.namespace({ required: false }),+ topK: Property.Number({+ displayName: 'Top K',+ description: 'Number of matches to return, 1-10000.',+ required: true,+ }),+ vector: Property.Array({+ displayName: 'Query Vector',+ description: 'Dense query vector, e.g. [0.1, 0.2, 0.3]. Must match the index dimension.',+ required: false,+ }),+ id: Property.ShortText({+ displayName: 'Query Vector ID',+ description: 'ID of a stored record to use as the query, instead of Query Vector.',+ required: false,+ }),+ sparseIndices: Property.Array({+ displayName: 'Sparse Indices',+ description: 'Sparse vector positions, e.g. [10, 45]. Same length as Sparse Values.',+ required: false,+ }),+ sparseValues: Property.Array({+ displayName: 'Sparse Values',+ description: 'Sparse vector values, e.g. [0.5, 0.3]. Same length as Sparse Indices.',+ required: false,+ }),+ filter: Property.Json({+ displayName: 'Metadata Filter',+ description:+ 'Only match records whose metadata matches, e.g. {"genre": {"$in": ["comedy", "drama"]}}.',+ required: false,+ }),+ includeValues: Property.Checkbox({+ displayName: 'Include Values',+ description: "Return each match's vector values.",+ required: false,+ }),+ includeMetadata: Property.Checkbox({+ displayName: 'Include Metadata',+ description: "Return each match's metadata.",+ required: false,+ }),+ },+ async run(context) {+ const p = context.propsValue;+ const client = pineconeClient.create({ auth: context.auth });+ if ((p.vector === undefined) === (p.id === undefined)) {+ throw new Error('Set exactly one of "Query Vector" or "Query Vector ID".');+ }+ if ((p.sparseIndices === undefined) !== (p.sparseValues === undefined)) {+ throw new Error('Set "Sparse Indices" and "Sparse Values" together.');+ }+ const index = client.index({+ name: p.indexName,+ ...(p.namespace !== undefined ? { namespace: p.namespace } : {}),+ });+ const shared = {+ topK: p.topK,+ includeValues: p.includeValues ?? false,+ includeMetadata: p.includeMetadata ?? false,+ ...(p.filter !== undefined ? { filter: p.filter } : {}),+ };+ if (p.id !== undefined) {+ return await index.query({ ...shared, id: p.id });+ }+ return await index.query({+ ...shared,+ vector: pineconeUtils.toNumberList({ value: p.vector ?? [], propName: 'Query Vector' }),+ ...(p.sparseIndices !== undefined && p.sparseValues !== undefined+ ? {+ sparseVector: pineconeUtils.toSparseValues({+ indices: p.sparseIndices,+ values: p.sparseValues,+ propName: 'Sparse',+ }),+ }+ : {}),+ });+ },+});diff --git a/packages/pieces/community/pinecone/src/lib/actions/ai/replace-assistant-file.ts b/packages/pieces/community/pinecone/src/lib/actions/ai/replace-assistant-file.tsnew file mode 100644index 00000000000..2e58cb42f0d--- /dev/null+++ b/packages/pieces/community/pinecone/src/lib/actions/ai/replace-assistant-file.ts@@ -0,0 +1,53 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { pineconeAuth } from '../../auth';+import { pineconeClient } from '../../common/client';+import { pineconeDeleteAssistantFileOutputSchema } from '../../output-schemas';++export const pineconeReplaceAssistantFileAction = createAction({+ auth: pineconeAuth,+ name: 'pinecone_replace_assistant_file',+ outputSchema: pineconeDeleteAssistantFileOutputSchema,+ displayName: 'Replace Assistant File',+ description: 'Replaces the content of an assistant file, keeping its ID.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description:+ 'Replaces an existing assistant file with new content under the same file ID (or creates it with that ID), and returns the processing operation. Poll Get Assistant Operation until it finishes.',+ idempotent: true,+ },+ props: {+ assistantName: Property.ShortText({+ displayName: 'Assistant Name',+ description: 'Name of the assistant, from List Assistants.',+ required: true,+ }),+ fileId: Property.ShortText({+ displayName: 'File ID',+ description: 'Assistant file ID, from List Assistant Files or Upload Assistant File.',+ required: true,+ }),+ file: Property.File({+ displayName: 'File',+ description: 'File to add: PDF, DOCX, TXT, Markdown or JSON.',+ required: true,+ }),+ multimodal: Property.Checkbox({+ displayName: 'Multimodal',+ description: 'Also extract images from a PDF so the assistant can use them.',+ required: false,+ }),+ },+ async run(context) {+ const p = context.propsValue;+ const client = pineconeClient.create({ auth: context.auth });+ const assistant = client.assistant({ name: p.assistantName });+ return await assistant.upsertFile({+ assistantFileId: p.fileId,+ file: p.file.data,+ fileName: p.file.filename,+ ...(p.multimodal !== undefined ? { multimodal: p.multimodal } : {}),+ });+ },+});diff --git a/packages/pieces/community/pinecone/src/lib/actions/ai/repoint-namespace-alias.ts b/packages/pieces/community/pinecone/src/lib/actions/ai/repoint-namespace-alias.tsnew file mode 100644index 00000000000..b3ec8b1d3a3--- /dev/null+++ b/packages/pieces/community/pinecone/src/lib/actions/ai/repoint-namespace-alias.ts@@ -0,0 +1,43 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { pineconeAuth } from '../../auth';+import { pineconeAiProps } from '../../common/ai-props';+import { pineconeApi } from '../../common/api';+import { pineconeCreateNamespaceAliasOutputSchema } from '../../output-schemas';++export const pineconeRepointNamespaceAliasAction = createAction({+ auth: pineconeAuth,+ name: 'pinecone_repoint_namespace_alias',+ outputSchema: pineconeCreateNamespaceAliasOutputSchema,+ displayName: 'Repoint Namespace Alias',+ description: 'Points an existing alias at a different namespace.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description:+ 'Points an existing namespace alias at a different target namespace; callers using the alias switch over at once.',+ idempotent: true,+ },+ props: {+ indexName: pineconeAiProps.indexName({ required: true }),+ aliasName: Property.ShortText({+ displayName: 'Alias Name',+ description: 'Namespace alias name, from List Namespace Aliases.',+ required: true,+ }),+ targetNamespace: Property.ShortText({+ displayName: 'Target Namespace',+ description: 'Namespace the alias points to, from List Namespaces.',+ required: true,+ }),+ },+ async run(context) {+ const p = context.propsValue;+ return await pineconeApi.repointNamespaceAlias({+ auth: context.auth,+ indexName: p.indexName,+ aliasName: p.aliasName,+ targetNamespace: p.targetNamespace,+ });+ },+});diff --git a/packages/pieces/community/pinecone/src/lib/actions/ai/rerank-documents.ts b/packages/pieces/community/pinecone/src/lib/actions/ai/rerank-documents.tsnew file mode 100644index 00000000000..6f279f190e9--- /dev/null+++ b/packages/pieces/community/pinecone/src/lib/actions/ai/rerank-documents.ts@@ -0,0 +1,74 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { pineconeAuth } from '../../auth';+import { pineconeClient } from '../../common/client';+import { pineconeUtils } from '../../common/utils';+import { pineconeRerankDocumentsOutputSchema } from '../../output-schemas';++export const pineconeRerankDocumentsAction = createAction({+ auth: pineconeAuth,+ name: 'pinecone_rerank_documents',+ outputSchema: pineconeRerankDocumentsOutputSchema,+ displayName: 'Rerank Documents',+ description: 'Orders documents by relevance to a query with a hosted reranking model.',+ audience: 'ai',+ classification: 'READ',+ aiMetadata: {+ description:+ 'Scores documents against a query with a hosted reranking model (from List Models) and returns them most relevant first with scores and original positions. Documents are strings, or objects whose Rank Fields hold the text.',+ idempotent: true,+ },+ props: {+ model: Property.ShortText({+ displayName: 'Model',+ description:+ 'Reranking model, from List Models, e.g. "bge-reranker-v2-m3" or "cohere-rerank-3.5".',+ required: true,+ }),+ query: Property.LongText({+ displayName: 'Query',+ description: 'The question the documents are ranked against.',+ required: true,+ }),+ documents: Property.Array({+ displayName: 'Documents',+ description:+ 'Texts, or objects of string fields, e.g. ["Apples are…"] or [{"id": "1", "text": "Apples are…"}].',+ required: true,+ }),+ rankFields: Property.Array({+ displayName: 'Rank Fields',+ description: 'For object documents: the field(s) holding the text. Defaults to ["text"].',+ required: false,+ }),+ topN: Property.Number({+ displayName: 'Top N',+ description: 'Number of documents to return. Defaults to all.',+ required: false,+ }),+ returnDocuments: Property.Checkbox({+ displayName: 'Return Documents',+ description: 'Include each document in the result, not just its index and score.',+ required: false,+ }),+ },+ async run(context) {+ const p = context.propsValue;+ const client = pineconeClient.create({ auth: context.auth });+ return await client.inference.rerank({+ model: p.model,+ query: p.query,+ documents: pineconeUtils.toRerankDocuments({ value: p.documents, propName: 'Documents' }),+ ...(p.rankFields !== undefined+ ? {+ rankFields: pineconeUtils.toStringList({+ value: p.rankFields,+ propName: 'Rank Fields',+ }),+ }+ : {}),+ ...(p.topN !== undefined ? { topN: p.topN } : {}),+ ...(p.returnDocuments !== undefined ? { returnDocuments: p.returnDocuments } : {}),+ });+ },+});diff --git a/packages/pieces/community/pinecone/src/lib/actions/ai/retrieve-assistant-context.ts b/packages/pieces/community/pinecone/src/lib/actions/ai/retrieve-assistant-context.tsnew file mode 100644index 00000000000..8841cafd685--- /dev/null+++ b/packages/pieces/community/pinecone/src/lib/actions/ai/retrieve-assistant-context.ts@@ -0,0 +1,71 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { pineconeAuth } from '../../auth';+import { pineconeClient } from '../../common/client';+import { pineconeUtils } from '../../common/utils';+import { pineconeRetrieveAssistantContextOutputSchema } from '../../output-schemas';++export const pineconeRetrieveAssistantContextAction = createAction({+ auth: pineconeAuth,+ name: 'pinecone_retrieve_assistant_context',+ outputSchema: pineconeRetrieveAssistantContextOutputSchema,+ displayName: 'Retrieve Assistant Context',+ description: 'Gets the file snippets most relevant to a query, without generating an answer.',+ audience: 'ai',+ classification: 'SEARCH',+ aiMetadata: {+ description:+ "Returns the snippets from an assistant's files most relevant to a query (or to a conversation), with file references and scores, without asking a model to answer. Set exactly one of Query or Messages.",+ idempotent: true,+ },+ props: {+ assistantName: Property.ShortText({+ displayName: 'Assistant Name',+ description: 'Name of the assistant, from List Assistants.',+ required: true,+ }),+ query: Property.LongText({+ displayName: 'Query',+ description: 'Text to find relevant snippets for.',+ required: false,+ }),+ messages: Property.Array({+ displayName: 'Messages',+ description:+ 'Conversation to find snippets for, e.g. [{"role": "user", "content": "…"}], instead of Query.',+ required: false,+ }),+ filter: Property.Json({+ displayName: 'File Metadata Filter',+ description: 'Only use files whose metadata matches, e.g. {"department": "support"}.',+ required: false,+ }),+ topK: Property.Number({+ displayName: 'Top K',+ description: 'Maximum number of snippets, 1-64. Defaults to 16.',+ required: false,+ }),+ snippetSize: Property.Number({+ displayName: 'Snippet Size',+ description: 'Maximum tokens per snippet. Defaults to 2048.',+ required: false,+ }),+ },+ async run(context) {+ const p = context.propsValue;+ const client = pineconeClient.create({ auth: context.auth });+ if ((p.query === undefined) === (p.messages === undefined)) {+ throw new Error('Set exactly one of "Query" or "Messages".');+ }+ const assistant = client.assistant({ name: p.assistantName });+ return await assistant.context({+ ...(p.query !== undefined ? { query: p.query } : {}),+ ...(p.messages !== undefined+ ? { messages: pineconeUtils.toMessages({ value: p.messages, propName: 'Messages' }) }+ : {}),+ ...(p.filter !== undefined ? { filter: p.filter } : {}),+ ...(p.topK !== undefined ? { topK: p.topK } : {}),+ ...(p.snippetSize !== undefined ? { snippetSize: p.snippetSize } : {}),+ });+ },+});diff --git a/packages/pieces/community/pinecone/src/lib/actions/ai/search-documents.ts b/packages/pieces/community/pinecone/src/lib/actions/ai/search-documents.tsnew file mode 100644index 00000000000..138ab8c51ab--- /dev/null+++ b/packages/pieces/community/pinecone/src/lib/actions/ai/search-documents.ts@@ -0,0 +1,130 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { pineconeAuth } from '../../auth';+import { pineconeAiProps } from '../../common/ai-props';+import { pineconeClient } from '../../common/client';+import { pineconeUtils } from '../../common/utils';+import { pineconeSearchDocumentsOutputSchema } from '../../output-schemas';++export const pineconeSearchDocumentsAction = createAction({+ auth: pineconeAuth,+ name: 'pinecone_search_documents',+ outputSchema: pineconeSearchDocumentsOutputSchema,+ displayName: 'Search Documents',+ description: 'Searches documents by full-text query or by vector similarity.',+ audience: 'ai',+ classification: 'SEARCH',+ aiMetadata: {+ description:+ 'Searches a namespace and returns the Top K documents. Scoring Method: "text" (BM25 over Fields with Query), "query_string" (Lucene syntax in Query), "dense_vector" (Query Vector against Field, e.g. "embedding") or "sparse_vector" (Sparse Indices/Values against Field). Optional metadata filter. Works only on documents indexes (created by Create Index with Full-Text Fields).',+ idempotent: true,+ },+ props: {+ indexName: pineconeAiProps.indexName({ required: true }),+ namespace: pineconeAiProps.namespace({ required: false }),+ scoringMethod: Property.StaticDropdown<+ 'text' | 'query_string' | 'dense_vector' | 'sparse_vector',+ true+ >({+ displayName: 'Scoring Method',+ description: 'How documents are ranked: text, query_string, dense_vector or sparse_vector.',+ required: true,+ options: {+ options: [+ { label: 'Full-text (BM25)', value: 'text' },+ { label: 'Lucene query string', value: 'query_string' },+ { label: 'Dense vector', value: 'dense_vector' },+ { label: 'Sparse vector', value: 'sparse_vector' },+ ],+ },+ }),+ topK: Property.Number({+ displayName: 'Top K',+ description: 'Number of documents to return, 1-10000.',+ required: true,+ }),+ query: Property.LongText({+ displayName: 'Query',+ description: 'Text query, for text and query_string scoring.',+ required: false,+ }),+ fields: Property.Array({+ displayName: 'Fields',+ description: 'Full-text fields to search, for text scoring, e.g. ["title", "body"].',+ required: false,+ }),+ field: Property.ShortText({+ displayName: 'Field',+ description:+ 'Vector field to score against, for dense_vector or sparse_vector scoring, e.g. "embedding".',+ required: false,+ }),+ vector: Property.Array({+ displayName: 'Query Vector',+ description: 'Dense query vector, for dense_vector scoring.',+ required: false,+ }),+ sparseIndices: Property.Array({+ displayName: 'Sparse Indices',+ description: 'Sparse query positions, for sparse_vector scoring.',+ required: false,+ }),+ sparseValues: Property.Array({+ displayName: 'Sparse Values',+ description: 'Sparse query values, for sparse_vector scoring.',+ required: false,+ }),+ filter: Property.Json({+ displayName: 'Metadata Filter',+ description: 'Only return documents matching this filter, e.g. {"year": {"$gte": 2020}}.',+ required: false,+ }),+ includeFields: Property.Array({+ displayName: 'Include Fields',+ description:+ 'Document fields to return, e.g. ["title", "body"]. Leave empty to return only IDs and scores.',+ required: false,+ }),+ },+ async run(context) {+ const p = context.propsValue;+ const client = pineconeClient.create({ auth: context.auth });+ const scoreBy = {+ type: p.scoringMethod,+ ...(p.query !== undefined ? { query: p.query } : {}),+ ...(p.fields !== undefined+ ? { fields: pineconeUtils.toStringList({ value: p.fields, propName: 'Fields' }) }+ : {}),+ ...(p.field !== undefined ? { field: p.field } : {}),+ ...(p.vector !== undefined+ ? { values: pineconeUtils.toNumberList({ value: p.vector, propName: 'Query Vector' }) }+ : {}),+ ...(p.sparseIndices !== undefined && p.sparseValues !== undefined+ ? {+ sparseValues: pineconeUtils.toSparseValues({+ indices: p.sparseIndices,+ values: p.sparseValues,+ propName: 'Sparse',+ }),+ }+ : {}),+ };+ const documents = client.index({+ name: p.indexName,+ ...(p.namespace !== undefined ? { namespace: p.namespace } : {}),+ }).documents;+ return await documents.search({+ scoreBy: [scoreBy],+ topK: p.topK,+ ...(p.filter !== undefined ? { filter: p.filter } : {}),+ ...(p.includeFields !== undefined+ ? {+ includeFields: pineconeUtils.toStringList({+ value: p.includeFields,+ propName: 'Include Fields',+ }),+ }+ : {}),+ });+ },+});diff --git a/packages/pieces/community/pinecone/src/lib/actions/ai/search-text-records.ts b/packages/pieces/community/pinecone/src/lib/actions/ai/search-text-records.tsnew file mode 100644index 00000000000..2c2f0b48a6a--- /dev/null+++ b/packages/pieces/community/pinecone/src/lib/actions/ai/search-text-records.ts@@ -0,0 +1,123 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { pineconeAuth } from '../../auth';+import { pineconeAiProps } from '../../common/ai-props';+import { pineconeClient } from '../../common/client';+import { pineconeUtils } from '../../common/utils';+import { pineconeSearchTextRecordsOutputSchema } from '../../output-schemas';++export const pineconeSearchTextRecordsAction = createAction({+ auth: pineconeAuth,+ name: 'pinecone_search_text_records',+ outputSchema: pineconeSearchTextRecordsOutputSchema,+ displayName: 'Search Text Records',+ description: 'Searches records by text, vector or record ID, with optional reranking.',+ audience: 'ai',+ classification: 'SEARCH',+ aiMetadata: {+ description:+ 'Searches a namespace and returns the Top K records. Query by Query Text (needs an index from Create Index for Embedding Model), by Query Vector, or by Query Record ID; set exactly one. Optional metadata filter, returned Fields, and reranking with a hosted model (from List Models) over Rerank Fields.',+ idempotent: true,+ },+ props: {+ indexName: pineconeAiProps.indexName({ required: true }),+ namespace: pineconeAiProps.namespace({ required: false }),+ topK: Property.Number({+ displayName: 'Top K',+ description: 'Number of records to return.',+ required: true,+ }),+ queryText: Property.LongText({+ displayName: 'Query Text',+ description: "Text to search for; Pinecone embeds it with the index's model.",+ required: false,+ }),+ vector: Property.Array({+ displayName: 'Query Vector',+ description: 'Dense query vector, e.g. [0.1, 0.2].',+ required: false,+ }),+ id: Property.ShortText({+ displayName: 'Query Record ID',+ description: 'ID of a stored record to use as the query.',+ required: false,+ }),+ filter: Property.Json({+ displayName: 'Metadata Filter',+ description:+ 'Only match records whose metadata matches, e.g. {"category": {"$eq": "nutrition"}}.',+ required: false,+ }),+ fields: Property.Array({+ displayName: 'Fields',+ description: 'Record fields to return, e.g. ["chunk_text", "category"]. Leave empty for all.',+ required: false,+ }),+ rerankModel: Property.ShortText({+ displayName: 'Rerank Model',+ description:+ 'Hosted reranking model, from List Models, e.g. "bge-reranker-v2-m3". Needs Rerank Fields and Query Text.',+ required: false,+ }),+ rerankFields: Property.Array({+ displayName: 'Rerank Fields',+ description: 'Record fields the reranker reads, e.g. ["chunk_text"].',+ required: false,+ }),+ rerankTopN: Property.Number({+ displayName: 'Rerank Top N',+ description: 'Number of reranked records to return. Defaults to Top K.',+ required: false,+ }),+ },+ async run(context) {+ const p = context.propsValue;+ const client = pineconeClient.create({ auth: context.auth });+ const queryModes = [+ p.queryText !== undefined,+ p.vector !== undefined,+ p.id !== undefined,+ ].filter(Boolean).length;+ if (queryModes !== 1) {+ throw new Error('Set exactly one of "Query Text", "Query Vector" or "Query Record ID".');+ }+ if ((p.rerankModel === undefined) !== (p.rerankFields === undefined)) {+ throw new Error('Set "Rerank Model" and "Rerank Fields" together.');+ }+ const index = client.index({+ name: p.indexName,+ ...(p.namespace !== undefined ? { namespace: p.namespace } : {}),+ });+ return await index.searchRecords({+ query: {+ topK: p.topK,+ ...(p.queryText !== undefined ? { inputs: { text: p.queryText } } : {}),+ ...(p.vector !== undefined+ ? {+ vector: {+ values: pineconeUtils.toNumberList({ value: p.vector, propName: 'Query Vector' }),+ },+ }+ : {}),+ ...(p.id !== undefined ? { id: p.id } : {}),+ ...(p.filter !== undefined ? { filter: p.filter } : {}),+ },+ ...(p.fields !== undefined+ ? { fields: pineconeUtils.toStringList({ value: p.fields, propName: 'Fields' }) }+ : {}),+ ...(p.rerankModel !== undefined && p.rerankFields !== undefined+ ? {+ rerank: {+ model: p.rerankModel,+ rankFields: pineconeUtils.toStringList({+ value: p.rerankFields,+ propName: 'Rerank Fields',+ }),+ ...(p.rerankTopN !== undefined ? { topN: p.rerankTopN } : {}),+ ...(p.queryText !== undefined ? { query: p.queryText } : {}),+ },+ }+ : {}),+ });+ },+});diff --git a/packages/pieces/community/pinecone/src/lib/actions/ai/start-import.ts b/packages/pieces/community/pinecone/src/lib/actions/ai/start-import.tsnew file mode 100644index 00000000000..0107a77d02a--- /dev/null+++ b/packages/pieces/community/pinecone/src/lib/actions/ai/start-import.ts@@ -0,0 +1,57 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { pineconeAuth } from '../../auth';+import { pineconeAiProps } from '../../common/ai-props';+import { pineconeClient } from '../../common/client';+import { pineconeStartImportOutputSchema } from '../../output-schemas';++export const pineconeStartImportAction = createAction({+ auth: pineconeAuth,+ name: 'pinecone_start_import',+ outputSchema: pineconeStartImportOutputSchema,+ displayName: 'Start Import',+ description: 'Starts a bulk import of records from object storage into an index.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description:+ 'Starts an asynchronous import of Parquet (vectors indexes) or JSONL (documents indexes) files from an S3, GCS or Azure storage URI into a serverless index, and returns the import ID. Poll it with Get Import. The URI scheme must match the index cloud: s3:// for aws, gs:// for gcp, https:// (Azure Blob) for azure. The import cannot target an existing namespace. Private buckets need a storage integration ID.',+ idempotent: false,+ },+ props: {+ indexName: pineconeAiProps.indexName({ required: true }),+ uri: Property.ShortText({+ displayName: 'Storage URI',+ description:+ 'Directory prefix to import, e.g. "s3://my-bucket/vectors/". Use s3:// for an aws index, gs:// for gcp, https:// for azure.',+ required: true,+ }),+ integrationId: Property.ShortText({+ displayName: 'Storage Integration ID',+ description:+ 'ID of the storage integration set up in the Pinecone console, for private buckets.',+ required: false,+ }),+ errorMode: Property.StaticDropdown<'continue' | 'abort', false>({+ displayName: 'On Error',+ description: '"continue" skips bad records, "abort" stops the import. Defaults to continue.',+ required: false,+ options: {+ options: [+ { label: 'Continue', value: 'continue' },+ { label: 'Abort', value: 'abort' },+ ],+ },+ }),+ },+ async run(context) {+ const p = context.propsValue;+ const client = pineconeClient.create({ auth: context.auth });+ const index = client.index({ name: p.indexName });+ return await index.startImport({+ uri: p.uri,+ ...(p.integrationId !== undefined ? { integration: p.integrationId } : {}),+ ...(p.errorMode !== undefined ? { errorMode: p.errorMode } : {}),+ });+ },+});diff --git a/packages/pieces/community/pinecone/src/lib/actions/ai/update-assistant.ts b/packages/pieces/community/pinecone/src/lib/actions/ai/update-assistant.tsnew file mode 100644index 00000000000..19e0de50906--- /dev/null+++ b/packages/pieces/community/pinecone/src/lib/actions/ai/update-assistant.ts@@ -0,0 +1,52 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { pineconeAuth } from '../../auth';+import { pineconeClient } from '../../common/client';+import { pineconeUtils } from '../../common/utils';+import { pineconeUpdateAssistantOutputSchema } from '../../output-schemas';++export const pineconeUpdateAssistantAction = createAction({+ auth: pineconeAuth,+ name: 'pinecone_update_assistant',+ outputSchema: pineconeUpdateAssistantOutputSchema,+ displayName: 'Update Assistant',+ description: "Changes an assistant's instructions or metadata.",+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description:+ 'Updates only what you set on an assistant: instructions, and metadata (replaces the whole metadata object). Settings left empty stay as they are.',+ idempotent: true,+ },+ props: {+ assistantName: Property.ShortText({+ displayName: 'Assistant Name',+ description: 'Name of the assistant, from List Assistants.',+ required: true,+ }),+ instructions: Property.LongText({+ displayName: 'Instructions',+ description: 'New directions for how the assistant answers.',+ required: false,+ }),+ metadata: Property.Json({+ displayName: 'Metadata',+ description: 'New string key-value pairs; replaces the current metadata.',+ required: false,+ }),+ },+ async run(context) {+ const p = context.propsValue;+ if (p.instructions === undefined && p.metadata === undefined) {+ throw new Error('Set "Instructions" or "Metadata" to update.');+ }+ const client = pineconeClient.create({ auth: context.auth });+ return await client.assistants.update({+ name: p.assistantName,+ ...(p.instructions !== undefined ? { instructions: p.instructions } : {}),+ ...(p.metadata !== undefined+ ? { metadata: pineconeUtils.toStringMap({ value: p.metadata, propName: 'Metadata' }) }+ : {}),+ });+ },+});diff --git a/packages/pieces/community/pinecone/src/lib/actions/ai/update-documents.ts b/packages/pieces/community/pinecone/src/lib/actions/ai/update-documents.tsnew file mode 100644index 00000000000..5a4241516ef--- /dev/null+++ b/packages/pieces/community/pinecone/src/lib/actions/ai/update-documents.ts@@ -0,0 +1,87 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { pineconeAuth } from '../../auth';+import { pineconeAiProps } from '../../common/ai-props';+import { pineconeClient } from '../../common/client';+import { pineconeUtils } from '../../common/utils';+import { pineconeUpdateDocumentsOutputSchema } from '../../output-schemas';++export const pineconeUpdateDocumentsAction = createAction({+ auth: pineconeAuth,+ name: 'pinecone_update_documents',+ outputSchema: pineconeUpdateDocumentsOutputSchema,+ displayName: 'Update Documents',+ description: 'Patches fields of documents by ID or of every document matching a filter.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description:+ 'Patches documents without replacing them: either per-ID patches in Documents ([{"_id", <field>: <new value>, "_remove_fields": [...]}]), or Set Fields / Remove Fields applied to every document matching Filter. Set exactly one of Documents or Filter. Fields not mentioned are kept. Remove Fields with Filter removes metadata fields only; remove full-text or vector fields per document. Works only on documents indexes (created by Create Index with Full-Text Fields).',+ idempotent: true,+ },+ props: {+ indexName: pineconeAiProps.indexName({ required: true }),+ namespace: pineconeAiProps.namespace({ required: false }),+ documents: Property.Array({+ displayName: 'Documents',+ description:+ 'Per-ID patches, e.g. [{"_id": "doc-1", "year": 2025, "_remove_fields": ["draft"]}].',+ required: false,+ }),+ filter: Property.Json({+ displayName: 'Filter',+ description: 'Patch every document matching this metadata filter, e.g. {"status": "draft"}.',+ required: false,+ }),+ setFields: Property.Json({+ displayName: 'Set Fields',+ description: 'With Filter: fields to set, e.g. {"status": "published"}.',+ required: false,+ }),+ removeFields: Property.Array({+ displayName: 'Remove Fields',+ description:+ 'With Filter: metadata field names to remove, e.g. ["draft_notes"]. Full-text and vector fields can only be removed per document, with "_remove_fields" in Documents.',+ required: false,+ }),+ },+ async run(context) {+ const p = context.propsValue;+ const client = pineconeClient.create({ auth: context.auth });+ if ((p.documents === undefined) === (p.filter === undefined)) {+ throw new Error('Set exactly one of "Documents" or "Filter".');+ }+ if (p.documents !== undefined && (p.setFields !== undefined || p.removeFields !== undefined)) {+ throw new Error('"Set Fields" and "Remove Fields" go with "Filter", not "Documents".');+ }+ const documents = client.index({+ name: p.indexName,+ ...(p.namespace !== undefined ? { namespace: p.namespace } : {}),+ }).documents;+ if (p.documents !== undefined) {+ const patches = pineconeUtils.toDocuments({ value: p.documents, propName: 'Documents' });+ const response = await documents.update({ documents: patches });+ return { updated: true, ...response, ids: patches.map((patch) => patch._id) };+ }+ const response = await documents.update({+ filter: p.filter,+ ...(p.setFields !== undefined+ ? {+ setFields: pineconeUtils.toRecordMetadata({+ value: p.setFields,+ propName: 'Set Fields',+ }),+ }+ : {}),+ ...(p.removeFields !== undefined+ ? {+ removeFields: pineconeUtils.toStringList({+ value: p.removeFields,+ propName: 'Remove Fields',+ }),+ }+ : {}),+ });+ return { updated: true, ...response, filter: p.filter };+ },+});diff --git a/packages/pieces/community/pinecone/src/lib/actions/ai/update-vector.ts b/packages/pieces/community/pinecone/src/lib/actions/ai/update-vector.tsnew file mode 100644index 00000000000..766b3a86f42--- /dev/null+++ b/packages/pieces/community/pinecone/src/lib/actions/ai/update-vector.ts@@ -0,0 +1,98 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { pineconeAuth } from '../../auth';+import { pineconeAiProps } from '../../common/ai-props';+import { pineconeClient } from '../../common/client';+import { pineconeUtils } from '../../common/utils';+import { pineconeUpdateVectorOutputSchema } from '../../output-schemas';++export const pineconeUpdateVectorAction = createAction({+ auth: pineconeAuth,+ name: 'pinecone_update_vector',+ outputSchema: pineconeUpdateVectorOutputSchema,+ displayName: 'Update Vector',+ description:+ 'Updates the values or metadata of one record, or the metadata of all records matching a filter.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description:+ 'Updates one record by ID, or every record matching a metadata filter (set exactly one of Vector ID or Filter). Only what you set changes: new dense values, new sparse values, and metadata keys to set (other metadata keys are kept). A filter update can only set metadata.',+ idempotent: true,+ },+ props: {+ indexName: pineconeAiProps.indexName({ required: true }),+ namespace: pineconeAiProps.namespace({ required: false }),+ id: Property.ShortText({+ displayName: 'Vector ID',+ description: 'ID of the record to update, from List Vector IDs or Query Vectors.',+ required: false,+ }),+ filter: Property.Json({+ displayName: 'Filter',+ description:+ 'Update every record matching this metadata filter instead of one ID, e.g. {"genre": {"$eq": "drama"}}.',+ required: false,+ }),+ values: Property.Array({+ displayName: 'Values',+ description: 'New dense values, e.g. [0.1, 0.2, 0.3]. Must match the index dimension.',+ required: false,+ }),+ sparseIndices: Property.Array({+ displayName: 'Sparse Indices',+ description: 'Sparse vector positions, e.g. [10, 45]. Same length as Sparse Values.',+ required: false,+ }),+ sparseValues: Property.Array({+ displayName: 'Sparse Values',+ description: 'Sparse vector values, e.g. [0.5, 0.3]. Same length as Sparse Indices.',+ required: false,+ }),+ setMetadata: Property.Json({+ displayName: 'Set Metadata',+ description:+ 'Metadata keys to set or overwrite, e.g. {"genre": "comedy"}. Keys not listed are kept.',+ required: false,+ }),+ },+ async run(context) {+ const p = context.propsValue;+ const client = pineconeClient.create({ auth: context.auth });+ if ((p.id === undefined) === (p.filter === undefined)) {+ throw new Error('Set exactly one of "Vector ID" or "Filter".');+ }+ if ((p.sparseIndices === undefined) !== (p.sparseValues === undefined)) {+ throw new Error('Set "Sparse Indices" and "Sparse Values" together.');+ }+ const index = client.index({+ name: p.indexName,+ ...(p.namespace !== undefined ? { namespace: p.namespace } : {}),+ });+ await index.update({+ ...(p.id !== undefined ? { id: p.id } : {}),+ ...(p.filter !== undefined ? { filter: p.filter } : {}),+ ...(p.values !== undefined+ ? { values: pineconeUtils.toNumberList({ value: p.values, propName: 'Values' }) }+ : {}),+ ...(p.sparseIndices !== undefined && p.sparseValues !== undefined+ ? {+ sparseValues: pineconeUtils.toSparseValues({+ indices: p.sparseIndices,+ values: p.sparseValues,+ propName: 'Sparse',+ }),+ }+ : {}),+ ...(p.setMetadata !== undefined+ ? {+ metadata: pineconeUtils.toRecordMetadata({+ value: p.setMetadata,+ propName: 'Set Metadata',+ }),+ }+ : {}),+ });+ return { updated: true, ...(p.id !== undefined ? { id: p.id } : { filter: p.filter }) };+ },+});diff --git a/packages/pieces/community/pinecone/src/lib/actions/ai/upload-assistant-file.ts b/packages/pieces/community/pinecone/src/lib/actions/ai/upload-assistant-file.tsnew file mode 100644index 00000000000..e1c14977c3e--- /dev/null+++ b/packages/pieces/community/pinecone/src/lib/actions/ai/upload-assistant-file.ts@@ -0,0 +1,57 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { pineconeAuth } from '../../auth';+import { pineconeClient } from '../../common/client';+import { pineconeUtils } from '../../common/utils';+import { pineconeDeleteAssistantFileOutputSchema } from '../../output-schemas';++export const pineconeUploadAssistantFileAction = createAction({+ auth: pineconeAuth,+ name: 'pinecone_upload_assistant_file',+ outputSchema: pineconeDeleteAssistantFileOutputSchema,+ displayName: 'Upload Assistant File',+ description: "Adds a file to an assistant's knowledge.",+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description:+ 'Uploads a file to an assistant and returns the processing operation. The file is usable once processing finishes: poll Get Assistant Operation or Get Assistant File.',+ idempotent: false,+ },+ props: {+ assistantName: Property.ShortText({+ displayName: 'Assistant Name',+ description: 'Name of the assistant, from List Assistants.',+ required: true,+ }),+ file: Property.File({+ displayName: 'File',+ description: 'File to add: PDF, DOCX, TXT, Markdown or JSON.',+ required: true,+ }),+ multimodal: Property.Checkbox({+ displayName: 'Multimodal',+ description: 'Also extract images from a PDF so the assistant can use them.',+ required: false,+ }),+ metadata: Property.Json({+ displayName: 'Metadata',+ description:+ 'Key-value pairs (strings or numbers) to filter on later, e.g. {"department": "support"}.',+ required: false,+ }),+ },+ async run(context) {+ const p = context.propsValue;+ const client = pineconeClient.create({ auth: context.auth });+ const assistant = client.assistant({ name: p.assistantName });+ return await assistant.uploadFile({+ file: p.file.data,+ fileName: p.file.filename,+ ...(p.multimodal !== undefined ? { multimodal: p.multimodal } : {}),+ ...(p.metadata !== undefined+ ? { metadata: pineconeUtils.toFileMetadata({ value: p.metadata, propName: 'Metadata' }) }+ : {}),+ });+ },+});diff --git a/packages/pieces/community/pinecone/src/lib/actions/ai/upsert-documents.ts b/packages/pieces/community/pinecone/src/lib/actions/ai/upsert-documents.tsnew file mode 100644index 00000000000..dc8e5da3206--- /dev/null+++ b/packages/pieces/community/pinecone/src/lib/actions/ai/upsert-documents.ts@@ -0,0 +1,43 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { pineconeAuth } from '../../auth';+import { pineconeAiProps } from '../../common/ai-props';+import { pineconeClient } from '../../common/client';+import { pineconeUtils } from '../../common/utils';+import { pineconeUpsertDocumentsOutputSchema } from '../../output-schemas';++export const pineconeUpsertDocumentsAction = createAction({+ auth: pineconeAuth,+ name: 'pinecone_upsert_documents',+ outputSchema: pineconeUpsertDocumentsOutputSchema,+ displayName: 'Upsert Documents',+ description: 'Inserts or replaces documents in a namespace of a documents index.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description:+ 'Writes documents into a namespace; a document with an existing "_id" is replaced whole. Each document is {"_id": "...", <field>: <value>} where fields match the index schema (text fields, "embedding" dense values) plus any metadata fields. Works only on documents indexes (created by Create Index with Full-Text Fields).',+ idempotent: true,+ },+ props: {+ indexName: pineconeAiProps.indexName({ required: true }),+ namespace: pineconeAiProps.namespace({ required: false }),+ documents: Property.Array({+ displayName: 'Documents',+ description:+ 'Documents to write, e.g. [{"_id": "doc-1", "title": "Intro", "body": "Pinecone is a vector database.", "year": 2024}].',+ required: true,+ }),+ },+ async run(context) {+ const p = context.propsValue;+ const client = pineconeClient.create({ auth: context.auth });+ const documents = client.index({+ name: p.indexName,+ ...(p.namespace !== undefined ? { namespace: p.namespace } : {}),+ }).documents;+ return await documents.upsert({+ documents: pineconeUtils.toDocuments({ value: p.documents, propName: 'Documents' }),+ });+ },+});diff --git a/packages/pieces/community/pinecone/src/lib/actions/ai/upsert-text-records.ts b/packages/pieces/community/pinecone/src/lib/actions/ai/upsert-text-records.tsnew file mode 100644index 00000000000..e3da0b191ff--- /dev/null+++ b/packages/pieces/community/pinecone/src/lib/actions/ai/upsert-text-records.ts@@ -0,0 +1,43 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { pineconeAuth } from '../../auth';+import { pineconeAiProps } from '../../common/ai-props';+import { pineconeClient } from '../../common/client';+import { pineconeUtils } from '../../common/utils';+import { pineconeUpsertTextRecordsOutputSchema } from '../../output-schemas';++export const pineconeUpsertTextRecordsAction = createAction({+ auth: pineconeAuth,+ name: 'pinecone_upsert_text_records',+ outputSchema: pineconeUpsertTextRecordsOutputSchema,+ displayName: 'Upsert Text Records',+ description: "Writes text records that Pinecone embeds with the index's hosted model.",+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description:+ 'Writes up to 96 records into a namespace of an index made by Create Index for Embedding Model; Pinecone embeds the index\'s text field for you. Each record is {"_id": "...", <text field>: "...", <other metadata fields>}; a record with an existing ID is overwritten.',+ idempotent: true,+ },+ props: {+ indexName: pineconeAiProps.indexName({ required: true }),+ namespace: pineconeAiProps.namespace({ required: false }),+ records: Property.Array({+ displayName: 'Records',+ description:+ 'Records to write, e.g. [{"_id": "rec-1", "chunk_text": "Apples are rich in fiber.", "category": "nutrition"}]. The text field name is the one given when the index was created.',+ required: true,+ }),+ },+ async run(context) {+ const p = context.propsValue;+ const client = pineconeClient.create({ auth: context.auth });+ const index = client.index({+ name: p.indexName,+ ...(p.namespace !== undefined ? { namespace: p.namespace } : {}),+ });+ const records = pineconeUtils.toTextRecords({ value: p.records, propName: 'Records' });+ await index.upsertRecords({ records });+ return { upsertedCount: records.length, ids: records.map((record) => record._id) };+ },+});diff --git a/packages/pieces/community/pinecone/src/lib/actions/ai/upsert-vectors.ts b/packages/pieces/community/pinecone/src/lib/actions/ai/upsert-vectors.tsnew file mode 100644index 00000000000..8bb7bf99fee--- /dev/null+++ b/packages/pieces/community/pinecone/src/lib/actions/ai/upsert-vectors.ts@@ -0,0 +1,46 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { pineconeAuth } from '../../auth';+import { pineconeAiProps } from '../../common/ai-props';+import { pineconeClient } from '../../common/client';+import { pineconeUtils } from '../../common/utils';+import { pineconeUpsertTextRecordsOutputSchema } from '../../output-schemas';++export const pineconeUpsertVectorsAction = createAction({+ auth: pineconeAuth,+ name: 'pinecone_upsert_vectors',+ outputSchema: pineconeUpsertTextRecordsOutputSchema,+ displayName: 'Upsert Vectors',+ description: 'Inserts or overwrites vector records in a namespace.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description:+ 'Writes up to 1000 vector records into a namespace of a vectors index; a record with an existing ID is overwritten. Each record is {"id", "values" (dense), "sparseValues" ({"indices", "values"}), "metadata"}; values must match the index dimension. Does not work on documents indexes.',+ idempotent: true,+ },+ props: {+ indexName: pineconeAiProps.indexName({ required: true }),+ namespace: pineconeAiProps.namespace({ required: false }),+ vectors: Property.Array({+ displayName: 'Vectors',+ description:+ 'Records to write, e.g. [{"id": "vec-1", "values": [0.1, 0.2, 0.3], "metadata": {"genre": "drama", "year": 2020}}]. Metadata values are strings, numbers, booleans or lists of strings.',+ required: true,+ }),+ },+ async run(context) {+ const p = context.propsValue;+ const client = pineconeClient.create({ auth: context.auth });+ const index = client.index({+ name: p.indexName,+ ...(p.namespace !== undefined ? { namespace: p.namespace } : {}),+ });+ const records = pineconeUtils.toVectorRecords({ value: p.vectors, propName: 'Vectors' });+ if (records.length === 0 || records.length > 1000) {+ throw new Error('"Vectors" must hold 1 to 1000 records.');+ }+ await index.upsert({ records });+ return { upsertedCount: records.length, ids: records.map((record) => record.id) };+ },+});diff --git a/packages/pieces/community/pinecone/src/lib/actions/create-index.ts b/packages/pieces/community/pinecone/src/lib/actions/create-index.tsindex 7497c095f94..0a8b4169ff7 100644--- a/packages/pieces/community/pinecone/src/lib/actions/create-index.ts+++ b/packages/pieces/community/pinecone/src/lib/actions/create-index.ts@@ -1,14 +1,17 @@import { createAction, Property } from '@activepieces/pieces-framework';-import { createPineconeClientFromAuth } from '../common/pinecone-client';+import { pineconeApi } from '../common/api';+import type { PineconeLegacyCreateIndexRequest, PineconeLegacyIndexSpec } from '../common/types';import { pineconeAuth } from '../auth';+import { createIndexOutputSchema } from '../output-schemas';-export const createIndex = createAction({+export const createIndexAction = createAction({auth: pineconeAuth,name: 'create_index',+ outputSchema: createIndexOutputSchema,classification: 'WRITE',displayName: 'Create Index',description: 'Creates a new Pinecone index with custom settings.',- audience: 'both',+ audience: 'human',aiMetadata: { description: 'Creates a new Pinecone vector index in the connected project, supporting both serverless (cloud + region) and pod-based (environment + pod type) deployments selected via the index type. Use to provision a fresh index before storing or querying vectors; not for adding data to an existing one. Requires a unique name and, for dense indexes, a positive dimension. Not idempotent: re-running creates or conflicts with an index, though enabling Suppress Conflicts lets a repeat call against an existing index avoid erroring.', idempotent: false },props: {name: Property.ShortText({@@ -35,7 +38,7 @@ export const createIndex = createAction({},defaultValue: 'serverless'}),- cloud: Property.StaticDropdown({+ cloud: Property.StaticDropdown<'aws' | 'gcp' | 'azure'>({displayName: 'Cloud Provider',description:'The public cloud where you would like your index hosted (for serverless)',@@ -102,7 +105,7 @@ export const createIndex = createAction({'The number of pods to be used in the index. This should be equal to shards x replicas.',required: false}),- metric: Property.StaticDropdown({+ metric: Property.StaticDropdown<'cosine' | 'euclidean' | 'dotproduct'>({displayName: 'Metric',description:'The distance metric to use. Defaults to cosine for dense indexes, dotproduct for sparse indexes.',@@ -115,7 +118,7 @@ export const createIndex = createAction({]}}),- vectorType: Property.StaticDropdown({+ vectorType: Property.StaticDropdown<'dense' | 'sparse'>({displayName: 'Vector Type',description:'The type of vectors to store. Dense is default for most use cases.',@@ -210,10 +213,8 @@ export const createIndex = createAction({}}- const pc = createPineconeClientFromAuth(context.auth);-try {- let spec: any;+ let spec: PineconeLegacyIndexSpec | undefined;if (indexType === 'serverless') {if (!cloud) {@@ -258,29 +259,36 @@ export const createIndex = createAction({};}- const createIndexOptions: any = {+ if (!spec) {+ throw new Error(+ 'You must pass a `pods` or `serverless` `spec` object in order to create an index.'+ );+ }++ const resolvedMetric = metric || (vType === 'sparse' ? 'dotproduct' : 'cosine');++ const createIndexRequest: PineconeLegacyCreateIndexRequest = {name: name,dimension: dimension,spec: spec,- ...(metric && { metric }),- ...(vectorType && { vector_type: vectorType }),- ...(deletionProtection !== undefined && {- deletionProtection: deletionProtection ? 'enabled' : 'disabled'+ metric: resolvedMetric,+ ...(vectorType && { vectorType }),+ ...(deletionProtection !== undefined && {+ deletionProtection: deletionProtection ? 'enabled' : 'disabled'}),- ...(tags && { tags }),- waitUntilReady: waitUntilReady || false,- suppressConflicts: suppressConflicts || false+ ...(tags && {+ tags: Object.fromEntries(+ Object.entries(tags).map(([key, value]) => [key, String(value)])+ )+ })};- if (!createIndexOptions.metric) {- if (vType === 'sparse') {- createIndexOptions.metric = 'dotproduct';- } else {- createIndexOptions.metric = 'cosine';- }- }-- const response = await pc.createIndex(createIndexOptions);+ const response = await pineconeApi.createLegacyIndex({+ auth: context.auth,+ request: createIndexRequest,+ waitUntilReady: waitUntilReady || false,+ suppressConflicts: suppressConflicts || false+ });return {success: true,@@ -288,14 +296,13 @@ export const createIndex = createAction({dimension: dimension,indexType: indexType,spec: spec,- metric: createIndexOptions.metric,+ metric: resolvedMetric,vectorType: vType,...(tags && { tags }),message: 'Index created successfully',...(response && { response })};} catch (caught) {- console.log('Failed to create index.', caught);return caught;}}diff --git a/packages/pieces/community/pinecone/src/lib/actions/delete-vector.ts b/packages/pieces/community/pinecone/src/lib/actions/delete-vector.tsindex 939876ca5e3..70421512cdd 100644--- a/packages/pieces/community/pinecone/src/lib/actions/delete-vector.ts+++ b/packages/pieces/community/pinecone/src/lib/actions/delete-vector.ts@@ -1,14 +1,16 @@import { createAction, Property } from '@activepieces/pieces-framework';-import { createPineconeClientFromAuth } from '../common/pinecone-client';+import { pineconeClient } from '../common/client';import { pineconeAuth } from '../auth';+import { deleteVectorOutputSchema } from '../output-schemas';-export const deleteVector = createAction({+export const deleteVectorAction = createAction({auth: pineconeAuth,name: 'delete_vector',+ outputSchema: deleteVectorOutputSchema,classification: 'DESTRUCTIVE',displayName: 'Delete a Vector',description: 'Delete vectors by ID from a namespace.',- audience: 'both',+ audience: 'human',aiMetadata: { description: 'Removes vectors from a namespace of a Pinecone index, with a delete mode selecting whether to delete a single ID, a list of IDs, all vectors in the namespace, or only vectors matching a metadata filter. Use to permanently remove embeddings; deleting all requires an explicit confirmation flag. Not idempotent: it mutates index contents, and filter/delete-all modes remove whatever currently matches on each call.', idempotent: false },props: {indexName: Property.ShortText({@@ -83,18 +85,17 @@ export const deleteVector = createAction({throw new Error('You must provide an index name to delete vectors.');}- const pc = createPineconeClientFromAuth(context.auth);+ const pc = pineconeClient.create({ auth: context.auth });try {const index = indexHost- ? pc.index(indexName, indexHost)- : pc.index(indexName);+ ? pc.index({ name: indexName, host: indexHost })+ : pc.index({ name: indexName });const ns = namespace ? index.namespace(namespace) : index;- let deleteResult: any;let deletedCount = 0;let operation = '';@@ -106,7 +107,7 @@ export const deleteVector = createAction({);}- await ns.deleteOne(id);+ await ns.deleteOne({ id });deletedCount = 1;operation = `Deleted vector with ID: ${id}`;} else if (deleteMode === 'many') {@@ -117,11 +118,10 @@ export const deleteVector = createAction({);}- await ns.deleteMany(ids as string[]);+ const recordIds = ids.map((recordId) => String(recordId));+ await ns.deleteMany({ ids: recordIds });deletedCount = ids.length;- operation = `Deleted ${ids.length} vectors with IDs: ${(- ids as string[]- ).join(', ')}`;+ operation = `Deleted ${ids.length} vectors with IDs: ${recordIds.join(', ')}`;} else if (deleteMode === 'all') {if (!confirmDeleteAll) {throw new Error(@@ -129,7 +129,7 @@ export const deleteVector = createAction({);}- deleteResult = await ns.deleteAll();+ await ns.deleteAll();operation = `Deleted ALL vectors in namespace: ${namespace || 'default'}`;@@ -141,7 +141,7 @@ export const deleteVector = createAction({);}- await ns.deleteMany(filter);+ await ns.deleteMany({ filter });operation = `Deleted vectors matching filter: ${JSON.stringify(filter)}`;}@@ -152,52 +152,9 @@ export const deleteVector = createAction({deleteMode: deleteMode,operation: operation,...(deletedCount > 0 && { deletedCount }),- ...(deleteResult && { deleteResult }),message: `Successfully completed delete operation: ${operation}`};} catch (caught) {- console.log('Failed to delete vector(s).', caught);-- if (caught instanceof Error) {- const error = caught as any;-- if (error.status === 400 || error.code === 400) {- return {- success: false,- error: 'Bad Request',- code: 400,- message: error.message || 'The request body included invalid request parameters.',- details: error.details || [],- indexName: indexName,- namespace: namespace || 'default',- };- }-- if (error.status >= 400 && error.status < 500) {- return {- success: false,- error: 'Client Error',- code: error.status || error.code,- message: error.message || 'An unexpected client error occurred.',- details: error.details || [],- indexName: indexName,- namespace: namespace || 'default',- };- }-- if (error.status >= 500 || error.code >= 500) {- return {- success: false,- error: 'Server Error',- code: error.status || error.code,- message: error.message || 'An unexpected server error occurred.',- details: error.details || [],- indexName: indexName,- namespace: namespace || 'default',- };- }- }-return {success: false,error: 'Unknown Error',diff --git a/packages/pieces/community/pinecone/src/lib/actions/get-vector.ts b/packages/pieces/community/pinecone/src/lib/actions/get-vector.tsindex bce5a980f94..ecbcc048208 100644--- a/packages/pieces/community/pinecone/src/lib/actions/get-vector.ts+++ b/packages/pieces/community/pinecone/src/lib/actions/get-vector.ts@@ -1,14 +1,16 @@import { createAction, Property } from '@activepieces/pieces-framework';-import { createPineconeClientFromAuth } from '../common/pinecone-client';+import { pineconeClient } from '../common/client';import { pineconeAuth } from '../auth';+import { getVectorOutputSchema } from '../output-schemas';-export const getVector = createAction({+export const getVectorAction = createAction({auth: pineconeAuth,name: 'get_vector',+ outputSchema: getVectorOutputSchema,classification: 'READ',displayName: 'Get a Vector',description: 'Look up and return vectors by ID from a namespace.',- audience: 'both',+ audience: 'human',aiMetadata: { description: 'Fetches one or more stored vectors by their exact IDs from a namespace of a Pinecone index. Use when you already know the vector IDs and want their values and metadata; for similarity lookups use Search Vectors instead. Requires the index name and at least one ID (IDs cannot contain spaces). Idempotent read-only lookup.', idempotent: true },props: {indexName: Property.ShortText({@@ -50,26 +52,28 @@ export const getVector = createAction({throw new Error('You must provide at least one vector ID to fetch.');}- const invalidIds = ids.filter((id: any) => typeof id === 'string' && id.includes(' '));+ const invalidIds = ids.filter((id) => typeof id === 'string' && id.includes(' '));if (invalidIds.length > 0) {throw new Error(`Vector IDs cannot contain spaces. Invalid IDs: ${invalidIds.join(', ')}`);}- const pc = createPineconeClientFromAuth(context.auth);+ const recordIds = ids.map((id) => String(id));++ const pc = pineconeClient.create({ auth: context.auth });try {- const index = indexHost ? pc.index(indexName, indexHost) : pc.index(indexName);+ const index = indexHost ? pc.index({ name: indexName, host: indexHost }) : pc.index({ name: indexName });const fetchResult = namespace- ? await index.namespace(namespace).fetch(ids as string[])- : await index.fetch(ids as string[]);+ ? await index.namespace(namespace).fetch({ ids: recordIds })+ : await index.fetch({ ids: recordIds });const records = fetchResult.records || {};const vectorCount = Object.keys(records).length;const foundIds = Object.keys(records);- const notFoundIds = (ids as string[]).filter(id => !foundIds.includes(id));+ const notFoundIds = recordIds.filter(id => !foundIds.includes(id));return {success: true,@@ -86,51 +90,6 @@ export const getVector = createAction({message: `Successfully fetched ${vectorCount} out of ${ids.length} requested vector(s)`,};} catch (caught) {- console.log('Failed to fetch vector(s).', caught);-- if (caught instanceof Error) {- const error = caught as any;-- if (error.status === 400 || error.code === 400) {- return {- success: false,- error: 'Bad Request',- code: 400,- message: error.message || 'The request body included invalid request parameters.',- details: error.details || [],- requestedIds: ids,- indexName: indexName,- namespace: namespace || 'default',- };- }-- if (error.status >= 400 && error.status < 500) {- return {- success: false,- error: 'Client Error',- code: error.status || error.code,- message: error.message || 'An unexpected client error occurred.',- details: error.details || [],- requestedIds: ids,- indexName: indexName,- namespace: namespace || 'default',- };- }-- if (error.status >= 500 || error.code >= 500) {- return {- success: false,- error: 'Server Error',- code: error.status || error.code,- message: error.message || 'An unexpected server error occurred.',- details: error.details || [],- requestedIds: ids,- indexName: indexName,- namespace: namespace || 'default',- };- }- }-return {success: false,error: 'Unknown Error',diff --git a/packages/pieces/community/pinecone/src/lib/actions/search-index.ts b/packages/pieces/community/pinecone/src/lib/actions/search-index.tsindex f33573ee941..e339a0f889a 100644--- a/packages/pieces/community/pinecone/src/lib/actions/search-index.ts+++ b/packages/pieces/community/pinecone/src/lib/actions/search-index.ts@@ -1,14 +1,16 @@import { createAction, Property } from '@activepieces/pieces-framework';-import { createPineconeClientFromAuth } from '../common/pinecone-client';+import { pineconeApi } from '../common/api';import { pineconeAuth } from '../auth';+import { searchIndexOutputSchema } from '../output-schemas';-export const searchIndex = createAction({+export const searchIndexAction = createAction({auth: pineconeAuth,name: 'search_index',+ outputSchema: searchIndexOutputSchema,classification: 'SEARCH',displayName: 'Search Index',description: 'Search indexes by name or list all indexes in your project.',- audience: 'both',+ audience: 'human',aiMetadata: { description: 'Discovers indexes in the connected Pinecone project, operating in one of two modes: list all indexes (optionally narrowed by a case-insensitive partial name filter) or describe one specific index by its exact name. Use to enumerate available indexes or confirm an index exists and inspect its configuration before other operations. Idempotent read-only lookup.', idempotent: true },props: {searchMode: Property.StaticDropdown({@@ -41,11 +43,9 @@ export const searchIndex = createAction({throw new Error('You must provide an index name when using Find Specific Index mode.');}- const pc = createPineconeClientFromAuth(context.auth);-try {- if (searchMode === 'find') {- const indexDetails = await pc.describeIndex(indexName!);+ if (searchMode === 'find' && indexName) {+ const indexDetails = await pineconeApi.describeLegacyIndex({ auth: context.auth, indexName });return {success: true,@@ -56,7 +56,7 @@ export const searchIndex = createAction({message: `Successfully found index: ${indexName}`};} else {- const indexList = await pc.listIndexes();+ const indexList = await pineconeApi.listLegacyIndexes({ auth: context.auth });const allIndexes = indexList.indexes || [];let filteredIndexes = allIndexes;@@ -85,56 +85,6 @@ export const searchIndex = createAction({};}} catch (caught) {- console.log('Failed to search indexes.', caught);-- if (caught instanceof Error) {- const error = caught as any;-- if (error.status === 404 || error.code === 404) {- if (searchMode === 'find') {- return {- success: false,- mode: 'find',- searchTerm: indexName,- found: false,- error: 'Index Not Found',- code: 404,- message: `Index "${indexName}" does not exist in your project.`- };- }- }-- if (error.status === 400 || error.code === 400) {- return {- success: false,- error: 'Bad Request',- code: 400,- message: error.message || 'The request included invalid parameters.',- details: error.details || []- };- }-- if (error.status === 403 || error.code === 403) {- return {- success: false,- error: 'Permission Denied',- code: 403,- message: 'You do not have permission to access indexes in this project.',- details: error.details || []- };- }-- if (error.status >= 500 || error.code >= 500) {- return {- success: false,- error: 'Server Error',- code: error.status || error.code,- message: error.message || 'An unexpected server error occurred.',- details: error.details || []- };- }- }-return {success: false,error: 'Unknown Error',diff --git a/packages/pieces/community/pinecone/src/lib/actions/search-vector.ts b/packages/pieces/community/pinecone/src/lib/actions/search-vector.tsindex 1ea3adceb59..2678249f053 100644--- a/packages/pieces/community/pinecone/src/lib/actions/search-vector.ts+++ b/packages/pieces/community/pinecone/src/lib/actions/search-vector.ts@@ -1,14 +1,17 @@import { createAction, Property } from '@activepieces/pieces-framework';-import { createPineconeClientFromAuth } from '../common/pinecone-client';+import { pineconeClient } from '../common/client';+import type { QueryOptions, RecordSparseValues } from '../common/types';import { pineconeAuth } from '../auth';+import { searchVectorOutputSchema } from '../output-schemas';-export const searchVector = createAction({+export const searchVectorAction = createAction({auth: pineconeAuth,name: 'search_vector',+ outputSchema: searchVectorOutputSchema,classification: 'SEARCH',displayName: 'Search Vectors',description: 'Search a namespace using a query vector to find similar records.',- audience: 'both',+ audience: 'human',aiMetadata: { description: 'Runs a similarity search over a namespace of a Pinecone index, returning the top-K nearest vectors. The query can be supplied either as a raw query vector or as the ID of an existing stored vector to search by, selected via the query method, with an optional metadata filter to narrow matches. Use for semantic retrieval over stored embeddings. Requires the index name and a top-K between 1 and 10000. Idempotent read-only search.', idempotent: true },props: {indexName: Property.ShortText({@@ -126,31 +129,17 @@ export const searchVector = createAction({}}- const pc = createPineconeClientFromAuth(context.auth);+ const pc = pineconeClient.create({ auth: context.auth });- let queryRequest: any = {};+ let queryRequest: QueryOptions | undefined;try {const index = indexHost- ? pc.index(indexName, indexHost)- : pc.index(indexName);+ ? pc.index({ name: indexName, host: indexHost })+ : pc.index({ name: indexName });- queryRequest = {- topK: topK,- includeValues: includeValues || false,- includeMetadata: includeMetadata || false- };-- if (queryMethod === 'vector') {- if (vector && Array.isArray(vector)) {- queryRequest.vector = vector.map((v) => Number(v));- }- } else if (queryMethod === 'id') {- if (id) {- queryRequest.id = id;- }- }+ let sparseVector: RecordSparseValues | undefined;if (sparseIndices && sparseValues) {if (!Array.isArray(sparseIndices) || !Array.isArray(sparseValues)) {@@ -162,15 +151,24 @@ export const searchVector = createAction({);}- queryRequest.sparseVector = {+ sparseVector = {indices: sparseIndices.map((i) => Number(i)),values: sparseValues.map((v) => Number(v))};}- if (filter) {- queryRequest.filter = filter;- }+ const sharedQuery = {+ topK: topK,+ includeValues: includeValues || false,+ includeMetadata: includeMetadata || false,+ ...(sparseVector && { sparseVector }),+ ...(filter && { filter })+ };++ queryRequest =+ queryMethod === 'id' && id+ ? { ...sharedQuery, id }+ : { ...sharedQuery, vector: (vector ?? []).map((v) => Number(v)) };const queryResponse = namespace? await index.namespace(namespace).query(queryRequest)@@ -200,53 +198,6 @@ export const searchVector = createAction({message: `Successfully found ${matches.length} matches`};} catch (caught) {- console.log('Failed to search vectors.', caught);-- if (caught instanceof Error) {- const error = caught as any;-- if (error.status === 400 || error.code === 400) {- return {- success: false,- error: 'Bad Request',- code: 400,- message:- error.message ||- 'The request body included invalid request parameters.',- details: error.details || [],- query: queryRequest,- indexName: indexName,- namespace: namespace || 'default'- };- }-- if (error.status >= 400 && error.status < 500) {- return {- success: false,- error: 'Client Error',- code: error.status || error.code,- message: error.message || 'An unexpected client error occurred.',- details: error.details || [],- query: queryRequest,- indexName: indexName,- namespace: namespace || 'default'- };- }-- if (error.status >= 500 || error.code >= 500) {- return {- success: false,- error: 'Server Error',- code: error.status || error.code,- message: error.message || 'An unexpected server error occurred.',- details: error.details || [],- query: queryRequest,- indexName: indexName,- namespace: namespace || 'default'- };- }- }-return {success: false,error: 'Unknown Error',@@ -254,7 +205,7 @@ export const searchVector = createAction({caught instanceof Error? caught.message: 'An unexpected error occurred while searching vectors.',- query: queryRequest,+ query: queryRequest ?? {},indexName: indexName,namespace: namespace || 'default'};diff --git a/packages/pieces/community/pinecone/src/lib/actions/update-vector.ts b/packages/pieces/community/pinecone/src/lib/actions/update-vector.tsindex 982cc234fbd..269f82cb463 100644--- a/packages/pieces/community/pinecone/src/lib/actions/update-vector.ts+++ b/packages/pieces/community/pinecone/src/lib/actions/update-vector.ts@@ -1,14 +1,17 @@import { createAction, Property } from '@activepieces/pieces-framework';-import { createPineconeClientFromAuth } from '../common/pinecone-client';+import { pineconeClient } from '../common/client';+import type { RecordMetadata, UpdateOptions } from '../common/types';import { pineconeAuth } from '../auth';+import { updateVectorOutputSchema } from '../output-schemas';-export const updateVector = createAction({+export const updateVectorAction = createAction({auth: pineconeAuth,name: 'update_vector',+ outputSchema: updateVectorOutputSchema,classification: 'WRITE',displayName: 'Update a Vector',description: 'Updates a vector in a namespace. Overwrites existing values and metadata.',- audience: 'both',+ audience: 'human',aiMetadata: { description: 'Updates an existing vector identified by ID in a Pinecone namespace, overwriting any of its dense values, sparse values, or metadata that are provided. Use to modify a stored vector in place rather than to add new ones (use Upsert Vector for that). Requires the index name and a vector ID (1-512 chars). Idempotent: keyed on the vector ID, so repeating the same call leaves the record in the same state.', idempotent: true },props: {indexName: Property.ShortText({@@ -91,15 +94,15 @@ export const updateVector = createAction({);}- const pc = createPineconeClientFromAuth(context.auth);+ const pc = pineconeClient.create({ auth: context.auth });try {const index = indexHost- ? pc.index(indexName, indexHost)- : pc.index(indexName);+ ? pc.index({ name: indexName, host: indexHost })+ : pc.index({ name: indexName });- const updateRequest: any = {+ const updateRequest: UpdateOptions = {id: id};@@ -124,13 +127,13 @@ export const updateVector = createAction({}if (metadata && Array.isArray(metadata) && metadata.length > 0) {- const metadataObj: any = {};+ const metadataObj: RecordMetadata = {};for (const item of metadata) {- const metaItem = item as any;- const key = String(metaItem.key);- const value = metaItem.value;+ const metaItem = typeof item === 'object' && item !== null ? item : {};+ const key = String('key' in metaItem ? metaItem.key : undefined);+ const value = 'value' in metaItem ? metaItem.value : undefined;const numValue = Number(value);- metadataObj[key] = isNaN(numValue) ? value : numValue;+ metadataObj[key] = isNaN(numValue) ? String(value) : numValue;}updateRequest.metadata = metadataObj;}@@ -159,50 +162,6 @@ export const updateVector = createAction({message: `Successfully updated vector '${id}'`};} catch (caught) {- console.log('Failed to update vector.', caught);-- if (caught instanceof Error) {- const error = caught as any;-- if (error.status === 400 || error.code === 400) {- return {- success: false,- error: 'Bad Request',- code: 400,- message:- error.message ||- 'The request body included invalid request parameters.',- details: error.details || [],- vectorId: id,- indexName: indexName- };- }-- if (error.status >= 400 && error.status < 500) {- return {- success: false,- error: 'Client Error',- code: error.status || error.code,- message: error.message || 'An unexpected client error occurred.',- details: error.details || [],- vectorId: id,- indexName: indexName- };- }-- if (error.status >= 500 || error.code >= 500) {- return {- success: false,- error: 'Server Error',- code: error.status || error.code,- message: error.message || 'An unexpected server error occurred.',- details: error.details || [],- vectorId: id,- indexName: indexName- };- }- }-return {success: false,error: 'Unknown Error',diff --git a/packages/pieces/community/pinecone/src/lib/actions/upsert-vector.ts b/packages/pieces/community/pinecone/src/lib/actions/upsert-vector.tsindex 5e160158d32..5444d5ae6bb 100644--- a/packages/pieces/community/pinecone/src/lib/actions/upsert-vector.ts+++ b/packages/pieces/community/pinecone/src/lib/actions/upsert-vector.ts@@ -1,14 +1,17 @@import { createAction, Property } from '@activepieces/pieces-framework';-import { createPineconeClientFromAuth } from '../common/pinecone-client';+import { pineconeClient } from '../common/client';+import type { PineconeRecord, RecordMetadata } from '../common/types';import { pineconeAuth } from '../auth';+import { upsertVectorOutputSchema } from '../output-schemas';-export const upsertVector = createAction({+export const upsertVectorAction = createAction({auth: pineconeAuth,name: 'upsert_vector',+ outputSchema: upsertVectorOutputSchema,classification: 'WRITE',displayName: 'Upsert Vector',description: 'Upsert vectors into a namespace. Overwrites existing vectors with the same ID.',- audience: 'both',+ audience: 'human',aiMetadata: { description: 'Writes (inserts or overwrites) vectors into a namespace of a Pinecone index, accepting either a single vector or a batch of vectors supplied as structured rows, chosen via the input method. Use to store or refresh embeddings keyed by ID; each vector requires an ID and numeric values. Idempotent: because writes are keyed on the vector ID, repeating the same call overwrites the same records to the same state without creating duplicates.', idempotent: true },props: {indexName: Property.ShortText({@@ -106,15 +109,15 @@ export const upsertVector = createAction({throw new Error('You must provide an index name to upsert vectors.');}- const pc = createPineconeClientFromAuth(context.auth);+ const pc = pineconeClient.create({ auth: context.auth });- let vectorsToUpsert: any[] = [];+ let vectorsToUpsert: PineconeRecord[] = [];try {const index = indexHost- ? pc.index(indexName, indexHost)- : pc.index(indexName);+ ? pc.index({ name: indexName, host: indexHost })+ : pc.index({ name: indexName });if (vectorsInput === 'single') {if (!id) {@@ -128,7 +131,7 @@ export const upsertVector = createAction({);}- const record: any = {+ const record: PineconeRecord = {id: id,values: values.map((v) => Number(v))};@@ -147,34 +150,42 @@ export const upsertVector = createAction({);}- vectorsToUpsert = vectors.map((vector: any, index: number) => {- if (!vector.id) {+ vectorsToUpsert = vectors.map((item, index) => {+ const vector = typeof item === 'object' && item !== null ? item : {};+ const vectorId = 'id' in vector ? vector.id : undefined;+ const vectorValues = 'values' in vector ? vector.values : undefined;+ const metadataKeys = 'metadataKeys' in vector ? vector.metadataKeys : undefined;+ const metadataValues = 'metadataValues' in vector ? vector.metadataValues : undefined;+ const sparseIndicesText = 'sparseIndices' in vector ? vector.sparseIndices : undefined;+ const sparseValuesText = 'sparseValues' in vector ? vector.sparseValues : undefined;++ if (!vectorId) {throw new Error(`Vector at index ${index} must have an ID.`);}- if (!vector.values) {+ if (!vectorValues) {throw new Error(`Vector at index ${index} must have values.`);}- const values = vector.values.split(',').map((v: string) => Number(v.trim()));+ const values = String(vectorValues).split(',').map((v) => Number(v.trim()));if (values.some(isNaN) || values.length === 0) {throw new Error(`Vector at index ${index} has invalid values. Use comma-separated numbers.`);}- const record: any = {- id: String(vector.id),+ const record: PineconeRecord = {+ id: String(vectorId),values: values};- if (vector.sparseIndices && vector.sparseValues) {- const sparseIndices = vector.sparseIndices.split(',').map((v: string) => Number(v.trim()));- const sparseValues = vector.sparseValues.split(',').map((v: string) => Number(v.trim()));+ if (sparseIndicesText && sparseValuesText) {+ const sparseIndices = String(sparseIndicesText).split(',').map((v) => Number(v.trim()));+ const sparseValues = String(sparseValuesText).split(',').map((v) => Number(v.trim()));if (sparseIndices.some(isNaN) || sparseValues.some(isNaN)) {throw new Error(@@ -194,9 +205,9 @@ export const upsertVector = createAction({};}- if (vector.metadataKeys && vector.metadataValues) {- const keys = vector.metadataKeys.split(',').map((k: string) => k.trim());- const vals = vector.metadataValues.split(',').map((v: string) => v.trim());+ if (metadataKeys && metadataValues) {+ const keys = String(metadataKeys).split(',').map((k) => k.trim());+ const vals = String(metadataValues).split(',').map((v) => v.trim());if (keys.length !== vals.length) {throw new Error(@@ -204,7 +215,7 @@ export const upsertVector = createAction({);}- const metadata: any = {};+ const metadata: RecordMetadata = {};for (let i = 0; i < keys.length; i++) {const key = keys[i];const value = vals[i];@@ -219,14 +230,11 @@ export const upsertVector = createAction({}- const response: any = namespace- ? await index.namespace(namespace).upsert(vectorsToUpsert)- : await index.upsert(vectorsToUpsert);+ namespace+ ? await index.namespace(namespace).upsert({ records: vectorsToUpsert })+ : await index.upsert({ records: vectorsToUpsert });- const upsertedCount =- response && typeof response === 'object' && response.upsertedCount- ? response.upsertedCount- : vectorsToUpsert.length;+ const upsertedCount = vectorsToUpsert.length;return {success: true,@@ -236,58 +244,11 @@ export const upsertVector = createAction({vectorCount: vectorsToUpsert.length,vectors: vectorsToUpsert.map((v) => ({id: v.id,- dimension: v.values.length+ dimension: v.values?.length})),message: `Successfully upserted ${upsertedCount} vector(s)`};} catch (caught) {- console.log('Failed to upsert vector(s).', caught);-- if (caught instanceof Error) {- const error = caught as any;-- if (error.status === 400 || error.code === 400) {- return {- success: false,- error: 'Bad Request',- code: 400,- message:- error.message ||- 'The request body included invalid request parameters.',- details: error.details || [],- vectorCount: vectorsToUpsert?.length || 0,- indexName: indexName,- namespace: namespace || 'default'- };- }-- if (error.status >= 400 && error.status < 500) {- return {- success: false,- error: 'Client Error',- code: error.status || error.code,- message: error.message || 'An unexpected client error occurred.',- details: error.details || [],- vectorCount: vectorsToUpsert?.length || 0,- indexName: indexName,- namespace: namespace || 'default'- };- }-- if (error.status >= 500 || error.code >= 500) {- return {- success: false,- error: 'Server Error',- code: error.status || error.code,- message: error.message || 'An unexpected server error occurred.',- details: error.details || [],- vectorCount: vectorsToUpsert?.length || 0,- indexName: indexName,- namespace: namespace || 'default'- };- }- }-return {success: false,error: 'Unknown Error',diff --git a/packages/pieces/community/pinecone/src/lib/auth.ts b/packages/pieces/community/pinecone/src/lib/auth.tsindex ce868556486..1009b5a4163 100644--- a/packages/pieces/community/pinecone/src/lib/auth.ts+++ b/packages/pieces/community/pinecone/src/lib/auth.ts@@ -1,4 +1,5 @@-import { PieceAuth, Property } from '@activepieces/pieces-framework';+import { AppConnectionType, PieceAuth, Property, tryCatch } from '@activepieces/pieces-framework';+import { pineconeClient } from './common/client';export const pineconeAuth = PieceAuth.CustomAuth({description: 'Configure your Pinecone API key',@@ -11,31 +12,15 @@ export const pineconeAuth = PieceAuth.CustomAuth({}),},validate: async ({ auth }) => {- try {- const { apiKey } = auth;-- if (!apiKey || typeof apiKey !== 'string') {- return {- valid: false,- error: 'API key is required'- };- }-- if (apiKey.length < 10) {- return {- valid: false,- error: 'API key appears to be too short. Please check your Pinecone API key.'- };- }-- return {- valid: true- };- } catch (error) {+ const { error } = await tryCatch(() =>+ pineconeClient.create({ auth: { type: AppConnectionType.CUSTOM_AUTH, props: auth } }).indexes.list(),+ );+ if (error) {return {valid: false,- error: 'Invalid authentication configuration'+ error: 'Could not connect to Pinecone. Check that the API key is correct and belongs to the target project.',};}- }+ return { valid: true };+ },});diff --git a/packages/pieces/community/pinecone/src/lib/common/ai-props.ts b/packages/pieces/community/pinecone/src/lib/common/ai-props.tsnew file mode 100644index 00000000000..22f2e9a7f7e--- /dev/null+++ b/packages/pieces/community/pinecone/src/lib/common/ai-props.ts@@ -0,0 +1,162 @@+import { Property } from '@activepieces/pieces-framework';++import type { PineconeCloud, PineconeDeletionProtection, PineconeMetric } from './types';++function indexName<R extends boolean>({+ required,+ displayName = 'Index Name',+ description = 'Name of the index, from List Indexes. The action looks up the index host itself.',+}: PropParams<R>) {+ return Property.ShortText({ displayName, description, required });+}++function namespace<R extends boolean>({+ required,+ displayName = 'Namespace',+ description = 'Namespace inside the index, from List Namespaces. Leave empty for the default namespace ("__default__").',+}: PropParams<R>) {+ return Property.ShortText({ displayName, description, required });+}++function limit<R extends boolean>({+ required,+ displayName = 'Limit',+ description = 'Maximum number of items to return in this page.',+}: PropParams<R>) {+ return Property.Number({ displayName, description, required });+}++function paginationToken<R extends boolean>({+ required,+ displayName = 'Pagination Token',+ description = 'The `next` token from the previous page of this same list, to fetch the following page.',+}: PropParams<R>) {+ return Property.ShortText({ displayName, description, required });+}++function cloud<R extends boolean>({+ required,+ displayName = 'Cloud',+ description = 'Public cloud that hosts the index: aws, gcp or azure.',+}: PropParams<R>) {+ return Property.StaticDropdown<PineconeCloud, R>({+ displayName,+ description,+ required,+ options: {+ options: [+ { label: 'AWS', value: 'aws' },+ { label: 'GCP', value: 'gcp' },+ { label: 'Azure', value: 'azure' },+ ],+ },+ });+}++function region<R extends boolean>({+ required,+ displayName = 'Region',+ description = 'Cloud region for the index, e.g. "us-east-1" on aws, "us-central1" on gcp, "eastus2" on azure.',+}: PropParams<R>) {+ return Property.ShortText({ displayName, description, required });+}++function deletionProtection<R extends boolean>({+ required,+ displayName = 'Deletion Protection',+ description = 'Set to "enabled" to block deleting the index until it is set back to "disabled". Leave empty to keep the default (disabled) or the current value.',+}: PropParams<R>) {+ return Property.StaticDropdown<PineconeDeletionProtection, R>({+ displayName,+ description,+ required,+ options: {+ options: [+ { label: 'Enabled', value: 'enabled' },+ { label: 'Disabled', value: 'disabled' },+ ],+ },+ });+}++function tags<R extends boolean>({+ required,+ displayName = 'Tags',+ description = 'Index tags as a JSON object of string values, e.g. {"team": "search"}. At most 20 tags; set a value to "" to remove that tag.',+}: PropParams<R>) {+ return Property.Json({ displayName, description, required });+}++function readNodeType<R extends boolean>({+ required,+ displayName = 'Dedicated Node Type',+ description = 'Set to use dedicated read nodes instead of on-demand reads: "b1" (balanced) or "t1" (higher throughput). Needs Read Replicas and Read Shards too.',+}: PropParams<R>) {+ return Property.StaticDropdown<'b1' | 't1', R>({+ displayName,+ description,+ required,+ options: {+ options: [+ { label: 'b1', value: 'b1' },+ { label: 't1', value: 't1' },+ ],+ },+ });+}++function readReplicas<R extends boolean>({+ required,+ displayName = 'Read Replicas',+ description = 'Number of dedicated read replicas. Used only with Dedicated Node Type.',+}: PropParams<R>) {+ return Property.Number({ displayName, description, required });+}++function readShards<R extends boolean>({+ required,+ displayName = 'Read Shards',+ description = 'Number of dedicated read shards. Used only with Dedicated Node Type.',+}: PropParams<R>) {+ return Property.Number({ displayName, description, required });+}++function metric<R extends boolean>({+ required,+ displayName = 'Metric',+ description = 'Distance metric for similarity search: cosine, euclidean or dotproduct.',+}: PropParams<R>) {+ return Property.StaticDropdown<PineconeMetric, R>({+ displayName,+ description,+ required,+ options: {+ options: [+ { label: 'Cosine', value: 'cosine' },+ { label: 'Euclidean', value: 'euclidean' },+ { label: 'Dot Product', value: 'dotproduct' },+ ],+ },+ });+}++export const pineconeAiProps = {+ indexName,+ namespace,+ limit,+ paginationToken,+ cloud,+ region,+ deletionProtection,+ tags,+ readNodeType,+ readReplicas,+ readShards,+ metric,+};++export type PropParams<R extends boolean> = {+ required: R;+ displayName?: string;+ description?: string;+};diff --git a/packages/pieces/community/pinecone/src/lib/common/api.ts b/packages/pieces/community/pinecone/src/lib/common/api.tsnew file mode 100644index 00000000000..a780dd51766--- /dev/null+++ b/packages/pieces/community/pinecone/src/lib/common/api.ts@@ -0,0 +1,300 @@+import { HttpError, HttpMethod, QueryParams } from '@activepieces/pieces-common';+import { tryCatch } from '@activepieces/pieces-framework';++import { pineconeClient } from './client';++import type {+ PineconeAuthValue,+ PineconeLegacyCreateIndexRequest,+ PineconeLegacyIndex,+ PineconeLegacyIndexResponse,+ PineconeNamespaceAlias,+ PineconeNamespaceAliasList,+} from './types';++async function indexDataRequest<T>({+ auth,+ indexName,+ method,+ path,+ query,+ body,+}: IndexDataRequestParams & { auth: PineconeAuthValue }): Promise<T> {+ const index = await pineconeClient.create({ auth }).indexes.describe(indexName);+ return await pineconeClient.request<T>({+ auth,+ method,+ url: `https://${index.host}`,+ path,+ query,+ body,+ });+}++async function listNamespaceAliases({+ auth,+ indexName,+ limit,+ paginationToken,+ prefix,+ targetNamespace,+}: ListNamespaceAliasesParams & { auth: PineconeAuthValue }): Promise<PineconeNamespaceAliasList> {+ return await indexDataRequest<PineconeNamespaceAliasList>({+ auth,+ indexName,+ method: HttpMethod.GET,+ path: '/namespace-aliases',+ query: {+ ...(limit !== undefined ? { limit: String(limit) } : {}),+ ...(paginationToken !== undefined ? { paginationToken } : {}),+ ...(prefix !== undefined ? { prefix } : {}),+ ...(targetNamespace !== undefined ? { target_namespace: targetNamespace } : {}),+ },+ });+}++async function createNamespaceAlias({+ auth,+ indexName,+ aliasName,+ targetNamespace,+}: NamespaceAliasParams & {+ targetNamespace: string;+ auth: PineconeAuthValue;+}): Promise<PineconeNamespaceAlias> {+ return await indexDataRequest<PineconeNamespaceAlias>({+ auth,+ indexName,+ method: HttpMethod.POST,+ path: '/namespace-aliases',+ body: { name: aliasName, target_namespace: targetNamespace },+ });+}++async function getNamespaceAlias({+ auth,+ indexName,+ aliasName,+}: NamespaceAliasParams & { auth: PineconeAuthValue }): Promise<PineconeNamespaceAlias> {+ return await indexDataRequest<PineconeNamespaceAlias>({+ auth,+ indexName,+ method: HttpMethod.GET,+ path: `/namespace-aliases/${encodeURIComponent(aliasName)}`,+ });+}++async function repointNamespaceAlias({+ auth,+ indexName,+ aliasName,+ targetNamespace,+}: NamespaceAliasParams & {+ targetNamespace: string;+ auth: PineconeAuthValue;+}): Promise<PineconeNamespaceAlias> {+ return await indexDataRequest<PineconeNamespaceAlias>({+ auth,+ indexName,+ method: HttpMethod.PATCH,+ path: `/namespace-aliases/${encodeURIComponent(aliasName)}`,+ body: { target_namespace: targetNamespace },+ });+}++async function deleteNamespaceAlias({+ auth,+ indexName,+ aliasName,+}: NamespaceAliasParams & { auth: PineconeAuthValue }): Promise<void> {+ await indexDataRequest<unknown>({+ auth,+ indexName,+ method: HttpMethod.DELETE,+ path: `/namespace-aliases/${encodeURIComponent(aliasName)}`,+ });+}++async function createLegacyIndex({+ auth,+ request,+ waitUntilReady,+ suppressConflicts,+}: {+ auth: PineconeAuthValue;+ request: PineconeLegacyCreateIndexRequest;+ waitUntilReady: boolean;+ suppressConflicts: boolean;+}): Promise<PineconeLegacyIndex | undefined> {+ const { data, error } = await tryCatch(() =>+ pineconeClient.request<PineconeLegacyIndexResponse>({+ auth,+ method: HttpMethod.POST,+ path: '/indexes',+ apiVersion: LEGACY_INDEX_API_VERSION,+ body: toLegacyCreateIndexBody(request),+ }),+ );+ if (error) {+ if (suppressConflicts && error instanceof HttpError && error.response.status === 409) {+ return undefined;+ }+ throw error;+ }+ if (waitUntilReady) {+ return await waitUntilLegacyIndexReady({ auth, indexName: request.name });+ }+ return toLegacyIndex(data);+}++async function describeLegacyIndex({+ auth,+ indexName,+}: {+ auth: PineconeAuthValue;+ indexName: string;+}): Promise<PineconeLegacyIndex> {+ const index = await pineconeClient.request<PineconeLegacyIndexResponse>({+ auth,+ method: HttpMethod.GET,+ path: `/indexes/${encodeURIComponent(indexName)}`,+ apiVersion: LEGACY_INDEX_API_VERSION,+ });+ return toLegacyIndex(index);+}++async function listLegacyIndexes({+ auth,+}: {+ auth: PineconeAuthValue;+}): Promise<{ indexes?: PineconeLegacyIndex[] }> {+ const response = await pineconeClient.request<{ indexes?: PineconeLegacyIndexResponse[] }>({+ auth,+ method: HttpMethod.GET,+ path: '/indexes',+ apiVersion: LEGACY_INDEX_API_VERSION,+ });+ return { indexes: response.indexes?.map(toLegacyIndex) };+}++export const pineconeApi = {+ createLegacyIndex,+ describeLegacyIndex,+ listLegacyIndexes,+ listNamespaceAliases,+ createNamespaceAlias,+ getNamespaceAlias,+ repointNamespaceAlias,+ deleteNamespaceAlias,+};++async function waitUntilLegacyIndexReady({+ auth,+ indexName,+}: {+ auth: PineconeAuthValue;+ indexName: string;+}): Promise<PineconeLegacyIndex> {+ const index = await describeLegacyIndex({ auth, indexName });+ if (index.status.ready) {+ return index;+ }+ await new Promise((resolve) => setTimeout(resolve, 1000));+ return await waitUntilLegacyIndexReady({ auth, indexName });+}++function toLegacyCreateIndexBody(request: PineconeLegacyCreateIndexRequest): object {+ const { serverless, pod } = request.spec;+ return {+ name: request.name,+ dimension: request.dimension,+ metric: request.metric,+ deletion_protection: request.deletionProtection,+ tags: request.tags,+ vector_type: request.vectorType,+ spec: {+ ...(serverless !== undefined+ ? {+ serverless: {+ cloud: serverless.cloud,+ region: serverless.region,+ source_collection: serverless.sourceCollection,+ },+ }+ : {}),+ ...(pod !== undefined+ ? {+ pod: {+ environment: pod.environment,+ pod_type: pod.podType,+ replicas: pod.replicas,+ shards: pod.shards,+ pods: pod.pods,+ source_collection: pod.sourceCollection,+ },+ }+ : {}),+ },+ };+}++function toLegacyIndex(index: PineconeLegacyIndexResponse): PineconeLegacyIndex {+ const { byoc, pod, serverless } = index.spec;+ return {+ name: index.name,+ dimension: index.dimension,+ metric: index.metric,+ host: index.host,+ privateHost: index.private_host,+ deletionProtection: index.deletion_protection,+ tags: index.tags,+ embed: index.embed && {+ model: index.embed.model,+ metric: index.embed.metric,+ dimension: index.embed.dimension,+ vectorType: index.embed.vector_type,+ fieldMap: index.embed.field_map,+ readParameters: index.embed.read_parameters,+ writeParameters: index.embed.write_parameters,+ },+ spec: {+ byoc: byoc && { environment: byoc.environment },+ pod: pod && {+ environment: pod.environment,+ replicas: pod.replicas,+ shards: pod.shards,+ podType: pod.pod_type,+ pods: pod.pods,+ metadataConfig: pod.metadata_config && { indexed: pod.metadata_config.indexed },+ sourceCollection: pod.source_collection,+ },+ serverless: serverless && {+ cloud: serverless.cloud,+ region: serverless.region,+ sourceCollection: serverless.source_collection,+ },+ },+ status: { ready: index.status.ready, state: index.status.state },+ vectorType: index.vector_type,+ };+}++const LEGACY_INDEX_API_VERSION = '2026-04';++type IndexDataRequestParams = {+ indexName: string;+ method: HttpMethod;+ path: string;+ query?: QueryParams;+ body?: unknown;+};++type ListNamespaceAliasesParams = {+ indexName: string;+ limit?: number;+ paginationToken?: string;+ prefix?: string;+ targetNamespace?: string;+};++type NamespaceAliasParams = { indexName: string; aliasName: string };diff --git a/packages/pieces/community/pinecone/src/lib/common/client.ts b/packages/pieces/community/pinecone/src/lib/common/client.tsnew file mode 100644index 00000000000..0099a7a4e2c--- /dev/null+++ b/packages/pieces/community/pinecone/src/lib/common/client.ts@@ -0,0 +1,49 @@+import { Pinecone } from '@pinecone-database/pinecone';++import { httpClient, HttpMethod, QueryParams } from '@activepieces/pieces-common';++import type { PineconeAuthValue } from './types';++function create({ auth }: { auth: PineconeAuthValue }): Pinecone {+ if (!auth.props || !auth.props.apiKey) {+ throw new Error('Invalid authentication: API key is required');+ }+ return new Pinecone({ apiKey: auth.props.apiKey });+}++function baseUrl(): string {+ return CONTROL_PLANE_URL;+}++async function request<T>({+ auth,+ method,+ url = CONTROL_PLANE_URL,+ path,+ query,+ body,+ apiVersion = API_VERSION,+}: RequestParams & { auth: PineconeAuthValue }): Promise<T> {+ const response = await httpClient.sendRequest<T>({+ method,+ url: `${url}${path}`,+ headers: { 'Api-Key': auth.props.apiKey, 'X-Pinecone-Api-Version': apiVersion },+ queryParams: query,+ body,+ });+ return response.body;+}++export const pineconeClient = { create, baseUrl, request, apiVersion: () => API_VERSION };++const CONTROL_PLANE_URL = 'https://api.pinecone.io';+const API_VERSION = '2026-07';++type RequestParams = {+ method: HttpMethod;+ url?: string;+ path: string;+ query?: QueryParams;+ body?: unknown;+ apiVersion?: string;+};diff --git a/packages/pieces/community/pinecone/src/lib/common/pinecone-client.ts b/packages/pieces/community/pinecone/src/lib/common/pinecone-client.tsdeleted file mode 100644index 08deca25a3e..00000000000--- a/packages/pieces/community/pinecone/src/lib/common/pinecone-client.ts+++ /dev/null@@ -1,48 +0,0 @@-import { AppConnectionValueForAuthProperty } from '@activepieces/pieces-framework';-import { Pinecone, type PineconeConfiguration } from '@pinecone-database/pinecone';-import { pineconeAuth } from '../auth';--export interface PineconeAuthConfig {- apiKey: string;-}---export function createPineconeClient(authConfig: PineconeAuthConfig): Pinecone {- if (!authConfig.apiKey) {- throw new Error('Pinecone API key is required. Please provide a valid API key from your Pinecone console.');- }-- const config: PineconeConfiguration = {- apiKey: authConfig.apiKey,- };-- return new Pinecone(config);-}---export function validateApiKey(apiKey: string): void {- if (!apiKey || typeof apiKey !== 'string') {- throw new Error('Invalid API key: API key must be a non-empty string');- }-- if (apiKey.length < 10) {- throw new Error('Invalid API key: API key appears to be too short');- }-}---export function createPineconeClientFromAuth(auth: AppConnectionValueForAuthProperty<typeof pineconeAuth>): Pinecone {- if (typeof auth === 'string') {- return createPineconeClient({ apiKey: auth });- }-- const actualAuth = auth.props;-- if (!actualAuth || !actualAuth.apiKey) {- throw new Error('Invalid authentication: API key is required');- }-- return createPineconeClient({- apiKey: actualAuth.apiKey,- });-}\ No newline at end of filediff --git a/packages/pieces/community/pinecone/src/lib/common/types.ts b/packages/pieces/community/pinecone/src/lib/common/types.tsnew file mode 100644index 00000000000..cb95c309dbc--- /dev/null+++ b/packages/pieces/community/pinecone/src/lib/common/types.ts@@ -0,0 +1,132 @@+import type { AppConnectionType } from '@activepieces/pieces-framework';++import type { NativeCreateIndexOptions } from '@pinecone-database/pinecone';++export type PineconeAuthValue = {+ type: AppConnectionType.CUSTOM_AUTH;+ props: { apiKey: string };+};++export type PineconeIndexDeployment = NativeCreateIndexOptions['deployment'];++export type {+ CreateIndexSchemaField,+ DocumentRecord,+ MessageModel,+ PineconeRecord,+ QueryOptions,+ ReadCapacity,+ RecordMetadata,+ RecordMetadataValue,+ RecordSparseValues,+ UpdateOptions,+} from '@pinecone-database/pinecone';++export type PineconeDeletionProtection = 'enabled' | 'disabled';++export type PineconeCloud = 'aws' | 'gcp' | 'azure';++export type PineconeMetric = 'cosine' | 'euclidean' | 'dotproduct';++export type PineconeNamespaceAlias = {+ name: string;+ target_namespace: string;+ created_at?: string;+ updated_at?: string;+};++export type PineconeNamespaceAliasList = {+ namespace_aliases?: PineconeNamespaceAlias[];+ pagination?: { next?: string };+ total_count?: number;+};++export type PineconeLegacyIndexSpec = {+ serverless?: { cloud: string; region: string; sourceCollection?: string };+ pod?: {+ environment: string;+ podType: string;+ replicas?: number;+ shards?: number;+ pods?: number;+ sourceCollection?: string;+ };+};++export type PineconeLegacyCreateIndexRequest = {+ name: string;+ dimension?: number;+ metric: string;+ vectorType?: string;+ deletionProtection?: PineconeDeletionProtection;+ tags?: Record<string, string>;+ spec: PineconeLegacyIndexSpec;+};++export type PineconeLegacyIndex = {+ name: string;+ dimension?: number;+ metric: string;+ host: string;+ privateHost?: string;+ deletionProtection?: string;+ tags?: Record<string, string>;+ embed?: {+ model: string;+ metric?: string;+ dimension?: number;+ vectorType?: string;+ fieldMap?: object;+ readParameters?: object;+ writeParameters?: object;+ };+ spec: {+ byoc?: { environment: string };+ pod?: {+ environment: string;+ replicas?: number;+ shards?: number;+ podType: string;+ pods?: number;+ metadataConfig?: { indexed?: string[] };+ sourceCollection?: string;+ };+ serverless?: { cloud: string; region: string; sourceCollection?: string };+ };+ status: { ready: boolean; state: string };+ vectorType: string;+};++export type PineconeLegacyIndexResponse = {+ name: string;+ dimension?: number;+ metric: string;+ host: string;+ private_host?: string;+ deletion_protection?: string;+ tags?: Record<string, string>;+ embed?: {+ model: string;+ metric?: string;+ dimension?: number;+ vector_type?: string;+ field_map?: object;+ read_parameters?: object;+ write_parameters?: object;+ };+ spec: {+ byoc?: { environment: string };+ pod?: {+ environment: string;+ replicas?: number;+ shards?: number;+ pod_type: string;+ pods?: number;+ metadata_config?: { indexed?: string[] };+ source_collection?: string;+ };+ serverless?: { cloud: string; region: string; source_collection?: string };+ };+ status: { ready: boolean; state: string };+ vector_type: string;+};diff --git a/packages/pieces/community/pinecone/src/lib/common/utils.ts b/packages/pieces/community/pinecone/src/lib/common/utils.tsnew file mode 100644index 00000000000..08e6a980328--- /dev/null+++ b/packages/pieces/community/pinecone/src/lib/common/utils.ts@@ -0,0 +1,292 @@+import type {+ DocumentRecord,+ MessageModel,+ PineconeRecord,+ ReadCapacity,+ RecordMetadata,+ RecordMetadataValue,+ RecordSparseValues,+} from './types';++function toStringMap({+ value,+ propName,+}: {+ value: object;+ propName: string;+}): Record<string, string> {+ return Object.fromEntries(+ Object.entries(value).map(([key, entry]): [string, string] => {+ if (typeof entry !== 'string') {+ throw new Error(`"${propName}" values must be strings, but "${key}" is not.`);+ }+ return [key, entry];+ }),+ );+}++function toRecordMetadata({+ value,+ propName,+}: {+ value: object;+ propName: string;+}): RecordMetadata {+ return Object.fromEntries(+ Object.entries(value).map(([key, entry]): [string, RecordMetadataValue] => [+ key,+ toMetadataValue({ key, entry, propName }),+ ]),+ );+}++function toStringList({ value, propName }: { value: unknown[]; propName: string }): string[] {+ if (!value.every((item): item is string => typeof item === 'string')) {+ throw new Error(`"${propName}" must be a list of strings.`);+ }+ return value;+}++function toNumberList({ value, propName }: { value: unknown[]; propName: string }): number[] {+ if (!value.every((item): item is number => typeof item === 'number')) {+ throw new Error(`"${propName}" must be a list of numbers.`);+ }+ return value;+}++function toReadCapacity({+ nodeType,+ replicas,+ shards,+}: {+ nodeType?: 'b1' | 't1';+ replicas?: number;+ shards?: number;+}): ReadCapacity | undefined {+ if (nodeType === undefined) {+ if (replicas !== undefined || shards !== undefined) {+ throw new Error('"Read Replicas" and "Read Shards" need "Dedicated Node Type".');+ }+ return undefined;+ }+ if (replicas === undefined || shards === undefined) {+ throw new Error('"Dedicated Node Type" needs both "Read Replicas" and "Read Shards".');+ }+ return {+ mode: 'Dedicated',+ dedicated: { nodeType, scaling: 'Manual', manual: { replicas, shards } },+ };+}++function toSparseValues({+ indices,+ values,+ propName,+}: {+ indices: unknown[];+ values: unknown[];+ propName: string;+}): RecordSparseValues {+ if (indices.length !== values.length) {+ throw new Error(`"${propName}" indices and values must have the same length.`);+ }+ return {+ indices: toNumberList({ value: indices, propName: `${propName} indices` }),+ values: toNumberList({ value: values, propName: `${propName} values` }),+ };+}++function toVectorRecords({+ value,+ propName,+}: {+ value: unknown[];+ propName: string;+}): PineconeRecord[] {+ return value.map((item, position) =>+ toVectorRecord({ item, propName: `${propName}[${position}]` }),+ );+}++function toVectorRecord({ item, propName }: { item: unknown; propName: string }): PineconeRecord {+ if (typeof item !== 'object' || item === null || Array.isArray(item)) {+ throw new Error(`"${propName}" must be an object like {"id": "vec-1", "values": [0.1, 0.2]}.`);+ }+ const id = 'id' in item ? item.id : undefined;+ if (typeof id !== 'string' || id === '') {+ throw new Error(`"${propName}.id" must be a non-empty string.`);+ }+ const values = 'values' in item ? item.values : undefined;+ const sparseValues = 'sparseValues' in item ? item.sparseValues : undefined;+ const metadata = 'metadata' in item ? item.metadata : undefined;+ if (values !== undefined && !Array.isArray(values)) {+ throw new Error(`"${propName}.values" must be a list of numbers.`);+ }+ if (+ metadata !== undefined &&+ (typeof metadata !== 'object' || metadata === null || Array.isArray(metadata))+ ) {+ throw new Error(`"${propName}.metadata" must be an object.`);+ }+ return {+ id,+ ...(values !== undefined+ ? { values: toNumberList({ value: values, propName: `${propName}.values` }) }+ : {}),+ ...(sparseValues !== undefined+ ? {+ sparseValues: toSparseObject({+ value: sparseValues,+ propName: `${propName}.sparseValues`,+ }),+ }+ : {}),+ ...(metadata !== undefined+ ? { metadata: toRecordMetadata({ value: metadata, propName: `${propName}.metadata` }) }+ : {}),+ };+}++function toSparseObject({+ value,+ propName,+}: {+ value: unknown;+ propName: string;+}): RecordSparseValues {+ if (typeof value !== 'object' || value === null) {+ throw new Error(+ `"${propName}" must be an object like {"indices": [1, 5], "values": [0.5, 0.3]}.`,+ );+ }+ const indices = 'indices' in value ? value.indices : undefined;+ const values = 'values' in value ? value.values : undefined;+ if (!Array.isArray(indices) || !Array.isArray(values)) {+ throw new Error(`"${propName}" needs "indices" and "values" lists.`);+ }+ return toSparseValues({ indices, values, propName });+}++function toDocuments({+ value,+ propName,+}: {+ value: unknown[];+ propName: string;+}): DocumentRecord[] {+ return value.map((item, position) => {+ if (typeof item !== 'object' || item === null || Array.isArray(item)) {+ throw new Error(`"${propName}[${position}]" must be an object with an "_id".`);+ }+ const id = '_id' in item ? item._id : undefined;+ if (typeof id !== 'string' || id === '') {+ throw new Error(`"${propName}[${position}]._id" must be a non-empty string.`);+ }+ return { ...item, _id: id };+ });+}++function toTextRecords({+ value,+ propName,+}: {+ value: unknown[];+ propName: string;+}): PineconeTextRecord[] {+ return value.map((item, position) => {+ if (typeof item !== 'object' || item === null || Array.isArray(item)) {+ throw new Error(`"${propName}[${position}]" must be an object with an "_id".`);+ }+ const fields = toRecordMetadata({ value: item, propName: `${propName}[${position}]` });+ const id = fields['_id'];+ if (typeof id !== 'string' || id === '') {+ throw new Error(`"${propName}[${position}]._id" must be a non-empty string.`);+ }+ return { ...fields, _id: id };+ });+}++function toMessages({ value, propName }: { value: unknown[]; propName: string }): MessageModel[] {+ return value.map((item, position) => {+ const role =+ typeof item === 'object' && item !== null && 'role' in item ? item.role : undefined;+ const content =+ typeof item === 'object' && item !== null && 'content' in item ? item.content : undefined;+ if (typeof role !== 'string' || typeof content !== 'string') {+ throw new Error(+ `"${propName}[${position}]" must be {"role": "user" | "assistant", "content": "..."}.`,+ );+ }+ return { role, content };+ });+}++function toRerankDocuments({+ value,+ propName,+}: {+ value: unknown[];+ propName: string;+}): Array<string | Record<string, string>> {+ return value.map((item, position) => {+ if (typeof item === 'string') {+ return item;+ }+ if (typeof item !== 'object' || item === null || Array.isArray(item)) {+ throw new Error(`"${propName}[${position}]" must be a string or an object of string fields.`);+ }+ return toStringMap({ value: item, propName: `${propName}[${position}]` });+ });+}++function toFileMetadata({+ value,+ propName,+}: {+ value: object;+ propName: string;+}): Record<string, string | number> {+ return Object.fromEntries(+ Object.entries(value).map(([key, entry]): [string, string | number] => {+ if (typeof entry !== 'string' && typeof entry !== 'number') {+ throw new Error(`"${propName}.${key}" must be a string or a number.`);+ }+ return [key, entry];+ }),+ );+}++function toMetadataValue({+ key,+ entry,+ propName,+}: {+ key: string;+ entry: unknown;+ propName: string;+}): RecordMetadataValue {+ if (typeof entry === 'string' || typeof entry === 'number' || typeof entry === 'boolean') {+ return entry;+ }+ if (Array.isArray(entry) && entry.every((item): item is string => typeof item === 'string')) {+ return entry;+ }+ throw new Error(`"${propName}.${key}" must be a string, number, boolean or list of strings.`);+}++export const pineconeUtils = {+ toStringMap,+ toRecordMetadata,+ toStringList,+ toNumberList,+ toReadCapacity,+ toSparseValues,+ toVectorRecords,+ toDocuments,+ toTextRecords,+ toMessages,+ toRerankDocuments,+ toFileMetadata,+};++type PineconeTextRecord = RecordMetadata & { _id: string };diff --git a/packages/pieces/community/pinecone/src/lib/output-schemas.ts b/packages/pieces/community/pinecone/src/lib/output-schemas.tsnew file mode 100644index 00000000000..76fcb43263c--- /dev/null+++ b/packages/pieces/community/pinecone/src/lib/output-schemas.ts@@ -0,0 +1,858 @@+import { OutputSchema } from '@activepieces/pieces-framework';++const statusFields: OutputSchema['fields'] = [+ { key: 'ready', label: 'Ready', format: 'boolean' },+ { key: 'state', label: 'State' },+];++const indexFields: OutputSchema['fields'] = [+ { key: 'name', label: 'Index Name' },+ { key: 'host', label: 'Host' },+ { key: 'status', label: 'Status', children: statusFields },+ {+ key: 'deployment',+ label: 'Deployment',+ children: [+ { key: 'deploymentType', label: 'Deployment Type' },+ { key: 'cloud', label: 'Cloud' },+ { key: 'region', label: 'Region' },+ { key: 'environment', label: 'Environment' },+ ],+ },+ {+ key: 'readCapacity',+ label: 'Read Capacity',+ children: [+ { key: 'mode', label: 'Mode' },+ { key: 'status', label: 'Status', children: [{ key: 'state', label: 'State' }] },+ ],+ },+ {+ key: 'schema',+ label: 'Schema',+ children: [+ {+ key: 'fields',+ label: 'Fields',+ dynamicKey: true,+ children: [+ { key: 'type', label: 'Type' },+ { key: 'dimension', label: 'Dimension', format: 'number' },+ { key: 'metric', label: 'Metric' },+ ],+ },+ ],+ },+ { key: 'tags', label: 'Tags', dynamicKey: true },+ { key: 'deletionProtection', label: 'Deletion Protection' },+];++const legacyIndexFields: OutputSchema['fields'] = [+ { key: 'name', label: 'Index Name' },+ { key: 'dimension', label: 'Dimension', format: 'number' },+ { key: 'metric', label: 'Metric' },+ { key: 'host', label: 'Host' },+ { key: 'deletionProtection', label: 'Deletion Protection' },+ { key: 'tags', label: 'Tags', dynamicKey: true },+ {+ key: 'embed',+ label: 'Embedding Model',+ children: [+ { key: 'model', label: 'Model' },+ { key: 'metric', label: 'Metric' },+ { key: 'dimension', label: 'Dimension', format: 'number' },+ { key: 'vectorType', label: 'Vector Type' },+ { key: 'fieldMap', label: 'Field Map', dynamicKey: true },+ { key: 'readParameters', label: 'Read Parameters', dynamicKey: true },+ { key: 'writeParameters', label: 'Write Parameters', dynamicKey: true },+ ],+ },+ {+ key: 'spec',+ label: 'Spec',+ children: [+ {+ key: 'serverless',+ label: 'Serverless',+ children: [+ { key: 'cloud', label: 'Cloud' },+ { key: 'region', label: 'Region' },+ ],+ },+ ],+ },+ { key: 'status', label: 'Status', children: statusFields },+ { key: 'vectorType', label: 'Vector Type' },+];++const sparseValuesFields: OutputSchema['fields'] = [+ { key: 'indices', label: 'Indices' },+ { key: 'values', label: 'Values' },+];++const vectorRecordFields: OutputSchema['fields'] = [+ { key: 'id', label: 'Vector ID' },+ { key: 'values', label: 'Values' },+ { key: 'sparseValues', label: 'Sparse Values', children: sparseValuesFields },+ { key: 'metadata', label: 'Metadata', dynamicKey: true },+];++const vectorMatchFields: OutputSchema['fields'] = [+ { key: 'id', label: 'Vector ID' },+ { key: 'score', label: 'Score', format: 'number' },+ { key: 'values', label: 'Values' },+ { key: 'sparseValues', label: 'Sparse Values', children: sparseValuesFields },+ { key: 'metadata', label: 'Metadata', dynamicKey: true },+];++const readUsageField: OutputSchema['fields'][number] = {+ key: 'usage',+ label: 'Usage',+ children: [{ key: 'readUnits', label: 'Read Units', format: 'number' }],+};++const paginationField: OutputSchema['fields'][number] = {+ key: 'pagination',+ label: 'Pagination',+ children: [{ key: 'next', label: 'Next Page Token' }],+};++const namespaceBaseFields: OutputSchema['fields'] = [+ { key: 'name', label: 'Namespace' },+ { key: 'recordCount', label: 'Record Count' },+ { key: 'sizeBytes', label: 'Size', format: 'filesize' },+];++const namespaceFields: OutputSchema['fields'] = [+ ...namespaceBaseFields,+ {+ key: 'schema',+ label: 'Schema',+ children: [+ {+ key: 'fields',+ label: 'Filterable Fields',+ dynamicKey: true,+ children: [{ key: 'filterable', label: 'Filterable', format: 'boolean' }],+ },+ ],+ },+];++const namespaceAliasFields: OutputSchema['fields'] = [+ { key: 'name', label: 'Alias Name' },+ { key: 'target_namespace', label: 'Target Namespace' },+ { key: 'created_at', label: 'Created At', format: 'datetime' },+ { key: 'updated_at', label: 'Updated At', format: 'datetime' },+];++const assistantFields: OutputSchema['fields'] = [+ { key: 'name', label: 'Assistant Name' },+ { key: 'instructions', label: 'Instructions' },+ { key: 'metadata', label: 'Metadata', dynamicKey: true },+ { key: 'status', label: 'Status' },+ { key: 'host', label: 'Host', format: 'url' },+ { key: 'region', label: 'Region' },+ { key: 'createdAt', label: 'Created At', format: 'datetime' },+ { key: 'updatedAt', label: 'Updated At', format: 'datetime' },+];++const assistantFileFields: OutputSchema['fields'] = [+ { key: 'id', label: 'File ID' },+ { key: 'name', label: 'File Name' },+ { key: 'size', label: 'Size', format: 'filesize' },+ { key: 'metadata', label: 'Metadata', dynamicKey: true },+ { key: 'status', label: 'Status' },+ { key: 'multimodal', label: 'Multimodal', format: 'boolean' },+ { key: 'createdOn', label: 'Created On', format: 'datetime' },+ { key: 'updatedOn', label: 'Updated On', format: 'datetime' },+];++const assistantFileWithUrlFields: OutputSchema['fields'] = [+ ...assistantFileFields,+ { key: 'signedUrl', label: 'Download URL', format: 'url' },+];++const assistantOperationFields: OutputSchema['fields'] = [+ { key: 'id', label: 'Operation ID' },+ { key: 'operationType', label: 'Operation Type' },+ { key: 'fileId', label: 'File ID' },+ { key: 'status', label: 'Status' },+ { key: 'percentComplete', label: 'Percent Complete', format: 'number' },+ { key: 'createdOn', label: 'Created On', format: 'datetime' },+];++const assistantFinishedOperationFields: OutputSchema['fields'] = [+ ...assistantOperationFields,+ { key: 'completedOn', label: 'Completed On', format: 'datetime' },+ { key: 'ingestionUnits', label: 'Ingestion Units', format: 'number' },+];++const tokenUsageField: OutputSchema['fields'][number] = {+ key: 'usage',+ label: 'Usage',+ children: [+ { key: 'promptTokens', label: 'Prompt Tokens', format: 'number' },+ { key: 'completionTokens', label: 'Completion Tokens', format: 'number' },+ { key: 'totalTokens', label: 'Total Tokens', format: 'number' },+ ],+};++const messageField: OutputSchema['fields'][number] = {+ key: 'message',+ label: 'Message',+ children: [+ { key: 'role', label: 'Role' },+ { key: 'content', label: 'Content' },+ ],+};++const importFields: OutputSchema['fields'] = [+ { key: 'id', label: 'Import ID' },+ { key: 'uri', label: 'Storage URI' },+ { key: 'status', label: 'Status' },+ { key: 'percentComplete', label: 'Percent Complete', format: 'number' },+ { key: 'recordsImported', label: 'Records Imported', format: 'number' },+ { key: 'error', label: 'Error' },+ { key: 'createdAt', label: 'Created At', format: 'datetime' },+ { key: 'finishedAt', label: 'Finished At', format: 'datetime' },+];++const modelFields: OutputSchema['fields'] = [+ { key: 'model', label: 'Model' },+ { key: 'shortDescription', label: 'Description' },+ { key: 'type', label: 'Type' },+ { key: 'vectorType', label: 'Vector Type' },+ { key: 'defaultDimension', label: 'Default Dimension', format: 'number' },+ { key: 'modality', label: 'Modality' },+ { key: 'maxSequenceLength', label: 'Max Sequence Length', format: 'number' },+ { key: 'maxBatchSize', label: 'Max Batch Size', format: 'number' },+ { key: 'providerName', label: 'Provider' },+ { key: 'supportedDimensions', label: 'Supported Dimensions' },+ { key: 'supportedMetrics', label: 'Supported Metrics' },+ {+ key: 'supportedParameters',+ label: 'Supported Parameters',+ labelKey: 'parameter',+ listItems: [+ { key: 'parameter', label: 'Parameter' },+ { key: 'type', label: 'Type' },+ { key: 'valueType', label: 'Value Type' },+ { key: 'required', label: 'Required', format: 'boolean' },+ { key: 'allowedValues', label: 'Allowed Values' },+ { key: '_default', label: 'Default' },+ { key: 'min', label: 'Min', format: 'number' },+ { key: 'max', label: 'Max', format: 'number' },+ ],+ },+];++const legacyResultFields: OutputSchema['fields'] = [+ { key: 'success', label: 'Success', format: 'boolean' },+ { key: 'error', label: 'Error' },+ { key: 'message', label: 'Message' },+];++export const pineconeListIndexesOutputSchema: OutputSchema = {+ fields: [{ key: 'indexes', label: 'Indexes', labelKey: 'name', listItems: indexFields }],+};++export const pineconeGetIndexOutputSchema: OutputSchema = { fields: indexFields };++export const pineconeCreateIndexOutputSchema: OutputSchema = { fields: indexFields };++export const pineconeCreateIndexForModelOutputSchema: OutputSchema = { fields: indexFields };++export const pineconeConfigureIndexOutputSchema: OutputSchema = { fields: indexFields };++export const pineconeDeleteIndexOutputSchema: OutputSchema = {+ fields: [+ { key: 'deleted', label: 'Deleted', format: 'boolean' },+ { key: 'indexName', label: 'Index Name' },+ ],+};++export const pineconeGetIndexStatsOutputSchema: OutputSchema = {+ fields: [+ {+ key: 'namespaces',+ label: 'Namespaces',+ dynamicKey: true,+ children: [{ key: 'recordCount', label: 'Record Count', format: 'number' }],+ },+ { key: 'dimension', label: 'Dimension', format: 'number' },+ { key: 'indexFullness', label: 'Index Fullness', format: 'number' },+ { key: 'totalRecordCount', label: 'Total Record Count', format: 'number' },+ ],+};++export const pineconeUpsertTextRecordsOutputSchema: OutputSchema = {+ fields: [+ { key: 'upsertedCount', label: 'Upserted Count', format: 'number' },+ { key: 'ids', label: 'IDs' },+ ],+};++export const pineconeFetchVectorsOutputSchema: OutputSchema = {+ fields: [+ {+ key: 'records',+ label: 'Records',+ dynamicKey: true,+ labelKey: 'id',+ children: vectorRecordFields,+ },+ { key: 'namespace', label: 'Namespace' },+ readUsageField,+ ],+};++export const pineconeFetchVectorsByMetadataOutputSchema: OutputSchema = {+ fields: [+ {+ key: 'records',+ label: 'Records',+ dynamicKey: true,+ labelKey: 'id',+ children: vectorRecordFields,+ },+ { key: 'namespace', label: 'Namespace' },+ readUsageField,+ paginationField,+ ],+};++export const pineconeListVectorIdsOutputSchema: OutputSchema = {+ fields: [+ {+ key: 'vectors',+ label: 'Vectors',+ labelKey: 'id',+ listItems: [{ key: 'id', label: 'Vector ID' }],+ },+ { key: 'namespace', label: 'Namespace' },+ readUsageField,+ paginationField,+ ],+};++export const pineconeUpdateVectorOutputSchema: OutputSchema = {+ fields: [+ { key: 'updated', label: 'Updated', format: 'boolean' },+ { key: 'id', label: 'Vector ID' },+ { key: 'filter', label: 'Filter' },+ ],+};++export const pineconeDeleteVectorsOutputSchema: OutputSchema = {+ fields: [+ { key: 'deleted', label: 'Deleted', format: 'boolean' },+ { key: 'mode', label: 'Mode' },+ { key: 'ids', label: 'IDs' },+ { key: 'filter', label: 'Filter' },+ { key: 'namespace', label: 'Namespace' },+ ],+};++export const pineconeQueryVectorsOutputSchema: OutputSchema = {+ fields: [+ { key: 'matches', label: 'Matches', labelKey: 'id', listItems: vectorMatchFields },+ { key: 'namespace', label: 'Namespace' },+ readUsageField,+ ],+};++export const pineconeListNamespacesOutputSchema: OutputSchema = {+ fields: [+ { key: 'namespaces', label: 'Namespaces', labelKey: 'name', listItems: namespaceFields },+ { key: 'totalCount', label: 'Total Count', format: 'number' },+ paginationField,+ ],+};++export const pineconeCreateNamespaceOutputSchema: OutputSchema = { fields: namespaceFields };++export const pineconeGetNamespaceOutputSchema: OutputSchema = { fields: namespaceBaseFields };++export const pineconeDeleteNamespaceOutputSchema: OutputSchema = {+ fields: [+ { key: 'deleted', label: 'Deleted', format: 'boolean' },+ { key: 'namespace', label: 'Namespace' },+ ],+};++export const pineconeListNamespaceAliasesOutputSchema: OutputSchema = {+ fields: [+ {+ key: 'namespace_aliases',+ label: 'Namespace Aliases',+ labelKey: 'name',+ listItems: namespaceAliasFields,+ },+ { key: 'total_count', label: 'Total Count', format: 'number' },+ paginationField,+ ],+};++export const pineconeCreateNamespaceAliasOutputSchema: OutputSchema = {+ fields: namespaceAliasFields,+};++export const pineconeDeleteNamespaceAliasOutputSchema: OutputSchema = {+ fields: [+ { key: 'deleted', label: 'Deleted', format: 'boolean' },+ { key: 'aliasName', label: 'Alias Name' },+ ],+};++export const pineconeUpsertDocumentsOutputSchema: OutputSchema = {+ fields: [{ key: 'upsertedCount', label: 'Upserted Count', format: 'number' }],+};++export const pineconeFetchDocumentsOutputSchema: OutputSchema = {+ fields: [+ {+ key: 'documents',+ label: 'Documents',+ dynamicKey: true,+ labelKey: '_id',+ children: [{ key: '_id', label: 'Document ID' }],+ },+ { key: 'namespace', label: 'Namespace' },+ readUsageField,+ paginationField,+ ],+};++export const pineconeListDocumentsOutputSchema: OutputSchema = {+ fields: [+ {+ key: 'documents',+ label: 'Documents',+ labelKey: '_id',+ listItems: [{ key: '_id', label: 'Document ID' }],+ },+ { key: 'namespace', label: 'Namespace' },+ readUsageField,+ paginationField,+ ],+};++export const pineconeSearchDocumentsOutputSchema: OutputSchema = {+ fields: [+ {+ key: 'matches',+ label: 'Matches',+ labelKey: '_id',+ listItems: [+ { key: '_id', label: 'Document ID' },+ { key: '_score', label: 'Score', format: 'number' },+ { key: 'fields', label: 'Document Fields', value: '', dynamicKey: true },+ ],+ },+ { key: 'namespace', label: 'Namespace' },+ readUsageField,+ ],+};++export const pineconeUpdateDocumentsOutputSchema: OutputSchema = {+ fields: [+ { key: 'updated', label: 'Updated', format: 'boolean' },+ { key: 'ids', label: 'IDs' },+ { key: 'filter', label: 'Filter' },+ { key: 'matchedRecords', label: 'Matched Records', format: 'number' },+ ],+};++export const pineconeDeleteDocumentsOutputSchema: OutputSchema = {+ fields: [+ { key: 'deleted', label: 'Deleted', format: 'boolean' },+ { key: 'mode', label: 'Mode' },+ { key: 'ids', label: 'IDs' },+ { key: 'filter', label: 'Filter' },+ { key: 'namespace', label: 'Namespace' },+ { key: 'matchedRecords', label: 'Matched Records', format: 'number' },+ ],+};++export const pineconeSearchTextRecordsOutputSchema: OutputSchema = {+ fields: [+ {+ key: 'result',+ label: 'Result',+ children: [+ {+ key: 'hits',+ label: 'Hits',+ labelKey: '_id',+ listItems: [+ { key: '_id', label: 'Record ID' },+ { key: '_score', label: 'Score', format: 'number' },+ { key: 'fields', label: 'Fields', dynamicKey: true },+ ],+ },+ ],+ },+ {+ key: 'usage',+ label: 'Usage',+ children: [+ { key: 'readUnits', label: 'Read Units', format: 'number' },+ { key: 'embedTotalTokens', label: 'Embedding Tokens', format: 'number' },+ { key: 'rerankUnits', label: 'Rerank Units', format: 'number' },+ ],+ },+ ],+};++export const pineconeStartImportOutputSchema: OutputSchema = {+ fields: [{ key: 'id', label: 'Import ID' }],+};++export const pineconeListImportsOutputSchema: OutputSchema = {+ fields: [+ { key: 'data', label: 'Imports', labelKey: 'id', listItems: importFields },+ paginationField,+ ],+};++export const pineconeGetImportOutputSchema: OutputSchema = { fields: importFields };++export const pineconeCancelImportOutputSchema: OutputSchema = {+ fields: [+ { key: 'cancelled', label: 'Cancelled', format: 'boolean' },+ { key: 'importId', label: 'Import ID' },+ ],+};++export const pineconeGenerateEmbeddingsOutputSchema: OutputSchema = {+ fields: [+ { key: 'model', label: 'Model' },+ { key: 'vectorType', label: 'Vector Type' },+ {+ key: 'data',+ label: 'Embeddings',+ listItems: [+ { key: 'vectorType', label: 'Vector Type' },+ { key: 'values', label: 'Values' },+ { key: 'sparseIndices', label: 'Sparse Indices' },+ { key: 'sparseValues', label: 'Sparse Values' },+ ],+ },+ {+ key: 'usage',+ label: 'Usage',+ children: [{ key: 'totalTokens', label: 'Total Tokens', format: 'number' }],+ },+ ],+};++export const pineconeRerankDocumentsOutputSchema: OutputSchema = {+ fields: [+ { key: 'model', label: 'Model' },+ {+ key: 'data',+ label: 'Ranked Documents',+ labelKey: 'index',+ listItems: [+ { key: 'index', label: 'Input Position', format: 'number' },+ { key: 'score', label: 'Score', format: 'number' },+ { key: 'document', label: 'Document', dynamicKey: true },+ ],+ },+ {+ key: 'usage',+ label: 'Usage',+ children: [{ key: 'rerankUnits', label: 'Rerank Units', format: 'number' }],+ },+ ],+};++export const pineconeListModelsOutputSchema: OutputSchema = {+ fields: [{ key: 'models', label: 'Models', labelKey: 'model', listItems: modelFields }],+};++export const pineconeGetModelOutputSchema: OutputSchema = { fields: modelFields };++export const pineconeListAssistantsOutputSchema: OutputSchema = {+ fields: [+ { key: 'assistants', label: 'Assistants', labelKey: 'name', listItems: assistantFields },+ ],+};++export const pineconeCreateAssistantOutputSchema: OutputSchema = { fields: assistantFields };++export const pineconeUpdateAssistantOutputSchema: OutputSchema = {+ fields: [+ { key: 'instructions', label: 'Instructions' },+ { key: 'metadata', label: 'Metadata', dynamicKey: true },+ ],+};++export const pineconeDeleteAssistantOutputSchema: OutputSchema = {+ fields: [+ { key: 'deleted', label: 'Deleted', format: 'boolean' },+ { key: 'assistantName', label: 'Assistant Name' },+ ],+};++export const pineconeChatWithAssistantOutputSchema: OutputSchema = {+ fields: [+ { key: 'id', label: 'Response ID' },+ messageField,+ { key: 'finishReason', label: 'Finish Reason' },+ { key: 'model', label: 'Model' },+ {+ key: 'citations',+ label: 'Citations',+ labelKey: 'position',+ listItems: [+ { key: 'position', label: 'Position', format: 'number' },+ {+ key: 'references',+ label: 'References',+ listItems: [+ { key: 'file', label: 'File', children: assistantFileWithUrlFields },+ { key: 'pages', label: 'Pages' },+ {+ key: 'highlight',+ label: 'Highlight',+ children: [+ { key: 'type', label: 'Type' },+ { key: 'content', label: 'Content' },+ ],+ },+ ],+ },+ ],+ },+ { key: 'contextSnippetCount', label: 'Context Snippet Count', format: 'number' },+ { key: 'contentFilterResults', label: 'Content Filter Results' },+ tokenUsageField,+ ],+};++export const pineconeChatCompletionWithAssistantOutputSchema: OutputSchema = {+ fields: [+ { key: 'id', label: 'Response ID' },+ {+ key: 'choices',+ label: 'Choices',+ labelKey: 'index',+ listItems: [+ { key: 'index', label: 'Index', format: 'number' },+ messageField,+ { key: 'finishReason', label: 'Finish Reason' },+ ],+ },+ { key: 'model', label: 'Model' },+ tokenUsageField,+ ],+};++export const pineconeRetrieveAssistantContextOutputSchema: OutputSchema = {+ fields: [+ { key: 'id', label: 'Response ID' },+ {+ key: 'snippets',+ label: 'Snippets',+ listItems: [+ { key: 'type', label: 'Type' },+ { key: 'content', label: 'Content' },+ { key: 'score', label: 'Score', format: 'number' },+ {+ key: 'reference',+ label: 'Reference',+ children: [+ { key: 'type', label: 'Type' },+ { key: 'file', label: 'File', children: assistantFileWithUrlFields },+ ],+ },+ ],+ },+ tokenUsageField,+ ],+};++export const pineconeListAssistantFilesOutputSchema: OutputSchema = {+ fields: [{ key: 'files', label: 'Files', labelKey: 'name', listItems: assistantFileFields }],+};++export const pineconeGetAssistantFileOutputSchema: OutputSchema = {+ fields: assistantFileWithUrlFields,+};++export const pineconeDeleteAssistantFileOutputSchema: OutputSchema = {+ fields: assistantOperationFields,+};++export const pineconeListAssistantOperationsOutputSchema: OutputSchema = {+ fields: [+ {+ key: 'operations',+ label: 'Operations',+ labelKey: 'id',+ listItems: assistantFinishedOperationFields,+ },+ paginationField,+ ],+};++export const pineconeGetAssistantOperationOutputSchema: OutputSchema = {+ fields: assistantFinishedOperationFields,+};++export const createIndexOutputSchema: OutputSchema = {+ fields: [+ { key: 'success', label: 'Success', format: 'boolean' },+ { key: 'message', label: 'Message' },+ { key: 'indexName', label: 'Index Name' },+ { key: 'dimension', label: 'Dimension', format: 'number' },+ { key: 'indexType', label: 'Index Type' },+ {+ key: 'spec',+ label: 'Spec',+ children: [+ {+ key: 'serverless',+ label: 'Serverless',+ children: [+ { key: 'cloud', label: 'Cloud' },+ { key: 'region', label: 'Region' },+ ],+ },+ ],+ },+ { key: 'metric', label: 'Metric' },+ { key: 'vectorType', label: 'Vector Type' },+ { key: 'tags', label: 'Tags', dynamicKey: true },+ { key: 'response', label: 'Index', children: legacyIndexFields },+ ],+};++export const upsertVectorOutputSchema: OutputSchema = {+ fields: [+ ...legacyResultFields,+ { key: 'indexName', label: 'Index Name' },+ { key: 'namespace', label: 'Namespace' },+ { key: 'upsertedCount', label: 'Upserted Count', format: 'number' },+ { key: 'vectorCount', label: 'Vector Count', format: 'number' },+ {+ key: 'vectors',+ label: 'Vectors',+ labelKey: 'id',+ listItems: [+ { key: 'id', label: 'Vector ID' },+ { key: 'dimension', label: 'Dimension', format: 'number' },+ ],+ },+ ],+};++export const updateVectorOutputSchema: OutputSchema = {+ fields: [+ ...legacyResultFields,+ { key: 'indexName', label: 'Index Name' },+ { key: 'namespace', label: 'Namespace' },+ { key: 'vectorId', label: 'Vector ID' },+ {+ key: 'updatedFields',+ label: 'Updated Fields',+ children: [+ { key: 'values', label: 'Values' },+ { key: 'sparseValues', label: 'Sparse Values' },+ { key: 'metadata', label: 'Metadata' },+ ],+ },+ ],+};++export const getVectorOutputSchema: OutputSchema = {+ fields: [+ ...legacyResultFields,+ { key: 'indexName', label: 'Index Name' },+ { key: 'namespace', label: 'Namespace' },+ {+ key: 'vectors',+ label: 'Vectors',+ dynamicKey: true,+ labelKey: 'id',+ children: vectorRecordFields,+ },+ {+ key: 'summary',+ label: 'Summary',+ children: [+ { key: 'requested', label: 'Requested', format: 'number' },+ { key: 'found', label: 'Found', format: 'number' },+ { key: 'foundIds', label: 'Found IDs' },+ ],+ },+ readUsageField,+ { key: 'requestedIds', label: 'Requested IDs' },+ ],+};++export const deleteVectorOutputSchema: OutputSchema = {+ fields: [+ ...legacyResultFields,+ { key: 'indexName', label: 'Index Name' },+ { key: 'namespace', label: 'Namespace' },+ { key: 'deleteMode', label: 'Delete Mode' },+ { key: 'operation', label: 'Operation' },+ { key: 'deletedCount', label: 'Deleted Count', format: 'number' },+ ],+};++export const searchVectorOutputSchema: OutputSchema = {+ fields: [+ ...legacyResultFields,+ { key: 'indexName', label: 'Index Name' },+ { key: 'namespace', label: 'Namespace' },+ { key: 'matches', label: 'Matches', labelKey: 'id', listItems: vectorMatchFields },+ readUsageField,+ {+ key: 'query',+ label: 'Query',+ children: [+ { key: 'topK', label: 'Top K', format: 'number' },+ { key: 'method', label: 'Method' },+ { key: 'queryId', label: 'Query Vector ID' },+ { key: 'vectorDimension', label: 'Vector Dimension', format: 'number' },+ { key: 'filter', label: 'Filter' },+ ],+ },+ {+ key: 'summary',+ label: 'Summary',+ children: [+ { key: 'matchCount', label: 'Match Count', format: 'number' },+ { key: 'topScore', label: 'Top Score', format: 'number' },+ { key: 'readUnits', label: 'Read Units', format: 'number' },+ ],+ },+ ],+};++export const searchIndexOutputSchema: OutputSchema = {+ fields: [+ ...legacyResultFields,+ { key: 'mode', label: 'Mode' },+ { key: 'searchTerm', label: 'Search Term' },+ { key: 'found', label: 'Found', format: 'boolean' },+ { key: 'index', label: 'Index', children: legacyIndexFields },+ { key: 'filter', label: 'Name Filter' },+ { key: 'indexes', label: 'Indexes', labelKey: 'name', listItems: legacyIndexFields },+ { key: 'totalCount', label: 'Total Count', format: 'number' },+ { key: 'filteredCount', label: 'Filtered Count', format: 'number' },+ {+ key: 'summary',+ label: 'Summary',+ children: [+ { key: 'total', label: 'Total', format: 'number' },+ { key: 'returned', label: 'Returned', format: 'number' },+ { key: 'filtered', label: 'Filtered', format: 'boolean' },+ ],+ },+ ],+};