mirror of
https://github.com/hwchase17/langchain.git
synced 2026-03-18 11:07:36 +00:00
rename
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
"""Fake Embedding class for testing purposes."""
|
||||
from typing import List
|
||||
|
||||
from langchain.embeddings.base import Embeddings
|
||||
from langchain.embeddings.base import EmbeddingModel
|
||||
|
||||
fake_texts = ["foo", "bar", "baz"]
|
||||
|
||||
|
||||
class FakeEmbeddings(Embeddings):
|
||||
class FakeEmbeddings(EmbeddingModel):
|
||||
"""Fake embeddings functionality for testing."""
|
||||
|
||||
def embed_documents(self, texts: List[str]) -> List[List[float]]:
|
||||
|
||||
@@ -4,7 +4,7 @@ from typing import Callable, Optional
|
||||
import pytest
|
||||
|
||||
from langchain.docstore.document import Document
|
||||
from langchain.embeddings.base import Embeddings
|
||||
from langchain.embeddings.base import EmbeddingModel
|
||||
from langchain.vectorstores import Qdrant
|
||||
from tests.integration_tests.vectorstores.fake_embeddings import FakeEmbeddings
|
||||
|
||||
@@ -139,7 +139,7 @@ def test_qdrant_max_marginal_relevance_search(
|
||||
],
|
||||
)
|
||||
def test_qdrant_embedding_interface(
|
||||
embeddings: Optional[Embeddings], embedding_function: Optional[Callable]
|
||||
embeddings: Optional[EmbeddingModel], embedding_function: Optional[Callable]
|
||||
) -> None:
|
||||
from qdrant_client import QdrantClient
|
||||
|
||||
@@ -162,7 +162,7 @@ def test_qdrant_embedding_interface(
|
||||
],
|
||||
)
|
||||
def test_qdrant_embedding_interface_raises(
|
||||
embeddings: Optional[Embeddings], embedding_function: Optional[Callable]
|
||||
embeddings: Optional[EmbeddingModel], embedding_function: Optional[Callable]
|
||||
) -> None:
|
||||
from qdrant_client import QdrantClient
|
||||
|
||||
|
||||
@@ -9,12 +9,12 @@ from langchain.callbacks.manager import (
|
||||
)
|
||||
from langchain.chains.hyde.base import HypotheticalDocumentEmbedder
|
||||
from langchain.chains.hyde.prompts import PROMPT_MAP
|
||||
from langchain.embeddings.base import Embeddings
|
||||
from langchain.embeddings.base import EmbeddingModel
|
||||
from langchain.llms.base import BaseLLM
|
||||
from langchain.schema import Generation, LLMResult
|
||||
|
||||
|
||||
class FakeEmbeddings(Embeddings):
|
||||
class FakeEmbeddings(EmbeddingModel):
|
||||
"""Fake embedding class for tests."""
|
||||
|
||||
def embed_documents(self, texts: List[str]) -> List[List[float]]:
|
||||
|
||||
@@ -5,7 +5,7 @@ from typing import Any, Iterable, List, Optional, Tuple, Type
|
||||
|
||||
import pytest
|
||||
|
||||
from langchain.embeddings.base import Embeddings
|
||||
from langchain.embeddings.base import EmbeddingModel
|
||||
from langchain.retrievers.time_weighted_retriever import (
|
||||
TimeWeightedVectorStoreRetriever,
|
||||
_get_hours_passed,
|
||||
@@ -67,7 +67,7 @@ class MockVectorStore(VectorStore):
|
||||
def from_documents(
|
||||
cls: Type["MockVectorStore"],
|
||||
documents: List[Document],
|
||||
embedding: Embeddings,
|
||||
embedding: EmbeddingModel,
|
||||
**kwargs: Any,
|
||||
) -> "MockVectorStore":
|
||||
"""Return VectorStore initialized from documents and embeddings."""
|
||||
@@ -79,7 +79,7 @@ class MockVectorStore(VectorStore):
|
||||
def from_texts(
|
||||
cls: Type["MockVectorStore"],
|
||||
texts: List[str],
|
||||
embedding: Embeddings,
|
||||
embedding: EmbeddingModel,
|
||||
metadatas: Optional[List[dict]] = None,
|
||||
**kwargs: Any,
|
||||
) -> "MockVectorStore":
|
||||
|
||||
Reference in New Issue
Block a user