mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-01 11:02:37 +00:00
cli[patch]: add embedding to integration template (#14881)
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
"""Test __ModuleName__ embeddings."""
|
||||
from __module_name__.embeddings import __ModuleName__Embeddings
|
||||
|
||||
|
||||
def test___module_name___embedding_documents() -> None:
|
||||
"""Test cohere embeddings."""
|
||||
documents = ["foo bar"]
|
||||
embedding = __ModuleName__Embeddings()
|
||||
output = embedding.embed_documents(documents)
|
||||
assert len(output) == 1
|
||||
assert len(output[0]) > 0
|
||||
|
||||
|
||||
def test___module_name___embedding_query() -> None:
|
||||
"""Test cohere embeddings."""
|
||||
document = "foo bar"
|
||||
embedding = __ModuleName__Embeddings()
|
||||
output = embedding.embed_query(document)
|
||||
assert len(output) > 0
|
@@ -0,0 +1,9 @@
|
||||
"""Test embedding model integration."""
|
||||
|
||||
|
||||
from __module_name__.embeddings import __ModuleName__Embeddings
|
||||
|
||||
|
||||
def test_initialization() -> None:
|
||||
"""Test embedding model initialization."""
|
||||
__ModuleName__Embeddings()
|
@@ -1,6 +1,11 @@
|
||||
from __module_name__ import __all__
|
||||
|
||||
EXPECTED_ALL = ["__ModuleName__LLM", "Chat__ModuleName__", "__ModuleName__VectorStore"]
|
||||
EXPECTED_ALL = [
|
||||
"__ModuleName__LLM",
|
||||
"Chat__ModuleName__",
|
||||
"__ModuleName__VectorStore",
|
||||
"__ModuleName__Embeddings",
|
||||
]
|
||||
|
||||
|
||||
def test_all_imports() -> None:
|
||||
|
Reference in New Issue
Block a user