Skip to content
New issue

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

feat: Compatible with Python 3.9 #92

Merged
merged 15 commits into from
Jan 10, 2024
Merged
3 changes: 3 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ jobs:
strategy:
matrix:
python-version:
- "3.9"
- "3.10"
- "3.11"
# - "3.12"
steps:
- uses: actions/checkout@v4
- name: Cache Poetry
Expand Down
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ venv/
**/__pycache__
**/*.py[cod]


# local env files
.env*.local
.env
Expand All @@ -18,5 +19,11 @@ mac.env
.coverage
.coverage.*
.pytest_cache
coverage.xml
test.py
output
node_modules
package-lock.json
package.json

```
14 changes: 6 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
default_language_version:
python: python3.11.3
python: python3.9
repos:
- repo: meta
hooks:
Expand All @@ -17,14 +17,12 @@ repos:
- id: blacken-docs
additional_dependencies: [black==22.10.0]

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.0.290
- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
rev: v9.11.0
hooks:
- id: ruff
types_or: [ python, pyi, jupyter ]
args: [ --fix ]
- id: ruff-format
types_or: [ python, pyi, jupyter ]
- id: commitlint
stages: [commit-msg]
additional_dependencies: ['@commitlint/config-conventional']
simjak marked this conversation as resolved.
Show resolved Hide resolved

- repo: https://github.com/codespell-project/codespell
rev: v2.2.4
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
format:
poetry run black .
poetry run black --target-version py39 .
poetry run ruff --select I --fix .

PYTHON_FILES=.
lint: PYTHON_FILES=.
lint_diff: PYTHON_FILES=$(shell git diff --name-only --diff-filter=d main | grep -E '\.py$$')

lint lint_diff:
poetry run black $(PYTHON_FILES) --check
poetry run black --target-version py39 $(PYTHON_FILES) --check
poetry run ruff .
poetry run mypy $(PYTHON_FILES)

Expand Down
10 changes: 2 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[![Aurelio AI](https://pbs.twimg.com/profile_banners/1671498317455581184/1696285195/1500x500)](https://aurelio.ai)

# Semantic Router

<p>
<img alt="PyPI - Python Version" src="https://img.shields.io/pypi/pyversions/semantic-router?logo=python&logoColor=gold" />
<img alt="GitHub Contributors" src="https://img.shields.io/github/contributors/aurelio-labs/semantic-router" />
Expand All @@ -22,7 +23,7 @@ To get started with _semantic-router_ we install it like so:
pip install -qU semantic-router
```

❗️ _If wanting to use local embeddings you can use `FastEmbedEncoder` (`pip install -qU semantic-router[fastembed]`). To use the `HybridRouteLayer` you must `pip install -qU semantic-router[hybrid]`._
❗️ _If wanting to use local embeddings you can use `FastEmbedEncoder` (`pip install -qU "semantic-router[fastembed]`"). To use the `HybridRouteLayer` you must `pip install -qU "semantic-router[hybrid]"`._

We begin by defining a set of `Route` objects. These are the decision paths that the semantic router can decide to use, let's try two simple routes for now — one for talk on _politics_ and another for _chitchat_:

Expand Down Expand Up @@ -114,10 +115,3 @@ rl("I'm interested in learning about llama 2").name
In this case, no decision could be made as we had no matches — so our route layer returned `None`!

## 📚 [Resources](https://github.com/aurelio-labs/semantic-router/tree/main/docs)







Loading
Loading