deep – set to True to make a deep copy of the model
Returns
new model instance
classmethod create(elasticsearch_url: str, index_name: str, k1: float = 2.0, b: float = 0.75) → ElasticSearchBM25Retriever[source]¶
Create a ElasticSearchBM25Retriever from a list of texts.
Parameters
elasticsearch_url – URL of the Elasticsearch instance to connect to.
index_name – Name of the index to use in Elasticsearch.
k1 – BM25 parameter k1.
b – BM25 parameter b.
Returns:
dict(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False) → DictStrAny¶
Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.
classmethod from_orm(obj: Any) → Model¶
classmethod get_lc_namespace() → List[str]¶
Get the namespace of the langchain object.
For example, if the class is langchain.llms.openai.OpenAI, then the
namespace is [“langchain”, “llms”, “openai”]
get_relevant_documents(query: str, *, callbacks: Callbacks = None, tags: Optional[List[str]] = None, metadata: Optional[Dict[str, Any]] = None, run_name: Optional[str] = None, **kwargs: Any) → List[Document]¶
Retrieve documents relevant to a query.
:param query: string to find relevant documents for
:param callbacks: Callback manager or list of callbacks