Fixed git stuff, but socks seems to still not work

This commit is contained in:
anonymous 2023-06-23 11:20:25 +02:00
parent fbde85184d
commit 4935071dd6
4 changed files with 61 additions and 10 deletions

View file

@ -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`

5
cli/__main__.py Normal file
View file

@ -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}')

View file

@ -1,2 +1,6 @@
fastapi
uvicorn
httpx
openai
python-dotenv
rich
starlette

21
setup.py Normal file
View file

@ -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',
]
)