Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: added error handling for novita ai tool query #5503

Closed
wants to merge 58 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
be14cec
feat: Add optional API key, proxy server, and bypass cache parameters…
XiaoLey Jun 14, 2024
b5868dd
improve: add new line character
XiaoLey Jun 14, 2024
4eb5557
Merge branch 'langgenius:main' into main
XiaoLey Jun 14, 2024
55a8116
Merge branch 'langgenius:main' into main
XiaoLey Jun 15, 2024
3be35ff
Merge branch 'langgenius:main' into main
XiaoLey Jun 15, 2024
6be4921
Merge branch 'langgenius:main' into main
XiaoLey Jun 16, 2024
b60dec0
feat: add Novita AI image generation tool, currently implemented mode…
XiaoLey Jun 17, 2024
3716078
Merge branch 'langgenius:main' into main
XiaoLey Jun 17, 2024
0317a2b
Merge branch 'main' of github.com:XiaoLey/dify
XiaoLey Jun 17, 2024
6e99bf7
feat: add `Create Tile` functionality in Novita AI image generation tool
XiaoLey Jun 17, 2024
052ca3f
Merge branch 'main' into main
crazywoola Jun 17, 2024
e68743e
Merge branch 'langgenius:main' into main
XiaoLey Jun 17, 2024
c3b5958
fix: format
XiaoLey Jun 17, 2024
558cfb0
Merge branch 'main' of github.com:XiaoLey/dify
XiaoLey Jun 17, 2024
fd50fcd
Merge branch 'langgenius:main' into main
XiaoLey Jun 17, 2024
cc9a0a7
Merge branch 'langgenius:main' into main
XiaoLey Jun 18, 2024
d59521f
Merge branch 'langgenius:main' into main
XiaoLey Jun 18, 2024
60ec338
chore: removed redundant line of code
XiaoLey Jun 18, 2024
c429c40
fix: resolve issue with cot_agent_runner not analyzing user-uploaded …
XiaoLey Jun 18, 2024
b52d0a9
Merge branch 'langgenius:main' into main
XiaoLey Jun 19, 2024
2627ec8
fix: Added error handling for novita ai model query
XiaoLey Jun 19, 2024
b8c3122
feat: update template (#5395)
crazywoola Jun 19, 2024
19394b7
Corrected an error in the APi docs (#5398)
Theysua Jun 19, 2024
48b11ff
fix bug: tencent vdb #5378 (#5408)
quicksandznzn Jun 20, 2024
d49e2fe
feat: new icons (#5412)
zxhlyh Jun 20, 2024
ddc288a
fix: optional parameter missing default value None in http request no…
takatost Jun 20, 2024
48fad2f
fix: Revert "feat: initial support for Milvus 2.4.x (#3795)" downgrad…
bowenliang123 Jun 20, 2024
1e62a0b
fix: prompt editor insert cursor position (#5415)
zxhlyh Jun 20, 2024
26e0c9c
fix: sentry config float type err (#5416)
takatost Jun 20, 2024
395dd92
fix: button component will refresh page (#5420)
iamjoel Jun 20, 2024
fa78e6f
fix: workflow note node copy & link style (#5428)
zxhlyh Jun 20, 2024
f9b0475
fix(core): Fix incorrect type hints. (#5427)
laipz8200 Jun 20, 2024
c5933c0
fix: annotation id not pass to update setting (#5429)
iamjoel Jun 20, 2024
09b1470
fix: add notion page in knowledge (#5430)
zxhlyh Jun 20, 2024
340e44a
improve: unify Excel files parsing in either xls or xlsx file format …
bowenliang123 Jun 20, 2024
ccaee04
refactor: Remove unused code in large_language_model.py (#5433)
laipz8200 Jun 20, 2024
843e1f2
refactor: extract vdb configs into pydantic-setting based dify config…
bowenliang123 Jun 20, 2024
5fe5ad3
fix: in iteration node picker may show the wrong var type (#5435)
iamjoel Jun 20, 2024
39c55ff
fix: some types of buttons ui breaks (#5437)
iamjoel Jun 20, 2024
9d97767
fix/i18n: correct `indexMethodHighQualityTip` (#5431)
GOODBOY008 Jun 20, 2024
0b3431f
feat: add support for claude-3-5-sonnet-20240620 (#5452)
takatost Jun 20, 2024
400be63
feat: add support for bedrock claude-3-5-sonnet-20240620 (#5461)
soulteary Jun 21, 2024
4ea584a
feat(api/auth): switch-to-stateful-authentication (#5438)
laipz8200 Jun 21, 2024
c966545
feat: option to hide workflow steps (#5436)
crazywoola Jun 21, 2024
5e7590f
fix: button (#5470)
zxhlyh Jun 21, 2024
6202199
fix: view workflow log detail page crash (#5474)
iamjoel Jun 21, 2024
708ff84
feat: add support for Vertex AI claude-3-5-sonnet@20240620 (#5475)
hellof20 Jun 21, 2024
036735d
fix: max_tokens of qwen-plus & qwen-plus-chat (#5480)
crazywoola Jun 21, 2024
a49015c
build: support Poetry for depencencies tool in api's Dockerfile (#5105)
bowenliang123 Jun 21, 2024
4aa4963
Add Oracle23ai as a vector datasource (#5342)
tmuife Jun 21, 2024
a29fc5b
chore: remove pip support for api service (#5453)
takatost Jun 21, 2024
2ffa7cf
chore: use singular style in config class name (#5489)
bowenliang123 Jun 22, 2024
40c8706
refactor: extract storage provider configs into dify configs (#5443)
bowenliang123 Jun 22, 2024
37c92e6
refactor: extract db configs and celery configs into dify config (#5491)
bowenliang123 Jun 22, 2024
60f416d
fix: firecrawl apikey not start with fc- (#5498)
iamjoel Jun 22, 2024
5c2b4d4
fix: tongyi json output (#5396)
lxm Jun 22, 2024
3c4075b
fix: zhipu tool calling, this PR fixes the bug described in issue #54…
vccler Jun 22, 2024
02a3ec3
fix: summary of duckduckgo_search (#5488)
hjlarry Jun 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .devcontainer/post_start_command.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash

cd api && pip install -r requirements.txt
poetry install -C api
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ body:
- type: input
attributes:
label: Dify version
placeholder: 0.3.21
placeholder: 0.6.11
description: See about section in Dify console
validations:
required: true
Expand All @@ -40,7 +40,7 @@ body:
- type: textarea
attributes:
label: Steps to reproduce
description: We highly suggest including screenshots and a bug report log.
description: We highly suggest including screenshots and a bug report log. Please use the right markdown syntax for code blocks.
placeholder: Having detailed steps helps us reproduce the bug.
validations:
required: true
Expand Down
18 changes: 3 additions & 15 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,31 +16,19 @@ body:
required: true
- type: textarea
attributes:
label: 1. Is this request related to a challenge you're experiencing?
label: 1. Is this request related to a challenge you're experiencing? Tell me about your story.
placeholder: Please describe the specific scenario or problem you're facing as clearly as possible. For instance "I was trying to use [feature] for [specific task], and [what happened]... It was frustrating because...."
validations:
required: true
- type: textarea
attributes:
label: 2. Describe the feature you'd like to see
placeholder: Think about what you want to achieve and how this feature will help you. Sketches, flow diagrams, or any visual representation will be a major plus.
validations:
required: true
- type: textarea
attributes:
label: 3. How will this feature improve your workflow or experience?
placeholder: Tell us how this change will benefit your work. This helps us prioritize based on user impact.
validations:
required: true
- type: textarea
attributes:
label: 4. Additional context or comments
label: 2. Additional context or comments
placeholder: (Any other information, comments, documentations, links, or screenshots that would provide more clarity. This is the place to add anything else not covered above.)
validations:
required: false
- type: checkboxes
attributes:
label: 5. Can you help us with this feature?
label: 3. Can you help us with this feature?
description: Let us know! This is not a commitment, but a starting point for collaboration.
options:
- label: I am interested in contributing to this feature.
Expand Down
72 changes: 3 additions & 69 deletions .github/workflows/api-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,74 +14,6 @@ concurrency:

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- "3.10"
- "3.11"

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
cache-dependency-path: |
./api/requirements.txt
./api/requirements-dev.txt

- name: Install dependencies
run: pip install -r ./api/requirements.txt -r ./api/requirements-dev.txt

- name: Run Unit tests
run: dev/pytest/pytest_unit_tests.sh

- name: Run ModelRuntime
run: dev/pytest/pytest_model_runtime.sh

- name: Run Tool
run: dev/pytest/pytest_tools.sh

- name: Set up Sandbox
uses: hoverkraft-tech/[email protected]
with:
compose-file: |
docker/docker-compose.middleware.yaml
services: |
sandbox
ssrf_proxy

- name: Run Workflow
run: dev/pytest/pytest_workflow.sh

- name: Set up Vector Stores (Weaviate, Qdrant, PGVector, Milvus, PgVecto-RS, Chroma)
uses: hoverkraft-tech/[email protected]
with:
compose-file: |
docker/docker-compose.middleware.yaml
docker/docker-compose.qdrant.yaml
docker/docker-compose.milvus.yaml
docker/docker-compose.pgvecto-rs.yaml
docker/docker-compose.pgvector.yaml
docker/docker-compose.chroma.yaml
services: |
weaviate
qdrant
etcd
minio
milvus-standalone
pgvecto-rs
pgvector
chroma

- name: Test Vector Stores
run: dev/pytest/pytest_vdb.sh

test-in-poetry:
name: API Tests
runs-on: ubuntu-latest
strategy:
Expand All @@ -108,7 +40,7 @@ jobs:

- name: Poetry check
run: |
poetry check -C api
poetry check -C api --lock
poetry show -C api

- name: Install dependencies
Expand Down Expand Up @@ -145,6 +77,7 @@ jobs:
docker/docker-compose.pgvecto-rs.yaml
docker/docker-compose.pgvector.yaml
docker/docker-compose.chroma.yaml
docker/docker-compose.oracle.yaml
services: |
weaviate
qdrant
Expand All @@ -154,6 +87,7 @@ jobs:
pgvecto-rs
pgvector
chroma
oracle

- name: Test Vector Stores
run: poetry run -C api bash dev/pytest/pytest_vdb.sh
113 changes: 95 additions & 18 deletions .github/workflows/build-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,46 @@ on:
release:
types: [published]

concurrency:
group: build-push-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

env:
DOCKERHUB_USER: ${{ secrets.DOCKERHUB_USER }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
DIFY_WEB_IMAGE_NAME: ${{ vars.DIFY_WEB_IMAGE_NAME || 'langgenius/dify-web' }}
DIFY_API_IMAGE_NAME: ${{ vars.DIFY_API_IMAGE_NAME || 'langgenius/dify-api' }}

jobs:
build-and-push:
runs-on: ubuntu-latest
build:
runs-on: ${{ matrix.platform == 'linux/arm64' && 'arm64_runner' || 'ubuntu-latest' }}
if: github.repository == 'langgenius/dify'
strategy:
matrix:
include:
- service_name: "web"
image_name_env: "DIFY_WEB_IMAGE_NAME"
context: "web"
- service_name: "api"
- service_name: "build-api-amd64"
image_name_env: "DIFY_API_IMAGE_NAME"
context: "api"
platform: linux/amd64
- service_name: "build-api-arm64"
image_name_env: "DIFY_API_IMAGE_NAME"
context: "api"
platform: linux/arm64
- service_name: "build-web-amd64"
image_name_env: "DIFY_WEB_IMAGE_NAME"
context: "web"
platform: linux/amd64
- service_name: "build-web-arm64"
image_name_env: "DIFY_WEB_IMAGE_NAME"
context: "web"
platform: linux/arm64

steps:
- name: Prepare
run: |
platform=${{ matrix.platform }}
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

Expand All @@ -40,7 +60,66 @@ jobs:
username: ${{ env.DOCKERHUB_USER }}
password: ${{ env.DOCKERHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
- name: Extract metadata for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env[matrix.image_name_env] }}

- name: Build Docker image
id: build
uses: docker/build-push-action@v6
with:
context: "{{defaultContext}}:${{ matrix.context }}"
platforms: ${{ matrix.platform }}
build-args: COMMIT_SHA=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.revision'] }}
labels: ${{ steps.meta.outputs.labels }}
outputs: type=image,name=${{ env[matrix.image_name_env] }},push-by-digest=true,name-canonical=true,push=true
cache-from: type=gha,scope=${{ matrix.service_name }}
cache-to: type=gha,mode=max,scope=${{ matrix.service_name }}

- name: Export digest
run: |
mkdir -p /tmp/digests
digest="${{ steps.build.outputs.digest }}"
touch "/tmp/digests/${digest#sha256:}"

- name: Upload digest
uses: actions/upload-artifact@v4
with:
name: digests-${{ matrix.context }}-${{ env.PLATFORM_PAIR }}
path: /tmp/digests/*
if-no-files-found: error
retention-days: 1

create-manifest:
needs: build
runs-on: ubuntu-latest
if: github.repository == 'langgenius/dify'
strategy:
matrix:
include:
- service_name: "merge-api-images"
image_name_env: "DIFY_API_IMAGE_NAME"
context: "api"
- service_name: "merge-web-images"
image_name_env: "DIFY_WEB_IMAGE_NAME"
context: "web"
steps:
- name: Download digests
uses: actions/download-artifact@v4
with:
path: /tmp/digests
pattern: digests-${{ matrix.context }}-*
merge-multiple: true

- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ env.DOCKERHUB_USER }}
password: ${{ env.DOCKERHUB_TOKEN }}

- name: Extract metadata for Docker
id: meta
uses: docker/metadata-action@v5
with:
Expand All @@ -51,14 +130,12 @@ jobs:
type=sha,enable=true,priority=100,prefix=,suffix=,format=long
type=raw,value=${{ github.ref_name }},enable=${{ startsWith(github.ref, 'refs/tags/') }}

- name: Build and push
uses: docker/build-push-action@v5
with:
context: "{{defaultContext}}:${{ matrix.context }}"
platforms: ${{ startsWith(github.ref, 'refs/tags/') && 'linux/amd64,linux/arm64' || 'linux/amd64' }}
build-args: COMMIT_SHA=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.revision'] }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Create manifest list and push
working-directory: /tmp/digests
run: |
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
$(printf '${{ env[matrix.image_name_env] }}@sha256:%s ' *)

- name: Inspect image
run: |
docker buildx imagetools inspect ${{ env[matrix.image_name_env] }}:${{ steps.meta.outputs.version }}
5 changes: 3 additions & 2 deletions .github/workflows/style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ jobs:
**.sh
**.yaml
**.yml
Dockerfile
**Dockerfile
dev/**

- name: Super-linter
Expand All @@ -113,7 +113,8 @@ jobs:
IGNORE_GITIGNORED_FILES: true
VALIDATE_BASH: true
VALIDATE_BASH_EXEC: true
VALIDATE_GITHUB_ACTIONS: true
# FIXME: temporarily disabled until api-docker.yaml's run script is fixed for shellcheck
# VALIDATE_GITHUB_ACTIONS: true
VALIDATE_DOCKERFILE_HADOLINT: true
VALIDATE_XML: true
VALIDATE_YAML: true
5 changes: 4 additions & 1 deletion api/.dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,7 @@ logs
*.log*

# jetbrains
.idea
.idea

# venv
.venv
33 changes: 25 additions & 8 deletions api/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,28 @@
# base image
FROM python:3.10-slim-bookworm AS base
FROM python:3.10-slim-bookworm as base

LABEL maintainer="[email protected]"
WORKDIR /app/api

# Install Poetry
ENV POETRY_VERSION=1.8.3
RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir --upgrade poetry==${POETRY_VERSION}

# Configure Poetry
ENV POETRY_CACHE_DIR=/tmp/poetry_cache
ENV POETRY_NO_INTERACTION=1
ENV POETRY_VIRTUALENVS_IN_PROJECT=true
ENV POETRY_VIRTUALENVS_CREATE=true

# install packages
FROM base as packages

RUN apt-get update \
&& apt-get install -y --no-install-recommends gcc g++ libc-dev libffi-dev libgmp-dev libmpfr-dev libmpc-dev

COPY requirements.txt /requirements.txt
# Install Python dependencies
COPY pyproject.toml poetry.lock ./
RUN poetry install --sync --no-cache --no-root

RUN --mount=type=cache,target=/root/.cache/pip \
pip install --prefix=/pkg -r requirements.txt

# production stage
FROM base AS production
Expand All @@ -37,13 +47,20 @@ RUN apt-get update \
&& apt-get autoremove \
&& rm -rf /var/lib/apt/lists/*

COPY --from=packages /pkg /usr/local
# Copy Python environment and packages
ENV VIRTUAL_ENV=/app/api/.venv
COPY --from=packages ${VIRTUAL_ENV} ${VIRTUAL_ENV}
ENV PATH="${VIRTUAL_ENV}/bin:${PATH}"

# Copy source code
COPY . /app/api/

# Copy entrypoint
COPY docker/entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh


ARG COMMIT_SHA
ENV COMMIT_SHA ${COMMIT_SHA}

ENTRYPOINT ["/bin/bash", "/entrypoint.sh"]
ENTRYPOINT ["/bin/bash", "/entrypoint.sh"]
Loading
Loading