-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest_langchain_integration_tests.py
More file actions
42 lines (34 loc) · 1.15 KB
/
test_langchain_integration_tests.py
File metadata and controls
42 lines (34 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
from typing import Any, Literal
import pytest
from langchain_tests.integration_tests import RetrieversIntegrationTests
from langchain_vectorize import VectorizeRetriever
class TestVectorizeRetrieverIntegration(RetrieversIntegrationTests):
@pytest.fixture(autouse=True)
def setup(
self,
environment: Literal["prod", "dev", "local", "staging"],
api_token: str,
org_id: str,
pipeline_id: str,
) -> None:
self._environment = environment
self._api_token = api_token
self._org_id = org_id
self._pipeline_id = pipeline_id
@property
def retriever_constructor(self) -> type[VectorizeRetriever]:
return VectorizeRetriever
@property
def retriever_constructor_params(self) -> dict[str, Any]:
return {
"environment": self._environment,
"api_token": self._api_token,
"organization": self._org_id,
"pipeline_id": self._pipeline_id,
}
@property
def retriever_query_example(self) -> str:
return "What are you?"
@property
def num_results_arg_name(self) -> str:
return "num_results"