mirror of
https://github.com/hwchase17/langchain
synced 2024-11-18 09:25:54 +00:00
Harrison/typesense fix (#6391)
Co-authored-by: Gaurav Chauhan <2796gaurav@gmail.com> Co-authored-by: gaurav <gaurav.chauhan1@rksv.in>
This commit is contained in:
parent
5ccebce777
commit
5c1fa3e70e
@ -42,10 +42,10 @@ class Typesense(VectorStore):
|
||||
|
||||
embedding = OpenAIEmbeddings()
|
||||
vectorstore = Typesense(
|
||||
typesense_client,
|
||||
typesense_collection_name,
|
||||
embedding.embed_query,
|
||||
"text",
|
||||
typesense_client=typesense_client,
|
||||
embedding=embedding,
|
||||
typesense_collection_name=typesense_collection_name,
|
||||
text_key="text",
|
||||
)
|
||||
"""
|
||||
|
||||
@ -138,14 +138,15 @@ class Typesense(VectorStore):
|
||||
def similarity_search_with_score(
|
||||
self,
|
||||
query: str,
|
||||
k: int = 4,
|
||||
k: int = 10,
|
||||
filter: Optional[str] = "",
|
||||
) -> List[Tuple[Document, float]]:
|
||||
"""Return typesense documents most similar to query, along with scores.
|
||||
|
||||
Args:
|
||||
query: Text to look up documents similar to.
|
||||
k: Number of Documents to return. Defaults to 4.
|
||||
k: Number of Documents to return. Defaults to 10.
|
||||
Minimum 10 results would be returned.
|
||||
filter: typesense filter_by expression to filter documents on
|
||||
|
||||
Returns:
|
||||
@ -173,7 +174,7 @@ class Typesense(VectorStore):
|
||||
def similarity_search(
|
||||
self,
|
||||
query: str,
|
||||
k: int = 4,
|
||||
k: int = 10,
|
||||
filter: Optional[str] = "",
|
||||
**kwargs: Any,
|
||||
) -> List[Document]:
|
||||
@ -181,7 +182,8 @@ class Typesense(VectorStore):
|
||||
|
||||
Args:
|
||||
query: Text to look up documents similar to.
|
||||
k: Number of Documents to return. Defaults to 4.
|
||||
k: Number of Documents to return. Defaults to 10.
|
||||
Minimum 10 results would be returned.
|
||||
filter: typesense filter_by expression to filter documents on
|
||||
|
||||
Returns:
|
||||
|
Loading…
Reference in New Issue
Block a user