/**
 * Pinecone Vector Store Node - Version 1
 * Discriminator: mode=retrieve
 */


interface Credentials {
  pineconeApi: CredentialReference;
}

/** Retrieve documents from vector store to be used as vector store with AI nodes */
export type LcVectorStorePineconeV1RetrieveParams = {
  /**
   * Exposes the store as an `ai_vectorStore` subnode for another node (e.g. `toolVectorStore`). Declare with `vectorStore({...})`. Required subnodes: `embedding`. For RAG with an AI Agent directly, prefer `mode: 'retrieve-as-tool'`.
   * <patterns>
   * <pattern title="retrieve mode — feed another node as a subnode (generic)">
   * // Substitute the type literal and provider-specific parameters — see the rest of this file.
   * const store = vectorStore({
   *   type: '@n8n/n8n-nodes-langchain.vectorStoreXxx',
   *   config: {
   *     name: 'Knowledge Base',
   *     parameters: { mode: 'retrieve' /* + provider-specific parameters *\/ },
   *     subnodes: { embedding: embeddingsOpenAi }
   *   }
   * });
   * 
   * const retrieverTool = tool({
   *   type: '@n8n/n8n-nodes-langchain.toolVectorStore',
   *   config: {
   *     name: 'KB Retriever',
   *     parameters: { description: 'Search the product knowledge base' },
   *     subnodes: { vectorStore: store, model: openAiModel }
   *   }
   * });
   * </pattern>
   * </patterns>
   */
  mode: 'retrieve';
  pineconeIndex?: { __rl: true; mode: 'list' | 'id'; value: string; cachedResultName?: string };
/**
 * Whether or not to rerank results
 * @default false
 */
    useReranker?: boolean | Expression<boolean>;
/**
 * Options
 * @default {}
 */
    options?: {
    /** Partition the records in an index into namespaces. Queries and other operations are then limited to one namespace, so different requests can search different subsets of your index.
     */
    pineconeNamespace?: string | Expression<string>;
    /** Metadata to filter the document by
     * @default {}
     */
    metadata?: {
        /** Fields to Set
     */
    metadataValues?: Array<{
      /** Name
       */
      name?: string | Expression<string>;
      /** Value
       */
      value?: string | Expression<string>;
    }>;
  };
  };
};

export interface LcVectorStorePineconeV1RetrieveSubnodeConfig {
  embedding: EmbeddingInstance | EmbeddingInstance[];
  /**
   * @displayOptions.show { useReranker: [true] }
   */
  reranker: RerankerInstance;
}

export type LcVectorStorePineconeV1RetrieveNode = {
  type: '@n8n/n8n-nodes-langchain.vectorStorePinecone';
  version: 1;
  config: NodeConfig<LcVectorStorePineconeV1RetrieveParams> & { credentials?: Credentials } & { subnodes: LcVectorStorePineconeV1RetrieveSubnodeConfig };
};