class_docstr: Interact with Pinecone. This hook uses the Pinecone conn_id.
  
  :param conn_id: Optional, default connection id is `pinecone_default`. The connection id to use when
      connecting to Pinecone.
class_docstr_tok: ["Interact","with","Pinecone",".","This","hook","uses","the","Pinecone","conn_id",".",":","param","conn_id",":","Optional",",","default","connection","id","is","`","pinecone_default","`",".","The","connection","id","to","use","when","connecting","to","Pinecone","."]
docstr: The Query operation searches a namespace, using a query vector.
  
  It retrieves the ids of the most similar items in a namespace, along with their similarity scores.
  API reference: https://docs.pinecone.io/reference/query
  
  :param index_name: The name of the index to query.
  :param vector: The query vector.
  :param query_id: The unique ID of the vector to be used as a query vector.
  :param top_k: The number of results to return.
  :param namespace: The namespace to fetch vectors from. If not specified, the default namespace is used.
  :param query_filter: The filter to apply. See https://www.pinecone.io/docs/metadata-filtering/
  :param include_values: Whether to include the vector values in the result.
  :param include_metadata: Indicates whether metadata is included in the response as well as the ids.
  :param sparse_vector: sparse values of the query vector. Expected to be either a SparseValues object or a dict
   of the form: {'indices': List[int], 'values': List[float]}, where the lists each have the same length.
docstr_tok: ["The","Query","operation","searches","a","namespace",",","using","a","query","vector",".","It","retrieves","the","ids","of","the","most","similar","items","in","a","namespace",",","along","with","their","similarity","scores",".","API","reference",":","https",":","\/\/docs.pinecone.io\/reference\/query",":","param","index_name",":","The","name","of","the","index","to","query",".",":","param","vector",":","The","query","vector",".",":","param","query_id",":","The","unique","ID","of","the","vector","to","be","used","as","a","query","vector",".",":","param","top_k",":","The","number","of","results","to","return",".",":","param","namespace",":","The","namespace","to","fetch","vectors","from",".","If","not","specified",",","the","default","namespace","is","used",".",":","param","query_filter",":","The","filter","to","apply",".","See","https",":","\/\/www.pinecone.io\/docs\/metadata-filtering\/",":","param","include_values",":","Whether","to","include","the","vector","values","in","the","result",".",":","param","include_metadata",":","Indicates","whether","metadata","is","included","in","the","response","as","well","as","the","ids",".",":","param","sparse_vector",":","sparse","values","of","the","query","vector",".","Expected","to","be","either","a","SparseValues","object","or","a","dict","of","the","form",":","{","'indices","'",":","List","[","int","]",",","'values","'",":","List","[","float","]","}",",","where","the","lists","each","have","the","same","length","."]
code: def query_vector(
      index_name: str,
      vector: list[Any],
      query_id: str | None = None,
      top_k: int = 10,
      namespace: str | None = None,
      query_filter: dict[
          str, str | float | int | bool | list[Any] | dict[Any, Any]
      ]
      | None = None,
      include_values: bool | None = None,
      include_metadata: bool | None = None,
      sparse_vector: SparseValues
      | dict[str, list[float] | list[int]]
      | None = None,
  ) -> QueryResponse:
      """
      The Query operation searches a namespace, using a query vector.
  
      It retrieves the ids of the most similar items in a namespace, along with their similarity scores.
      API reference: https://docs.pinecone.io/reference/query
  
      :param index_name: The name of the index to query.
      :param vector: The query vector.
      :param query_id: The unique ID of the vector to be used as a query vector.
      :param top_k: The number of results to return.
      :param namespace: The namespace to fetch vectors from. If not specified, the default namespace is used.
      :param query_filter: The filter to apply. See https://www.pinecone.io/docs/metadata-filtering/
      :param include_values: Whether to include the vector values in the result.
      :param include_metadata: Indicates whether metadata is included in the response as well as the ids.
      :param sparse_vector: sparse values of the query vector. Expected to be either a SparseValues object or a dict
       of the form: {'indices': List[int], 'values': List[float]}, where the lists each have the same length.
      """
      index = pinecone.Index(index_name)
      return index.query(
          vector=vector,
          id=query_id,
          top_k=top_k,
          namespace=namespace,
          filter=query_filter,
          include_values=include_values,
          include_metadata=include_metadata,
          sparse_vector=sparse_vector,
      )
  
imports: from __future__ import annotations
  import itertools
  from typing import TYPE_CHECKING, Any
  import pinecone
  from airflow.hooks.base import BaseHook
label_desc: Use image node_id 16 for calling the PineconeHook obj's underlying member method code with example usage: obj.query_vector(index_name, vector, query_id, top_k, namespace, query_filter, include_values, include_metadata, sparse_vector) and returns: index