Skip to content

Commit 9388346

Browse files
committed
Merge commit '2624a6dcd0b89dd7c1aac2d7bfe7f769e9e3c992' into feat/modelscope
* commit '2624a6dcd0b89dd7c1aac2d7bfe7f769e9e3c992': (630 commits) Fix explore app icon (langgenius#11808) ci: fix config ci and it works (langgenius#11807) ci: add config ci more disscuss check langgenius#11706 (langgenius#11752) chore: bump version to 0.14.1 (langgenius#11784) feat:add hunyuan model(hunyuan-role, hunyuan-large, hunyuan-large-rol… (langgenius#11766) chore(opendal_storage): remove unused comment (langgenius#11783) feat: Disable the "Forgot your password?" button when the mail server setup is incomplete (langgenius#11653) chore(.env.example): add comments for opendal (langgenius#11778) Lindorm vdb bug-fix (langgenius#11790) fix: imperfect service-api introduction text (langgenius#11782) feat: add openai o1 & update pricing and max_token of other models (langgenius#11780) fix: file upload auth (langgenius#11774) feat: add parameters for JinaReaderTool (langgenius#11613) feat: full support for opendal and sync configurations between .env and docker-compose (langgenius#11754) feat(app_factory): speed up api startup (langgenius#11762) fix: Prevent redirection to /overview when accessing /workflow. (langgenius#11733) (doc) fix: update cURL examples to include Authorization header (langgenius#11750) Fix explore app icon (langgenius#11742) chore: improve gemini models (langgenius#11745) feat: use Gemini response metadata for token counting (langgenius#11743) ...
2 parents 2412dc1 + 2624a6d commit 9388346

File tree

1,631 files changed

+63203
-15319
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,631 files changed

+63203
-15319
lines changed

Diff for: .devcontainer/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
FROM mcr.microsoft.com/devcontainers/python:3.10
1+
FROM mcr.microsoft.com/devcontainers/python:3.12
22

33
# [Optional] Uncomment this section to install additional OS packages.
44
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
5-
# && apt-get -y install --no-install-recommends <your-package-list-here>
5+
# && apt-get -y install --no-install-recommends <your-package-list-here>

Diff for: .devcontainer/devcontainer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
22
// README at: https://github.com/devcontainers/templates/tree/main/src/anaconda
33
{
4-
"name": "Python 3.10",
4+
"name": "Python 3.12",
55
"build": {
66
"context": "..",
77
"dockerfile": "Dockerfile"

Diff for: .devcontainer/post_create_command.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@ echo 'alias start-api="cd /workspaces/dify/api && poetry run python -m flask run
77
echo 'alias start-worker="cd /workspaces/dify/api && poetry run python -m celery -A app.celery worker -P gevent -c 1 --loglevel INFO -Q dataset,generation,mail,ops_trace,app_deletion"' >> ~/.bashrc
88
echo 'alias start-web="cd /workspaces/dify/web && npm run dev"' >> ~/.bashrc
99
echo 'alias start-containers="cd /workspaces/dify/docker && docker-compose -f docker-compose.middleware.yaml -p dify up -d"' >> ~/.bashrc
10+
echo 'alias stop-containers="cd /workspaces/dify/docker && docker-compose -f docker-compose.middleware.yaml -p dify down"' >> ~/.bashrc
1011

11-
source /home/vscode/.bashrc
12+
source /home/vscode/.bashrc

Diff for: .devcontainer/post_start_command.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/bin/bash
22

3-
poetry install -C api
3+
cd api && poetry install

Diff for: .github/actions/setup-poetry/action.yml

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Setup Poetry and Python
2+
3+
inputs:
4+
python-version:
5+
description: Python version to use and the Poetry installed with
6+
required: true
7+
default: '3.11'
8+
poetry-version:
9+
description: Poetry version to set up
10+
required: true
11+
default: '1.8.4'
12+
poetry-lockfile:
13+
description: Path to the Poetry lockfile to restore cache from
14+
required: true
15+
default: ''
16+
17+
runs:
18+
using: composite
19+
steps:
20+
- name: Set up Python ${{ inputs.python-version }}
21+
uses: actions/setup-python@v5
22+
with:
23+
python-version: ${{ inputs.python-version }}
24+
cache: pip
25+
26+
- name: Install Poetry
27+
shell: bash
28+
run: pip install poetry==${{ inputs.poetry-version }}
29+
30+
- name: Restore Poetry cache
31+
if: ${{ inputs.poetry-lockfile != '' }}
32+
uses: actions/setup-python@v5
33+
with:
34+
python-version: ${{ inputs.python-version }}
35+
cache: poetry
36+
cache-dependency-path: ${{ inputs.poetry-lockfile }}

Diff for: .github/pull_request_template.md

+16-25
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,25 @@
1-
# Checklist:
1+
# Summary
22

3-
> [!IMPORTANT]
4-
> Please review the checklist below before submitting your pull request.
5-
6-
- [ ] Please open an issue before creating a PR or link to an existing issue
7-
- [ ] I have performed a self-review of my own code
8-
- [ ] I have commented my code, particularly in hard-to-understand areas
9-
- [ ] I ran `dev/reformat`(backend) and `cd web && npx lint-staged`(frontend) to appease the lint gods
10-
11-
# Description
12-
13-
Describe the big picture of your changes here to communicate to the maintainers why we should accept this pull request. If it fixes a bug or resolves a feature request, be sure to link to that issue. Close issue syntax: `Fixes #<issue number>`, see [documentation](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword) for more details.
3+
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
144

15-
Fixes
5+
> [!Tip]
6+
> Close issue syntax: `Fixes #<issue number>` or `Resolves #<issue number>`, see [documentation](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword) for more details.
167
17-
## Type of Change
188

19-
- [ ] Bug fix (non-breaking change which fixes an issue)
20-
- [ ] New feature (non-breaking change which adds functionality)
21-
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
22-
- [ ] This change requires a documentation update, included: [Dify Document](https://github.com/langgenius/dify-docs)
23-
- [ ] Improvement, including but not limited to code refactoring, performance optimization, and UI/UX improvement
24-
- [ ] Dependency upgrade
25-
26-
# Testing Instructions
9+
# Screenshots
2710

28-
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
11+
| Before | After |
12+
|--------|-------|
13+
| ... | ... |
2914

30-
- [ ] Test A
31-
- [ ] Test B
15+
# Checklist
3216

17+
> [!IMPORTANT]
18+
> Please review the checklist below before submitting your pull request.
3319
20+
- [ ] This change requires a documentation update, included: [Dify Document](https://github.com/langgenius/dify-docs)
21+
- [x] I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!)
22+
- [x] I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
23+
- [x] I've updated the documentation accordingly.
24+
- [x] I ran `dev/reformat`(backend) and `cd web && npx lint-staged`(frontend) to appease the lint gods
3425

Diff for: .github/workflows/api-tests.yml

+8-28
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77
paths:
88
- api/**
99
- docker/**
10+
- .github/workflows/api-tests.yml
1011

1112
concurrency:
1213
group: api-tests-${{ github.head_ref || github.run_id }}
@@ -19,24 +20,18 @@ jobs:
1920
strategy:
2021
matrix:
2122
python-version:
22-
- "3.10"
2323
- "3.11"
2424
- "3.12"
2525

2626
steps:
2727
- name: Checkout code
2828
uses: actions/checkout@v4
2929

30-
- name: Set up Python ${{ matrix.python-version }}
31-
uses: actions/setup-python@v5
30+
- name: Setup Poetry and Python ${{ matrix.python-version }}
31+
uses: ./.github/actions/setup-poetry
3232
with:
3333
python-version: ${{ matrix.python-version }}
34-
cache-dependency-path: |
35-
api/pyproject.toml
36-
api/poetry.lock
37-
38-
- name: Install Poetry
39-
uses: abatilo/actions-poetry@v3
34+
poetry-lockfile: api/poetry.lock
4035

4136
- name: Check Poetry lockfile
4237
run: |
@@ -55,6 +50,9 @@ jobs:
5550
- name: Run ModelRuntime
5651
run: poetry run -C api bash dev/pytest/pytest_model_runtime.sh
5752

53+
- name: Run dify config tests
54+
run: poetry run -C api python dev/pytest/pytest_config_tests.py
55+
5856
- name: Run Tool
5957
run: poetry run -C api bash dev/pytest/pytest_tools.sh
6058

@@ -67,7 +65,7 @@ jobs:
6765
run: sh .github/workflows/expose_service_ports.sh
6866

6967
- name: Set up Sandbox
70-
uses: hoverkraft-tech/[email protected].0
68+
uses: hoverkraft-tech/[email protected].2
7169
with:
7270
compose-file: |
7371
docker/docker-compose.middleware.yaml
@@ -77,21 +75,3 @@ jobs:
7775
7876
- name: Run Workflow
7977
run: poetry run -C api bash dev/pytest/pytest_workflow.sh
80-
81-
- name: Set up Vector Stores (Weaviate, Qdrant, PGVector, Milvus, PgVecto-RS, Chroma, MyScale, ElasticSearch)
82-
uses: hoverkraft-tech/[email protected]
83-
with:
84-
compose-file: |
85-
docker/docker-compose.yaml
86-
services: |
87-
weaviate
88-
qdrant
89-
etcd
90-
minio
91-
milvus-standalone
92-
pgvecto-rs
93-
pgvector
94-
chroma
95-
elasticsearch
96-
- name: Test Vector Stores
97-
run: poetry run -C api bash dev/pytest/pytest_vdb.sh

Diff for: .github/workflows/build-push.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
5050
5151
- name: Login to Docker Hub
52-
uses: docker/login-action@v2
52+
uses: docker/login-action@v3
5353
with:
5454
username: ${{ env.DOCKERHUB_USER }}
5555
password: ${{ env.DOCKERHUB_TOKEN }}
@@ -114,7 +114,7 @@ jobs:
114114
merge-multiple: true
115115

116116
- name: Login to Docker Hub
117-
uses: docker/login-action@v2
117+
uses: docker/login-action@v3
118118
with:
119119
username: ${{ env.DOCKERHUB_USER }}
120120
password: ${{ env.DOCKERHUB_TOKEN }}

Diff for: .github/workflows/db-migration-test.yml

+7-14
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ on:
66
- main
77
paths:
88
- api/migrations/**
9+
- .github/workflows/db-migration-test.yml
910

1011
concurrency:
1112
group: db-migration-test-${{ github.ref }}
@@ -14,25 +15,15 @@ concurrency:
1415
jobs:
1516
db-migration-test:
1617
runs-on: ubuntu-latest
17-
strategy:
18-
matrix:
19-
python-version:
20-
- "3.10"
2118

2219
steps:
2320
- name: Checkout code
2421
uses: actions/checkout@v4
2522

26-
- name: Set up Python ${{ matrix.python-version }}
27-
uses: actions/setup-python@v5
23+
- name: Setup Poetry and Python
24+
uses: ./.github/actions/setup-poetry
2825
with:
29-
python-version: ${{ matrix.python-version }}
30-
cache-dependency-path: |
31-
api/pyproject.toml
32-
api/poetry.lock
33-
34-
- name: Install Poetry
35-
uses: abatilo/actions-poetry@v3
26+
poetry-lockfile: api/poetry.lock
3627

3728
- name: Install dependencies
3829
run: poetry install -C api
@@ -43,7 +34,7 @@ jobs:
4334
cp middleware.env.example middleware.env
4435
4536
- name: Set up Middlewares
46-
uses: hoverkraft-tech/[email protected].0
37+
uses: hoverkraft-tech/[email protected].2
4738
with:
4839
compose-file: |
4940
docker/docker-compose.middleware.yaml
@@ -57,6 +48,8 @@ jobs:
5748
cp .env.example .env
5849
5950
- name: Run DB Migration
51+
env:
52+
DEBUG: true
6053
run: |
6154
cd api
6255
poetry run python -m flask upgrade-db

Diff for: .github/workflows/expose_service_ports.sh

+4-1
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,8 @@ yq eval '.services["milvus-standalone"].ports += ["19530:19530"]' -i docker/dock
77
yq eval '.services.pgvector.ports += ["5433:5432"]' -i docker/docker-compose.yaml
88
yq eval '.services["pgvecto-rs"].ports += ["5431:5432"]' -i docker/docker-compose.yaml
99
yq eval '.services["elasticsearch"].ports += ["9200:9200"]' -i docker/docker-compose.yaml
10+
yq eval '.services.couchbase-server.ports += ["8091-8096:8091-8096"]' -i docker/docker-compose.yaml
11+
yq eval '.services.couchbase-server.ports += ["11210:11210"]' -i docker/docker-compose.yaml
12+
yq eval '.services.tidb.ports += ["4000:4000"]' -i docker/docker-compose.yaml
1013

11-
echo "Ports exposed for sandbox, weaviate, qdrant, chroma, milvus, pgvector, pgvecto-rs, elasticsearch"
14+
echo "Ports exposed for sandbox, weaviate, tidb, qdrant, chroma, milvus, pgvector, pgvecto-rs, elasticsearch, couchbase"

Diff for: .github/workflows/style.yml

+10-15
Original file line numberDiff line numberDiff line change
@@ -22,34 +22,29 @@ jobs:
2222
id: changed-files
2323
uses: tj-actions/changed-files@v45
2424
with:
25-
files: api/**
26-
27-
- name: Set up Python
28-
uses: actions/setup-python@v5
29-
if: steps.changed-files.outputs.any_changed == 'true'
30-
with:
31-
python-version: '3.10'
25+
files: |
26+
api/**
27+
.github/workflows/style.yml
3228
33-
- name: Install Poetry
29+
- name: Setup Poetry and Python
3430
if: steps.changed-files.outputs.any_changed == 'true'
35-
uses: abatilo/actions-poetry@v3
31+
uses: ./.github/actions/setup-poetry
3632

37-
- name: Python dependencies
33+
- name: Install dependencies
3834
if: steps.changed-files.outputs.any_changed == 'true'
3935
run: poetry install -C api --only lint
4036

4137
- name: Ruff check
4238
if: steps.changed-files.outputs.any_changed == 'true'
43-
run: poetry run -C api ruff check ./api
39+
run: |
40+
poetry run -C api ruff --version
41+
poetry run -C api ruff check ./api
42+
poetry run -C api ruff format --check ./api
4443
4544
- name: Dotenv check
4645
if: steps.changed-files.outputs.any_changed == 'true'
4746
run: poetry run -C api dotenv-linter ./api/.env.example ./web/.env.example
4847

49-
- name: Ruff formatter check
50-
if: steps.changed-files.outputs.any_changed == 'true'
51-
run: poetry run -C api ruff format --check ./api
52-
5348
- name: Lint hints
5449
if: failure()
5550
run: echo "Please run 'dev/reformat' to fix the fixable linting errors."

0 commit comments

Comments
 (0)