Skip to content

Commit

Permalink
astradb[patch]: prep for langchain-core 0.3 (#68)
Browse files Browse the repository at this point in the history
  • Loading branch information
baskaryan authored Sep 5, 2024
1 parent 3bc483a commit ffc925d
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions libs/astradb/tests/integration_tests/test_caches.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
from langchain_core.globals import get_llm_cache, set_llm_cache
from langchain_core.language_models import LLM
from langchain_core.outputs import Generation, LLMResult
from langchain_core.pydantic_v1 import validator
from typing_extensions import override

from langchain_astradb import AstraDBCache, AstraDBSemanticCache
Expand Down Expand Up @@ -69,15 +68,6 @@ class FakeLLM(LLM):
sequential_responses: Optional[bool] = False # noqa: UP007
response_index: int = 0

@validator("queries", always=True)
def check_queries_required(
cls, queries: Mapping | None, values: Mapping[str, Any]
) -> Mapping | None:
if values.get("sequential_response") and not queries:
msg = "queries is required when sequential_response is set to True"
raise ValueError(msg)
return queries

@override
def get_num_tokens(self, text: str) -> int:
"""Return number of tokens."""
Expand Down

0 comments on commit ffc925d

Please sign in to comment.