/**
 * Weaviate Vector Store Node - Version 1.3
 * Discriminator: mode=retrieve
 */


interface Credentials {
  weaviateApi: CredentialReference;
}

/** Retrieve documents from vector store to be used as vector store with AI nodes */
export type LcVectorStoreWeaviateV13RetrieveParams = {
  /**
   * 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';
  weaviateCollection?: { __rl: true; mode: 'list' | 'id'; value: string; cachedResultName?: string };
/**
 * Whether or not to rerank results
 * @default false
 */
    useReranker?: boolean | Expression<boolean>;
/**
 * Options
 * @default {}
 */
    options?: {
    /** Filter pageContent or metadata using this &lt;a href="https://weaviate.io/" target="_blank"&gt;filtering syntax&lt;/a&gt;
     */
    searchFilterJson?: IDataObject | string | Expression<string>;
    /** Select the metadata to retrieve along the content
     * @default source,page
     */
    metadataKeys?: string | Expression<string>;
    /** Provide a query text to combine vector search with a keyword/text search
     */
    hybridQuery?: string | Expression<string>;
    /** Whether to show the score fused between hybrid and vector search explanation
     * @default false
     */
    hybridExplainScore?: boolean | Expression<boolean>;
    /** Select the fusion type for combining vector and keyword search results
     * @default RelativeScore
     */
    fusionType?: 'RelativeScore' | 'Ranked' | Expression<string>;
    /** Limit result groups by detecting sudden jumps in score
     */
    autoCutLimit?: number | Expression<number>;
    /** Change the relative weights of the keyword and vector components. 1.0 = pure vector, 0.0 = pure keyword.
     * @default 0.5
     */
    alpha?: number | Expression<number>;
    /** Comma-separated list of properties to include in the query with optionally weighted values, e.g., "question^2,answer"
     */
    queryProperties?: string | Expression<string>;
    /** Set the maximum allowable distance for the vector search component
     */
    maxVectorDistance?: number | Expression<number>;
    /** Tenant Name. Collection must have been created with tenant support enabled.
     */
    tenant?: string | Expression<string>;
    /** The key in the document that contains the embedded text
     * @default text
     */
    textKey?: string | Expression<string>;
    /** Whether to skip init checks while instantiating the client
     * @default false
     */
    skip_init_checks?: boolean | Expression<boolean>;
    /** Number of timeout seconds for initial checks
     * @default 2
     */
    timeout_init?: number | Expression<number>;
    /** Number of timeout seconds for inserts
     * @default 90
     */
    timeout_insert?: number | Expression<number>;
    /** Number of timeout seconds for queries
     * @default 30
     */
    timeout_query?: number | Expression<number>;
    /** Proxy to use for GRPC
     */
    proxy_grpc?: string | Expression<string>;
  };
};

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

export type LcVectorStoreWeaviateV13RetrieveNode = {
  type: '@n8n/n8n-nodes-langchain.vectorStoreWeaviate';
  version: 1.3;
  credentials?: Credentials;
  config: NodeConfig<LcVectorStoreWeaviateV13RetrieveParams> & { subnodes: LcVectorStoreWeaviateV13RetrieveSubnodeConfig };
};