Skip to content
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
2 changes: 2 additions & 0 deletions hindsight-api/hindsight_api/engine/embeddings.py
Original file line number Diff line number Diff line change
Expand Up @@ -794,6 +794,7 @@ async def initialize(self) -> None:
"model": self.model,
"input": ["test"],
"api_key": self.api_key,
"encoding_format": "float",
}
if self.api_base:
embed_kwargs["api_base"] = self.api_base
Expand Down Expand Up @@ -840,6 +841,7 @@ def encode(self, texts: list[str]) -> list[list[float]]:
"model": self.model,
"input": batch,
"api_key": self.api_key,
"encoding_format": "float",
}
if self.api_base:
embed_kwargs["api_base"] = self.api_base
Expand Down
2 changes: 2 additions & 0 deletions hindsight-api/tests/test_litellm_sdk_embeddings.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ async def test_initialization_success(self, mock_litellm):
model="cohere/embed-english-v3.0",
input=["test"],
api_key="test_key",
encoding_format="float",
)

async def test_initialization_missing_package(self):
Expand Down Expand Up @@ -137,6 +138,7 @@ async def test_encode_single_text(self, embeddings, mock_litellm):
model="cohere/embed-english-v3.0",
input=["Hello world"],
api_key="test_key",
encoding_format="float",
)

async def test_encode_multiple_texts(self, embeddings, mock_litellm):
Expand Down
Loading