takatost f7939c758f feat: bump version 0.4.5 (#1994) 1 jaar geleden
..
.vscode d069c668f8 Model Runtime (#1858) 1 jaar geleden
constants 42a5b3ec17 feat: advanced prompt backend (#1301) 1 jaar geleden
controllers 4d99c689f0 prohibit enable and disable function when segment is not completed (#1954) 1 jaar geleden
core bf7045566d fix: azure openai model parameters wrong when using hosting credentials (#1993) 1 jaar geleden
docker c32c177e15 improvement: introduce Super-Linter actions to check style for shell script, dockerfile and yaml files (#1966) 1 jaar geleden
events d069c668f8 Model Runtime (#1858) 1 jaar geleden
extensions 94626487db fix: resend url optional (#1987) 1 jaar geleden
fields 185c2f86cd Compatible with the situation where there is no user information. (#1792) 1 jaar geleden
libs faf40a42bc feat: optimize memory & invoke error output (#1931) 1 jaar geleden
migrations d069c668f8 Model Runtime (#1858) 1 jaar geleden
models d069c668f8 Model Runtime (#1858) 1 jaar geleden
schedule 595e9b25ba Add data clean schedule (#1859) 1 jaar geleden
services 296bf443a8 feat: reuse decoding_rsa_key & decoding_cipher_rsa & optimize construct (#1937) 1 jaar geleden
tasks 4d99c689f0 prohibit enable and disable function when segment is not completed (#1954) 1 jaar geleden
templates 3d92784bd4 fix: email template style (#1914) 1 jaar geleden
tests ebd11e7482 fix: baichuan max chunks (#1990) 1 jaar geleden
.dockerignore 220f7c81e9 build: fix .dockerignore file (#800) 1 jaar geleden
.env.example 1fe4e3afde Update Resend SDK and resend api url in configuration. (#1963) 1 jaar geleden
Dockerfile d069c668f8 Model Runtime (#1858) 1 jaar geleden
README.md 454577c6b1 Remove legacy docker startup docs in frontend (#1645) 1 jaar geleden
app.py d069c668f8 Model Runtime (#1858) 1 jaar geleden
commands.py d069c668f8 Model Runtime (#1858) 1 jaar geleden
config.py f7939c758f feat: bump version 0.4.5 (#1994) 1 jaar geleden
requirements.txt 1fe4e3afde Update Resend SDK and resend api url in configuration. (#1963) 1 jaar geleden

README.md

Dify Backend API

Usage

  1. Start the docker-compose stack

The backend require some middleware, including PostgreSQL, Redis, and Weaviate, which can be started together using docker-compose.

   cd ../docker
   docker-compose -f docker-compose.middleware.yaml -p dify up -d
   cd ../api
  1. Copy .env.example to .env
  2. Generate a SECRET_KEY in the .env file.
   openssl rand -base64 42

3.5 If you use annaconda, create a new environment and activate it

   conda create --name dify python=3.10
   conda activate dify
  1. Install dependencies

    pip install -r requirements.txt
    
    1. Run migrate

    Before the first launch, migrate the database to the latest version.

    flask db upgrade
    

⚠️ If you encounter problems with jieba, for example

   > flask db upgrade
   Error: While importing 'app', an ImportError was raised:

Please run the following command instead.

   pip install -r requirements.txt --upgrade --force-reinstall
  1. Start backend: bash flask run --host 0.0.0.0 --port=5001 --debug 7. Setup your application by visiting http://localhost:5001/console/api/setup or other apis... 8. If you need to debug local async processing, you can run celery -A app.celery worker -P gevent -c 1 --loglevel INFO -Q dataset,generation,mail, celery can do dataset importing and other async tasks.