mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-05-03 16:22:49 +00:00
fix: add missing name() method to WatsonEmbeddingFunction
Fixes #3597 - ChromaDB expects embedding functions to have a name() method for validation. Added static method that returns 'watson' following the same pattern as other embedding functions. - Added comprehensive tests to verify the fix - Ensures compatibility with ChromaDB validation requirements - No regressions in existing Watson embedding functionality Co-Authored-By: João <joao@crewai.com>
This commit is contained in:
@@ -152,3 +152,8 @@ class WatsonEmbeddingFunction(EmbeddingFunction[Documents]):
|
||||
except Exception as e:
|
||||
print(f"Error during Watson embedding: {e}")
|
||||
raise
|
||||
|
||||
@staticmethod
|
||||
def name() -> str:
|
||||
"""Return the name identifier for this embedding function."""
|
||||
return "watson"
|
||||
|
||||
Reference in New Issue
Block a user