Skip to content

Use config.embedding_dimensions (if specified) in the RedisVectorStore instead of embedding dummy text. #35

Closed
@AlirezaRoshanzamir

Description

Thank you for your excellent library.

Making API calls or performing time-consuming tasks during module import or class initialization is a bad idea. You've already considered this by providing the embedding_dimensions argument and using a dummy embedding as a fallback method:

if self.config.embedding_dimensions is None:
self.config.embedding_dimensions = len(
self._embeddings.embed_query(
"The quick brown fox jumps over the lazy dog"
)
)

However, a few lines later, you didn't use the provided variable and embedded dummy text again:

"attrs": {
"dims": len(
self._embeddings.embed_query(
"The quick brown fox jumps over the lazy dog"
)
),
"distance_metric": self.config.distance_metric,
"algorithm": self.config.indexing_algorithm,
"datatype": self.config.vector_datatype,
},

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions