mirror of
https://github.com/hwchase17/langchain.git
synced 2026-06-09 10:17:00 +00:00
@@ -0,0 +1 @@
|
||||
"""Exa integration tests."""
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
"""Test that the integration tests compile."""
|
||||
|
||||
import pytest # type: ignore[import-not-found, import-not-found]
|
||||
|
||||
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
"""Integration tests for Exa find similar tool."""
|
||||
|
||||
from langchain_exa import (
|
||||
ExaFindSimilarResults, # type: ignore[import-not-found, import-not-found]
|
||||
)
|
||||
|
||||
|
||||
def test_similarity_tool() -> None:
|
||||
"""Test that the Exa find similar tool works."""
|
||||
tool = ExaFindSimilarResults()
|
||||
res = tool.invoke(
|
||||
{
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
"""Integration tests for `ExaSearchRetriever`."""
|
||||
|
||||
from langchain_core.documents import (
|
||||
Document, # type: ignore[import-not-found, import-not-found]
|
||||
)
|
||||
@@ -6,6 +8,7 @@ from langchain_exa import ExaSearchRetriever
|
||||
|
||||
|
||||
def test_exa_retriever() -> None:
|
||||
"""Test basic functionality of the `ExaSearchRetriever`."""
|
||||
retriever = ExaSearchRetriever()
|
||||
res = retriever.invoke("best time to visit japan")
|
||||
print(res) # noqa: T201
|
||||
@@ -15,6 +18,7 @@ def test_exa_retriever() -> None:
|
||||
|
||||
|
||||
def test_exa_retriever_highlights() -> None:
|
||||
"""Test highlights feature of the `ExaSearchRetriever`."""
|
||||
retriever = ExaSearchRetriever(highlights=True)
|
||||
res = retriever.invoke("best time to visit japan")
|
||||
print(res) # noqa: T201
|
||||
@@ -29,6 +33,7 @@ def test_exa_retriever_highlights() -> None:
|
||||
|
||||
|
||||
def test_exa_retriever_advanced_features() -> None:
|
||||
"""Test advanced features of the `ExaSearchRetriever`."""
|
||||
retriever = ExaSearchRetriever(
|
||||
k=3, text_contents_options={"max_characters": 1000}, summary=True, type="auto"
|
||||
)
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
"""Integration tests for Exa search tool."""
|
||||
|
||||
from langchain_exa import (
|
||||
ExaSearchResults, # type: ignore[import-not-found, import-not-found]
|
||||
)
|
||||
|
||||
|
||||
def test_search_tool() -> None:
|
||||
"""Test that the Exa search tool works."""
|
||||
tool = ExaSearchResults()
|
||||
res = tool.invoke({"query": "best time to visit japan", "num_results": 5})
|
||||
print(res) # noqa: T201
|
||||
@@ -11,6 +14,7 @@ def test_search_tool() -> None:
|
||||
|
||||
|
||||
def test_search_tool_advanced_features() -> None:
|
||||
"""Test advanced features of the Exa search tool."""
|
||||
tool = ExaSearchResults()
|
||||
res = tool.invoke(
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user