Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify the Embedder return type #21

Merged
merged 1 commit into from
Apr 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/neo4j_genai/embedder.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,18 @@
# limitations under the License.

from abc import ABC, abstractmethod
from .types import EmbeddingVector


class Embedder(ABC):
"""Interface for embedding models."""

@abstractmethod
def embed_query(self, text: str) -> EmbeddingVector:
def embed_query(self, text: str) -> list[float]:
"""Embed query text.

Args:
text (str): Text to convert to vector embedding

Returns:
EmbeddingVector: A vector embedding.
list[float]: A vector embedding.
"""
4 changes: 0 additions & 4 deletions src/neo4j_genai/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@ class VectorSearchRecord(BaseModel):
score: float


class EmbeddingVector(BaseModel):
vector: list[float]


class IndexModel(BaseModel):
driver: Any

Expand Down