We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
strategy design pattern
Rough example:
from abc import ABC class EmbeddingsBase(ABC): def find_similar_embeddings(self, query_params): query = ( select( Embedding, Embedding.embedding.cosine_distance(query_params).label("distance"), ) .where(Embedding.embedding.cosine_distance(query_params) < similarity_threshold) .order_by("distance") .limit(10) ) return connection.execute(query).fetchall() def x(self): return NotImplemented class EmbeddingsOpenAI(EmbeddingsBase): def x(self): self.find_similar_embeddings("A") return "O" class EmbeddingsOllamaAPI(EmbeddingsBase): def x(self): return "A" class EmbeddingsOllamaLocal(EmbeddingsBase): def __init__(self, **kwargs): print(kwargs) def x(self): return "MA" class Embeddings: def __init__(self, embeddings, **kwargs): self.embeddings = embeddings(**kwargs) def x(self): return self.embeddings.x() Embeddings(embeddings=EmbeddingsOllamaLocal, foo="lama").x()
The text was updated successfully, but these errors were encountered:
jfrverdasca
No branches or pull requests
strategy design pattern
Rough example:
The text was updated successfully, but these errors were encountered: