mirror of
https://github.com/NovaOSS/nova-api.git
synced 2024-11-25 21:43:57 +01:00
Fixed git stuff, but socks seems to still not work
This commit is contained in:
parent
fbde85184d
commit
4935071dd6
39
README.md
39
README.md
|
@ -1,6 +1,29 @@
|
||||||
# nova-api
|
# ☄️ Nova API Server
|
||||||
☄️ Nova API
|
Reverse proxy server for OpenAI's API.
|
||||||
<<<<<<< HEAD
|
|
||||||
|
## 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
|
## `.env` configuration
|
||||||
|
|
||||||
|
@ -13,17 +36,15 @@ You can also just add the *beginning* of an API address, like `12.123.` to allow
|
||||||
|
|
||||||
## Proxy
|
## 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_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_HOST`: the proxy host (host domain or IP address), without port!
|
||||||
- `PROXY_PORT`: the port used by the proxy
|
- `PROXY_PORT`
|
||||||
- `PROXY_USER` (optional)
|
- `PROXY_USER` (optional)
|
||||||
- `PROXY_PASS` (optional)
|
- `PROXY_PASS` (optional)
|
||||||
|
|
||||||
## Run
|
## 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.
|
You can remove the `--reload` flag if you don't want to reload the server on file changes.
|
||||||
|
|
||||||
## Test
|
## Test
|
||||||
`python3 tests`
|
`python tests`
|
||||||
=======
|
|
||||||
>>>>>>> 5dad208be237c43fa339b4cb98eb68ed398e30be
|
|
||||||
|
|
5
cli/__main__.py
Normal file
5
cli/__main__.py
Normal 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}')
|
|
@ -1,2 +1,6 @@
|
||||||
fastapi
|
fastapi
|
||||||
uvicorn
|
httpx
|
||||||
|
openai
|
||||||
|
python-dotenv
|
||||||
|
rich
|
||||||
|
starlette
|
||||||
|
|
21
setup.py
Normal file
21
setup.py
Normal 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',
|
||||||
|
]
|
||||||
|
)
|
||||||
|
|
Loading…
Reference in a new issue