diff --git a/README.md b/README.md index 287b42a..8157536 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,29 @@ -# nova-api -☄️ Nova API -<<<<<<< HEAD +# ☄️ Nova API Server +Reverse proxy server for OpenAI's API. + +## Install +Assuming you have a new version of Python 3 and pip installed: +```py +python -m pip install -r requirements.txt +``` + +If you still get a `ModuleNotFoundError`s, you can forefully install the dependencies using: +```py +python -m pip install pipreqs +python -m pipreqs.pipreqs --force --mode no-pin +python -m pip install --upgrade -r requirements.txt +``` + +You can also try installing Nova API using `setup.py`: +```py +python setup.py +``` + +or + +```py +pip install . +``` ## `.env` configuration @@ -13,17 +36,15 @@ You can also just add the *beginning* of an API address, like `12.123.` to allow ## Proxy - `PROXY_TYPE` (optional, defaults to `socks.PROXY_TYPE_HTTP`): the type of proxy - can be `http`, `https`, `socks4`, `socks5`, `4` or `5`, etc... -- `PROXY_HOST`: the host used by the proxy -- `PROXY_PORT`: the port used by the proxy +- `PROXY_HOST`: the proxy host (host domain or IP address), without port! +- `PROXY_PORT` - `PROXY_USER` (optional) - `PROXY_PASS` (optional) ## Run -`cd api && uvicorn main:app --reload && cd ..` +`python cli` You can remove the `--reload` flag if you don't want to reload the server on file changes. ## Test -`python3 tests` -======= ->>>>>>> 5dad208be237c43fa339b4cb98eb68ed398e30be +`python tests` diff --git a/cli/__main__.py b/cli/__main__.py new file mode 100644 index 0000000..3c9bcb5 --- /dev/null +++ b/cli/__main__.py @@ -0,0 +1,5 @@ +import sys +import os + +port = sys.argv[1] if len(sys.argv) > 1 else 8000 +os.system(f'cd api && uvicorn main:app --reload --host 0.0.0.0 --port {port}') diff --git a/requirements.txt b/requirements.txt index f0615cf..137024f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,6 @@ fastapi -uvicorn \ No newline at end of file +httpx +openai +python-dotenv +rich +starlette diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..72e5d4c --- /dev/null +++ b/setup.py @@ -0,0 +1,21 @@ +import setuptools + +with open('README.md', 'r') as fh: + long_description = fh.read() + +setuptools.setup( + name='nova-api', + version='0.0.1', + author='Luna OSS', + author_email='nsde@dmc.chat', + description='Nova API Server', + long_description=long_description, + long_description_content_type='text/markdown', + packages=setuptools.find_packages(), + classifiers=[ + 'Programming Language :: Python :: 3', + 'License :: OSI Approved :: Apache Software License', + 'Operating System :: OS Independent', + ] +) +