mirror of
https://github.com/hwchase17/langchain.git
synced 2025-08-08 20:41:52 +00:00
25 lines
714 B
Python
25 lines
714 B
Python
"""Integration test for Kay.ai API Wrapper."""
|
|
|
|
import pytest
|
|
from langchain_core.documents import Document
|
|
|
|
from langchain_community.retrievers import KayAiRetriever
|
|
|
|
|
|
@pytest.mark.requires("kay")
|
|
def test_kay_retriever() -> None:
|
|
retriever = KayAiRetriever.create(
|
|
dataset_id="company",
|
|
data_types=["10-K", "10-Q", "8-K", "PressRelease"],
|
|
num_contexts=3,
|
|
)
|
|
docs = retriever.invoke(
|
|
"What were the biggest strategy changes and partnerships made by Roku in 2023?",
|
|
)
|
|
assert len(docs) == 3
|
|
for doc in docs:
|
|
assert isinstance(doc, Document)
|
|
assert doc.page_content
|
|
assert doc.metadata
|
|
assert len(list(doc.metadata.items())) > 0
|