mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-27 06:18:05 +00:00
community[patch]: fix main unit tests (#26189)
This commit is contained in:
@@ -15,12 +15,7 @@ from langchain_community.utilities.vertexai import get_client_info
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from google.api_core.client_options import ClientOptions
|
||||
from google.cloud.discoveryengine_v1beta import (
|
||||
ConversationalSearchServiceClient,
|
||||
SearchRequest,
|
||||
SearchResult,
|
||||
SearchServiceClient,
|
||||
)
|
||||
from google.cloud.discoveryengine_v1beta import SearchRequest, SearchResult
|
||||
|
||||
|
||||
class _BaseGoogleVertexAISearchRetriever(BaseModel):
|
||||
@@ -243,7 +238,8 @@ class GoogleVertexAISearchRetriever(BaseRetriever, _BaseGoogleVertexAISearchRetr
|
||||
Search will be based on the corrected query if found.
|
||||
"""
|
||||
|
||||
_client: SearchServiceClient
|
||||
# type is SearchServiceClient but can't be set due to optional imports
|
||||
_client: Any
|
||||
_serving_config: str
|
||||
|
||||
model_config = ConfigDict(
|
||||
@@ -408,7 +404,8 @@ class GoogleVertexAIMultiTurnSearchRetriever(
|
||||
conversation_id: str = "-"
|
||||
"""Vertex AI Search Conversation ID."""
|
||||
|
||||
_client: ConversationalSearchServiceClient
|
||||
# type is ConversationalSearchServiceClient but can't be set due to optional imports
|
||||
_client: Any
|
||||
_serving_config: str
|
||||
|
||||
model_config = ConfigDict(
|
||||
|
@@ -65,6 +65,9 @@ markers = [
|
||||
"compile: mark placeholder test used to compile integration tests without running them",
|
||||
]
|
||||
asyncio_mode = "auto"
|
||||
filterwarnings = [
|
||||
"ignore::langchain_core._api.deprecation.LangChainDeprecationWarning:test",
|
||||
]
|
||||
|
||||
[tool.poetry.group.test]
|
||||
optional = true
|
||||
|
@@ -120,6 +120,11 @@ def test_serializable_mapping() -> None:
|
||||
"bedrock",
|
||||
"ChatBedrock",
|
||||
),
|
||||
("langchain_google_genai", "chat_models", "ChatGoogleGenerativeAI"): (
|
||||
"langchain_google_genai",
|
||||
"chat_models",
|
||||
"ChatGoogleGenerativeAI",
|
||||
),
|
||||
}
|
||||
serializable_modules = import_all_modules("langchain")
|
||||
|
||||
|
@@ -93,6 +93,9 @@ def test_test_group_dependencies(poetry_conf: Mapping[str, Any]) -> None:
|
||||
"responses",
|
||||
"syrupy",
|
||||
"requests-mock",
|
||||
# TODO: Hack to get around cffi 1.17.1 not working with py3.9, remove when
|
||||
# fix is released.
|
||||
"cffi",
|
||||
]
|
||||
)
|
||||
|
||||
|
Reference in New Issue
Block a user