mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-02 19:47:13 +00:00
tests[patch]: run standard tests for embeddings and populate embeddings API ref (#28545)
plus minor updates to chat models and vector store API refs
This commit is contained in:
26
libs/standard-tests/tests/unit_tests/test_embeddings.py
Normal file
26
libs/standard-tests/tests/unit_tests/test_embeddings.py
Normal file
@@ -0,0 +1,26 @@
|
||||
from typing import Type
|
||||
|
||||
from langchain_core.embeddings import DeterministicFakeEmbedding, Embeddings
|
||||
|
||||
from langchain_tests.integration_tests import EmbeddingsIntegrationTests
|
||||
from langchain_tests.unit_tests import EmbeddingsUnitTests
|
||||
|
||||
|
||||
class TestFakeEmbeddingsUnit(EmbeddingsUnitTests):
|
||||
@property
|
||||
def embeddings_class(self) -> Type[Embeddings]:
|
||||
return DeterministicFakeEmbedding
|
||||
|
||||
@property
|
||||
def embedding_model_params(self) -> dict:
|
||||
return {"size": 6} # embedding dimension
|
||||
|
||||
|
||||
class TestFakeEmbeddingsIntegration(EmbeddingsIntegrationTests):
|
||||
@property
|
||||
def embeddings_class(self) -> Type[Embeddings]:
|
||||
return DeterministicFakeEmbedding
|
||||
|
||||
@property
|
||||
def embedding_model_params(self) -> dict:
|
||||
return {"size": 6}
|
Reference in New Issue
Block a user