Skip to content
Snippets Groups Projects
Unverified Commit 3fbc652a authored by James Briggs's avatar James Briggs
Browse files

merge

parents 605fb0ee 6ef2b6c1
No related branches found
No related tags found
No related merge requests found
......@@ -65,7 +65,7 @@ encoder = OpenAIEncoder()
With our `decisions` and `encoder` defined we now create a `DecisionLayer`. The decision layer handles our semantic decision making.
```python
from semantic_router import DecisionLayer
from semantic_router.layer import DecisionLayer
dl = DecisionLayer(encoder=encoder, decisions=decisions)
```
......@@ -106,4 +106,4 @@ In this case, no decision could be made as we had no matches — so our decision
| | |
| --- | --- |
| 🏃 [Walkthrough](https://colab.research.google.com/github/aurelio-labs/semantic-router/blob/main/walkthrough.ipynb) | Quickstart Python notebook |
\ No newline at end of file
| 🏃 [Walkthrough](https://colab.research.google.com/github/aurelio-labs/semantic-router/blob/main/walkthrough.ipynb) | Quickstart Python notebook |
This diff is collapsed.
......@@ -11,8 +11,8 @@ authors = [
readme = "README.md"
[tool.poetry.dependencies]
python = "^3.11"
pydantic = "^2.4.2"
python = "^3.10"
pydantic = "^1.8.2"
openai = "^0.28.1"
cohere = "^4.32"
......
......@@ -20,9 +20,5 @@ class CohereRetriever(BaseRetriever):
def __call__(self, docs: list[str]) -> list[list[float]]:
if self.client is None:
raise ValueError("Cohere client is not initialized.")
if len(docs) == 1:
input_type = "search_query"
else:
input_type = "search_document"
embeds = self.client.embed(docs, input_type=input_type, model=self.name)
embeds = self.client.embed(docs, input_type="search_query", model=self.name)
return embeds.embeddings
......@@ -6,7 +6,6 @@ from pydantic.dataclasses import dataclass
from semantic_router.retrievers import (
BaseRetriever,
CohereRetriever,
HuggingFaceRetriever,
OpenAIRetriever,
)
......@@ -33,7 +32,7 @@ class Retriever:
self.type = RetrieverType(type)
self.name = name
if self.type == RetrieverType.HUGGINGFACE:
self.model = HuggingFaceRetriever(name)
raise NotImplementedError
elif self.type == RetrieverType.OPENAI:
self.model = OpenAIRetriever(name)
elif self.type == RetrieverType.COHERE:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment