Skip to content

Commit

Permalink
merge commit
Browse files Browse the repository at this point in the history
Initial commit

Added Unify, AsyncUnify and streaming support

Added some default values

updated the generate functions to directly take as input a string which is assumed to be a user prompt or a list of dictionaries containig the conversation history so far. Also fixed an issue with the generation functions

Added a helper function to validate the UNIFY_API_KEY{

Added some exception handling & also added tests

Adding docs

updated docs

Added a .gitignore and removed temporary files

renamed some files

Delete src/Unify directory

added github workflows for flake8, mypy, and black

updated ReadMe

Updated ReadMe

remove temp code

Renamed some files, removed typehitnts from private functions and uncommented mypy code

Renamed some files, removed typehitnts from private functions and uncommented mypy code

minor fix

Fixed an error in the docs

Fixed an error in the docs

Fixed an error in the docs

update docs

updated pyproect.toml

add poetry.lock

minor fixes and formatting

Update README.md

Updated tests.yml to run tests on the CI

debug CI not finding openai dependency: upated tests.yml to explicity do poetry install

debug CI not finding openai dependency: upated tests.yml to explicity install poetry using pip and then install the package using poetry

debugging unnittest CI

Updated ReadMe

minor docs fix

Added UNIFY_KEY secret to tests.yml  and fixed flake8erros

added unify-testing env in tests.yml

Added system prompt to the .generate function and updated the README

fixed an issue in the tests

Delete new_test.py

Updated the ReadMe and made the code a bit cleaner

change dist name to unifyai

update workflow

Added workflows for publishing to pypi and testpypi

minor fixes

Update workflow
  • Loading branch information
hello-fri-end committed Apr 1, 2024
0 parents commit 99a1f05
Show file tree
Hide file tree
Showing 14 changed files with 2,456 additions and 0 deletions.
137 changes: 137 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
[flake8]
max-complexity = 6
inline-quotes = double
max-line-length = 88
extend-ignore = E203
docstring_style = sphinx

ignore =
; Found `f` string
WPS305,
; Missing docstring in public module
D100,
; Missing docstring in magic method
D105,
; Missing docstring in __init__
D107,
; Found `__init__.py` module with logic
WPS412,
; Found class without a base class
WPS306,
; Missing docstring in public nested class
D106,
; First line should be in imperative mood
D401,
; Found wrong variable name
WPS110,
; Found `__init__.py` module with logic
WPS326,
; Found string constant over-use
WPS226,
; Found upper-case constant in a class
WPS115,
; Found nested function
WPS602,
; Found method without arguments
WPS605,
; Found overused expression
WPS204,
; Found too many module members
WPS202,
; Found too high module cognitive complexity
WPS232,
; line break before binary operator
W503,
; Found module with too many imports
WPS201,
; Inline strong start-string without end-string.
RST210,
; Found nested class
WPS431,
; Found wrong module name
WPS100,
; Found too many methods
WPS214,
; Found too long ``try`` body
WPS229,
; Found unpythonic getter or setter
WPS615,
; Found a line that starts with a dot
WPS348,
; Found complex default value (for dependency injection)
WPS404,
; not perform function calls in argument defaults (for dependency injection)
B008,
; Model should define verbose_name in its Meta inner class
DJ10,
; Model should define verbose_name_plural in its Meta inner class
DJ11,
; Found mutable module constant.
WPS407,
; Found too many empty lines in `def`
WPS473,
; too many no-cover comments.
WPS403,
; Found `noqa` comments overuse
WPS402,
; Found protected attribute usage
WPS437,
; Found too short name
WPS111,
; Found error raising from itself
WPS469,
; Found a too complex `f` string
WPS237,

per-file-ignores =
; all tests
test_*.py,tests.py,tests_*.py,*/tests/*,conftest.py:
; Use of assert detected
S101,
; Found outer scope names shadowing
WPS442,
; Found too many local variables
WPS210,
; Found magic number
WPS432,
; Missing parameter(s) in Docstring
DAR101,
; Found too many arguments
WPS211,
; Missing docstring in public class
D101,
; Missing docstring in public method
D102,
; Found too long name
WPS118,

; all init files
__init__.py:
; ignore not used imports
F401,
; ignore import with wildcard
F403,
; Found wrong metadata variable
WPS410,

; exceptions file
unify/exceptions.py:
; Found wrong keyword
WPS420,
; Found incorrect node inside `class` body
WPS604,

exclude =
./.cache,
./.git,
./.idea,
./.mypy_cache,
./.pytest_cache,
./.venv,
./venv,
./env,
./cached_venv,
./docs,
./deploy,
./var,
./.vscode,
21 changes: 21 additions & 0 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Publish to PyPI
on:
release:
types: [published]

jobs:
pypi_release:
name: Builds Using Poetry and Publishes to PyPI
runs-on: ubuntu-latest
environment: pypi
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- name: Install deps
run: |
python -m pip install --upgrade pip
pip install poetry
poetry install --with dev
- run: poetry config pypi-token.pypi "${{ secrets.PYPI_API_KEY }}"
- name: Publish package
run: poetry publish --build
22 changes: 22 additions & 0 deletions .github/workflows/testpypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Publish to Test PyPI
on:
push:
tags:
- '*.*.*'

jobs:
test_pypi_release:
runs-on: ubuntu-latest
environment: pypi
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- name: Install deps
run: |
python -m pip install --upgrade pip
pip install poetry
poetry install --with dev
- run: poetry config repositories.testpypi https://test.pypi.org/legacy/
- run: poetry config pypi-token.testpypi ${{ secrets.TEST_PYPI_API_KEY }}
- name: Publish package
run: poetry publish --build -r testpypi
68 changes: 68 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Testing unify

on: push

jobs:
black:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.9'
- name: Install deps
uses: knowsuchagency/poetry-install@v1
env:
POETRY_VIRTUALENVS_CREATE: false
- name: Run black check
run: poetry run black --check .

flake8:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.9'
- name: Install deps
uses: knowsuchagency/poetry-install@v1
env:
POETRY_VIRTUALENVS_CREATE: false
- name: Run flake8 check
run: poetry run flake8 --count .

mypy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.9'
- name: Install deps
uses: knowsuchagency/poetry-install@v1
env:
POETRY_VIRTUALENVS_CREATE: false
- name: Run mypy check
run: poetry run mypy --install-types --non-interactive .

unittests:
runs-on: ubuntu-latest
environment: unify-testing
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.9'
- name: Install deps
run: |
python -m pip install --upgrade pip
pip install poetry
poetry install --with dev
- name: Run unit tests
run: poetry run python -m unittest discover
env:
UNIFY_KEY: ${{ secrets.UNIFY_KEY }}
Loading

0 comments on commit 99a1f05

Please sign in to comment.