From b933c9d2063769e577de8fa4169db4e310b060bf Mon Sep 17 00:00:00 2001
From: Bowen Liang
Date: Tue, 8 Oct 2024 08:40:29 +0800
Subject: [PATCH 01/61] chore: move testing env variables from pyproject.toml
to pytest.ini (#9019)
---
api/pyproject.toml | 29 -----------------------------
api/pytest.ini | 29 +++++++++++++++++++++++++++++
2 files changed, 29 insertions(+), 29 deletions(-)
create mode 100644 api/pytest.ini
diff --git a/api/pyproject.toml b/api/pyproject.toml
index 15674004e5..0266edc4d3 100644
--- a/api/pyproject.toml
+++ b/api/pyproject.toml
@@ -96,35 +96,6 @@ ignore = [
exclude = [
]
-[tool.pytest_env]
-OPENAI_API_KEY = "sk-IamNotARealKeyJustForMockTestKawaiiiiiiiiii"
-UPSTAGE_API_KEY = "up-aaaaaaaaaaaaaaaaaaaa"
-FIREWORKS_API_KEY = "fw_aaaaaaaaaaaaaaaaaaaa"
-NOMIC_API_KEY = "nk-aaaaaaaaaaaaaaaaaaaa"
-AZURE_OPENAI_API_BASE = "https://difyai-openai.openai.azure.com"
-AZURE_OPENAI_API_KEY = "xxxxb1707exxxxxxxxxxaaxxxxxf94"
-ANTHROPIC_API_KEY = "sk-ant-api11-IamNotARealKeyJustForMockTestKawaiiiiiiiiii-NotBaka-ASkksz"
-CHATGLM_API_BASE = "http://a.abc.com:11451"
-XINFERENCE_SERVER_URL = "http://a.abc.com:11451"
-XINFERENCE_GENERATION_MODEL_UID = "generate"
-XINFERENCE_CHAT_MODEL_UID = "chat"
-XINFERENCE_EMBEDDINGS_MODEL_UID = "embedding"
-XINFERENCE_RERANK_MODEL_UID = "rerank"
-GOOGLE_API_KEY = "abcdefghijklmnopqrstuvwxyz"
-HUGGINGFACE_API_KEY = "hf-awuwuwuwuwuwuwuwuwuwuwuwuwuwuwuwuwu"
-HUGGINGFACE_TEXT_GEN_ENDPOINT_URL = "a"
-HUGGINGFACE_TEXT2TEXT_GEN_ENDPOINT_URL = "b"
-HUGGINGFACE_EMBEDDINGS_ENDPOINT_URL = "c"
-MOCK_SWITCH = "true"
-CODE_MAX_STRING_LENGTH = "80000"
-CODE_EXECUTION_ENDPOINT = "http://127.0.0.1:8194"
-CODE_EXECUTION_API_KEY = "dify-sandbox"
-FIRECRAWL_API_KEY = "fc-"
-TEI_EMBEDDING_SERVER_URL = "http://a.abc.com:11451"
-TEI_RERANK_SERVER_URL = "http://a.abc.com:11451"
-MIXEDBREAD_API_KEY = "mk-aaaaaaaaaaaaaaaaaaaa"
-VOYAGE_API_KEY = "va-aaaaaaaaaaaaaaaaaaaa"
-
[tool.poetry]
name = "dify-api"
package-mode = false
diff --git a/api/pytest.ini b/api/pytest.ini
new file mode 100644
index 0000000000..dcca08e2e5
--- /dev/null
+++ b/api/pytest.ini
@@ -0,0 +1,29 @@
+[pytest]
+env =
+ ANTHROPIC_API_KEY = sk-ant-api11-IamNotARealKeyJustForMockTestKawaiiiiiiiiii-NotBaka-ASkksz
+ AZURE_OPENAI_API_BASE = https://difyai-openai.openai.azure.com
+ AZURE_OPENAI_API_KEY = xxxxb1707exxxxxxxxxxaaxxxxxf94
+ CHATGLM_API_BASE = http://a.abc.com:11451
+ CODE_EXECUTION_API_KEY = dify-sandbox
+ CODE_EXECUTION_ENDPOINT = http://127.0.0.1:8194
+ CODE_MAX_STRING_LENGTH = 80000
+ FIRECRAWL_API_KEY = fc-
+ FIREWORKS_API_KEY = fw_aaaaaaaaaaaaaaaaaaaa
+ GOOGLE_API_KEY = abcdefghijklmnopqrstuvwxyz
+ HUGGINGFACE_API_KEY = hf-awuwuwuwuwuwuwuwuwuwuwuwuwuwuwuwuwu
+ HUGGINGFACE_EMBEDDINGS_ENDPOINT_URL = c
+ HUGGINGFACE_TEXT2TEXT_GEN_ENDPOINT_URL = b
+ HUGGINGFACE_TEXT_GEN_ENDPOINT_URL = a
+ MIXEDBREAD_API_KEY = mk-aaaaaaaaaaaaaaaaaaaa
+ MOCK_SWITCH = true
+ NOMIC_API_KEY = nk-aaaaaaaaaaaaaaaaaaaa
+ OPENAI_API_KEY = sk-IamNotARealKeyJustForMockTestKawaiiiiiiiiii
+ TEI_EMBEDDING_SERVER_URL = http://a.abc.com:11451
+ TEI_RERANK_SERVER_URL = http://a.abc.com:11451
+ UPSTAGE_API_KEY = up-aaaaaaaaaaaaaaaaaaaa
+ VOYAGE_API_KEY = va-aaaaaaaaaaaaaaaaaaaa
+ XINFERENCE_CHAT_MODEL_UID = chat
+ XINFERENCE_EMBEDDINGS_MODEL_UID = embedding
+ XINFERENCE_GENERATION_MODEL_UID = generate
+ XINFERENCE_RERANK_MODEL_UID = rerank
+ XINFERENCE_SERVER_URL = http://a.abc.com:11451
From a8b4d1ac2a17ec57b945e35b1dd59cc6e8fba759 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Sergio=20Sacrist=C3=A1n?=
Date: Tue, 8 Oct 2024 05:12:21 +0200
Subject: [PATCH 02/61] feat: Improvement- use non root user for Web container
(#8928)
---
web/Dockerfile | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/web/Dockerfile b/web/Dockerfile
index 48bdb2301a..29f7675f4a 100644
--- a/web/Dockerfile
+++ b/web/Dockerfile
@@ -46,21 +46,27 @@ ENV TZ=UTC
RUN ln -s /usr/share/zoneinfo/${TZ} /etc/localtime \
&& echo ${TZ} > /etc/timezone
-# global runtime packages
-RUN yarn global add pm2 \
- && yarn cache clean
WORKDIR /app/web
COPY --from=builder /app/web/public ./public
COPY --from=builder /app/web/.next/standalone ./
COPY --from=builder /app/web/.next/static ./.next/static
-
COPY docker/pm2.json ./pm2.json
COPY docker/entrypoint.sh ./entrypoint.sh
+
+# global runtime packages
+RUN yarn global add pm2 \
+ && yarn cache clean \
+ && mkdir /.pm2 \
+ && chown -R 1001:0 /.pm2 /app/web \
+ && chmod -R g=u /.pm2 /app/web
+
+
ARG COMMIT_SHA
ENV COMMIT_SHA=${COMMIT_SHA}
+USER 1001
EXPOSE 3000
ENTRYPOINT ["/bin/sh", "./entrypoint.sh"]
From 7c0b159a81f099c5089c96ba77b32d592e5787b8 Mon Sep 17 00:00:00 2001
From: Bowen Liang
Date: Tue, 8 Oct 2024 11:13:11 +0800
Subject: [PATCH 03/61] chore: removing unused imports in tests (#9049)
---
api/app.py | 12 ++++++------
api/poetry.lock | 2 +-
api/pyproject.toml | 11 +++++++----
.../model_runtime/__mock/anthropic.py | 2 +-
.../model_runtime/__mock/nomic_embeddings.py | 2 +-
.../model_runtime/__mock/openai_chat.py | 4 +---
.../model_runtime/__mock/openai_embeddings.py | 1 -
.../model_runtime/__mock/openai_remote.py | 1 -
.../model_runtime/__mock/xinference.py | 1 -
.../model_runtime/azure_ai_studio/test_llm.py | 3 ---
.../model_runtime/chatglm/test_llm.py | 1 -
.../model_runtime/huggingface_tei/test_rerank.py | 3 +--
.../model_runtime/localai/test_llm.py | 2 --
.../model_runtime/nomic/test_provider.py | 1 -
.../model_runtime/novita/test_llm.py | 1 -
.../integration_tests/model_runtime/oci/test_llm.py | 1 -
.../model_runtime/openai/test_llm.py | 1 -
.../model_runtime/openrouter/test_llm.py | 1 -
.../model_runtime/sagemaker/test_provider.py | 2 --
.../model_runtime/sagemaker/test_text_embedding.py | 2 --
.../model_runtime/stepfun/test_llm.py | 4 +---
.../model_runtime/togetherai/test_llm.py | 1 -
.../model_runtime/upstage/test_llm.py | 3 +--
.../model_runtime/xinference/test_llm.py | 2 --
.../integration_tests/vdb/pgvector/test_pgvector.py | 1 -
api/tests/integration_tests/vdb/test_vector_store.py | 1 -
.../workflow/nodes/__mock/code_executor.py | 2 +-
.../workflow/nodes/test_parameter_extractor.py | 1 -
.../unit_tests/core/app/segments/test_variables.py | 1 -
.../core/rag/extractor/firecrawl/test_firecrawl.py | 3 ---
30 files changed, 21 insertions(+), 52 deletions(-)
diff --git a/api/app.py b/api/app.py
index 1b58beee15..0662d94e1b 100644
--- a/api/app.py
+++ b/api/app.py
@@ -26,7 +26,7 @@ from commands import register_commands
from configs import dify_config
# DO NOT REMOVE BELOW
-from events import event_handlers
+from events import event_handlers # noqa: F401
from extensions import (
ext_celery,
ext_code_based_extension,
@@ -45,7 +45,7 @@ from extensions.ext_login import login_manager
from libs.passport import PassportService
# TODO: Find a way to avoid importing models here
-from models import account, dataset, model, source, task, tool, tools, web
+from models import account, dataset, model, source, task, tool, tools, web # noqa: F401
from services.account_service import AccountService
# DO NOT REMOVE ABOVE
@@ -181,10 +181,10 @@ def load_user_from_request(request_from_flask_login):
decoded = PassportService().verify(auth_token)
user_id = decoded.get("user_id")
- account = AccountService.load_logged_in_account(account_id=user_id, token=auth_token)
- if account:
- contexts.tenant_id.set(account.current_tenant_id)
- return account
+ logged_in_account = AccountService.load_logged_in_account(account_id=user_id, token=auth_token)
+ if logged_in_account:
+ contexts.tenant_id.set(logged_in_account.current_tenant_id)
+ return logged_in_account
@login_manager.unauthorized_handler
diff --git a/api/poetry.lock b/api/poetry.lock
index c24ec81639..4b9fdd1526 100644
--- a/api/poetry.lock
+++ b/api/poetry.lock
@@ -10595,4 +10595,4 @@ cffi = ["cffi (>=1.11)"]
[metadata]
lock-version = "2.0"
python-versions = ">=3.10,<3.13"
-content-hash = "dbcbcd7addb7c35c67f074fce00f6e25ec1e225498e5b9de3ef2fcd6af749bf6"
+content-hash = "d29d0c4ce384ef94fe65f0a2a145898bd1a117d4fd59c217d15bbb8993f4ce4e"
diff --git a/api/pyproject.toml b/api/pyproject.toml
index 0266edc4d3..1c12cc3a36 100644
--- a/api/pyproject.toml
+++ b/api/pyproject.toml
@@ -74,8 +74,6 @@ ignore = [
[tool.ruff.lint.per-file-ignores]
"app.py" = [
- "F401", # unused-import
- "F811", # redefined-while-unused
]
"__init__.py" = [
"F401", # unused-import
@@ -88,10 +86,15 @@ ignore = [
"N803", # invalid-argument-name
]
"tests/*" = [
- "F401", # unused-import
"F811", # redefined-while-unused
]
+[tool.ruff.lint.pyflakes]
+allowed-unused-imports=[
+ "_pytest.monkeypatch",
+ "tests.integration_tests",
+]
+
[tool.ruff.format]
exclude = [
]
@@ -260,4 +263,4 @@ optional = true
[tool.poetry.group.lint.dependencies]
dotenv-linter = "~0.5.0"
-ruff = "~0.6.8"
+ruff = "~0.6.9"
diff --git a/api/tests/integration_tests/model_runtime/__mock/anthropic.py b/api/tests/integration_tests/model_runtime/__mock/anthropic.py
index 79a3dc0394..5092af4f13 100644
--- a/api/tests/integration_tests/model_runtime/__mock/anthropic.py
+++ b/api/tests/integration_tests/model_runtime/__mock/anthropic.py
@@ -5,7 +5,7 @@ from typing import Any, Literal, Union
import anthropic
import pytest
from _pytest.monkeypatch import MonkeyPatch
-from anthropic import Anthropic, Stream
+from anthropic import Stream
from anthropic.resources import Messages
from anthropic.types import (
ContentBlock,
diff --git a/api/tests/integration_tests/model_runtime/__mock/nomic_embeddings.py b/api/tests/integration_tests/model_runtime/__mock/nomic_embeddings.py
index 281e866e45..6a25398cbf 100644
--- a/api/tests/integration_tests/model_runtime/__mock/nomic_embeddings.py
+++ b/api/tests/integration_tests/model_runtime/__mock/nomic_embeddings.py
@@ -1,6 +1,6 @@
import os
from collections.abc import Callable
-from typing import Any, Literal, Union
+from typing import Any, Literal
import pytest
diff --git a/api/tests/integration_tests/model_runtime/__mock/openai_chat.py b/api/tests/integration_tests/model_runtime/__mock/openai_chat.py
index 439f7d56e9..1dc5df7667 100644
--- a/api/tests/integration_tests/model_runtime/__mock/openai_chat.py
+++ b/api/tests/integration_tests/model_runtime/__mock/openai_chat.py
@@ -1,6 +1,6 @@
import re
from collections.abc import Generator
-from json import dumps, loads
+from json import dumps
from time import time
# import monkeypatch
@@ -11,11 +11,9 @@ from openai._types import NOT_GIVEN, NotGiven
from openai.resources.chat.completions import Completions
from openai.types import Completion as CompletionMessage
from openai.types.chat import (
- ChatCompletion,
ChatCompletionChunk,
ChatCompletionMessageParam,
ChatCompletionMessageToolCall,
- ChatCompletionToolChoiceOptionParam,
ChatCompletionToolParam,
completion_create_params,
)
diff --git a/api/tests/integration_tests/model_runtime/__mock/openai_embeddings.py b/api/tests/integration_tests/model_runtime/__mock/openai_embeddings.py
index e27b9891f5..3cc1fa9ff1 100644
--- a/api/tests/integration_tests/model_runtime/__mock/openai_embeddings.py
+++ b/api/tests/integration_tests/model_runtime/__mock/openai_embeddings.py
@@ -1,7 +1,6 @@
import re
from typing import Any, Literal, Union
-from openai import OpenAI
from openai._types import NOT_GIVEN, NotGiven
from openai.resources.embeddings import Embeddings
from openai.types.create_embedding_response import CreateEmbeddingResponse, Usage
diff --git a/api/tests/integration_tests/model_runtime/__mock/openai_remote.py b/api/tests/integration_tests/model_runtime/__mock/openai_remote.py
index cb8f249543..704dbad5d2 100644
--- a/api/tests/integration_tests/model_runtime/__mock/openai_remote.py
+++ b/api/tests/integration_tests/model_runtime/__mock/openai_remote.py
@@ -1,6 +1,5 @@
from time import time
-from openai.resources.models import Models
from openai.types.model import Model
diff --git a/api/tests/integration_tests/model_runtime/__mock/xinference.py b/api/tests/integration_tests/model_runtime/__mock/xinference.py
index 8deb50635f..5f7dad50c1 100644
--- a/api/tests/integration_tests/model_runtime/__mock/xinference.py
+++ b/api/tests/integration_tests/model_runtime/__mock/xinference.py
@@ -5,7 +5,6 @@ from typing import Union
import pytest
from _pytest.monkeypatch import MonkeyPatch
from requests import Response
-from requests.exceptions import ConnectionError
from requests.sessions import Session
from xinference_client.client.restful.restful_client import (
Client,
diff --git a/api/tests/integration_tests/model_runtime/azure_ai_studio/test_llm.py b/api/tests/integration_tests/model_runtime/azure_ai_studio/test_llm.py
index 8655b43d8f..85a4f7734d 100644
--- a/api/tests/integration_tests/model_runtime/azure_ai_studio/test_llm.py
+++ b/api/tests/integration_tests/model_runtime/azure_ai_studio/test_llm.py
@@ -6,10 +6,7 @@ import pytest
from core.model_runtime.entities.llm_entities import LLMResult, LLMResultChunk, LLMResultChunkDelta
from core.model_runtime.entities.message_entities import (
AssistantPromptMessage,
- ImagePromptMessageContent,
- PromptMessageTool,
SystemPromptMessage,
- TextPromptMessageContent,
UserPromptMessage,
)
from core.model_runtime.errors.validate import CredentialsValidateFailedError
diff --git a/api/tests/integration_tests/model_runtime/chatglm/test_llm.py b/api/tests/integration_tests/model_runtime/chatglm/test_llm.py
index 418e88874d..a7c5229e05 100644
--- a/api/tests/integration_tests/model_runtime/chatglm/test_llm.py
+++ b/api/tests/integration_tests/model_runtime/chatglm/test_llm.py
@@ -8,7 +8,6 @@ from core.model_runtime.entities.message_entities import (
AssistantPromptMessage,
PromptMessageTool,
SystemPromptMessage,
- TextPromptMessageContent,
UserPromptMessage,
)
from core.model_runtime.entities.model_entities import AIModelEntity
diff --git a/api/tests/integration_tests/model_runtime/huggingface_tei/test_rerank.py b/api/tests/integration_tests/model_runtime/huggingface_tei/test_rerank.py
index 45370d9fba..cd1c20dd02 100644
--- a/api/tests/integration_tests/model_runtime/huggingface_tei/test_rerank.py
+++ b/api/tests/integration_tests/model_runtime/huggingface_tei/test_rerank.py
@@ -2,8 +2,7 @@ import os
import pytest
-from core.model_runtime.entities.rerank_entities import RerankDocument, RerankResult
-from core.model_runtime.entities.text_embedding_entities import TextEmbeddingResult
+from core.model_runtime.entities.rerank_entities import RerankResult
from core.model_runtime.errors.validate import CredentialsValidateFailedError
from core.model_runtime.model_providers.huggingface_tei.rerank.rerank import (
HuggingfaceTeiRerankModel,
diff --git a/api/tests/integration_tests/model_runtime/localai/test_llm.py b/api/tests/integration_tests/model_runtime/localai/test_llm.py
index aa5436c34f..51e899fd51 100644
--- a/api/tests/integration_tests/model_runtime/localai/test_llm.py
+++ b/api/tests/integration_tests/model_runtime/localai/test_llm.py
@@ -8,10 +8,8 @@ from core.model_runtime.entities.message_entities import (
AssistantPromptMessage,
PromptMessageTool,
SystemPromptMessage,
- TextPromptMessageContent,
UserPromptMessage,
)
-from core.model_runtime.entities.model_entities import ParameterRule
from core.model_runtime.errors.validate import CredentialsValidateFailedError
from core.model_runtime.model_providers.localai.llm.llm import LocalAILanguageModel
diff --git a/api/tests/integration_tests/model_runtime/nomic/test_provider.py b/api/tests/integration_tests/model_runtime/nomic/test_provider.py
index 6cad400c06..ece4bb9200 100644
--- a/api/tests/integration_tests/model_runtime/nomic/test_provider.py
+++ b/api/tests/integration_tests/model_runtime/nomic/test_provider.py
@@ -4,7 +4,6 @@ import pytest
from core.model_runtime.errors.validate import CredentialsValidateFailedError
from core.model_runtime.model_providers.nomic.nomic import NomicAtlasProvider
-from core.model_runtime.model_providers.nomic.text_embedding.text_embedding import NomicTextEmbeddingModel
from tests.integration_tests.model_runtime.__mock.nomic_embeddings import setup_nomic_mock
diff --git a/api/tests/integration_tests/model_runtime/novita/test_llm.py b/api/tests/integration_tests/model_runtime/novita/test_llm.py
index 35fa0dc190..9f92679cd5 100644
--- a/api/tests/integration_tests/model_runtime/novita/test_llm.py
+++ b/api/tests/integration_tests/model_runtime/novita/test_llm.py
@@ -6,7 +6,6 @@ import pytest
from core.model_runtime.entities.llm_entities import LLMResult, LLMResultChunk, LLMResultChunkDelta
from core.model_runtime.entities.message_entities import (
AssistantPromptMessage,
- PromptMessageTool,
SystemPromptMessage,
UserPromptMessage,
)
diff --git a/api/tests/integration_tests/model_runtime/oci/test_llm.py b/api/tests/integration_tests/model_runtime/oci/test_llm.py
index 531f26a32e..bd5d27eb0f 100644
--- a/api/tests/integration_tests/model_runtime/oci/test_llm.py
+++ b/api/tests/integration_tests/model_runtime/oci/test_llm.py
@@ -8,7 +8,6 @@ from core.model_runtime.entities.message_entities import (
AssistantPromptMessage,
PromptMessageTool,
SystemPromptMessage,
- TextPromptMessageContent,
UserPromptMessage,
)
from core.model_runtime.errors.validate import CredentialsValidateFailedError
diff --git a/api/tests/integration_tests/model_runtime/openai/test_llm.py b/api/tests/integration_tests/model_runtime/openai/test_llm.py
index 3b3ea9ec80..41c99f6875 100644
--- a/api/tests/integration_tests/model_runtime/openai/test_llm.py
+++ b/api/tests/integration_tests/model_runtime/openai/test_llm.py
@@ -14,7 +14,6 @@ from core.model_runtime.entities.message_entities import (
)
from core.model_runtime.entities.model_entities import AIModelEntity, ModelType
from core.model_runtime.errors.validate import CredentialsValidateFailedError
-from core.model_runtime.model_providers.__base.large_language_model import LargeLanguageModel
from core.model_runtime.model_providers.openai.llm.llm import OpenAILargeLanguageModel
"""FOR MOCK FIXTURES, DO NOT REMOVE"""
diff --git a/api/tests/integration_tests/model_runtime/openrouter/test_llm.py b/api/tests/integration_tests/model_runtime/openrouter/test_llm.py
index ce4876a73a..1b0cc6bf4b 100644
--- a/api/tests/integration_tests/model_runtime/openrouter/test_llm.py
+++ b/api/tests/integration_tests/model_runtime/openrouter/test_llm.py
@@ -6,7 +6,6 @@ import pytest
from core.model_runtime.entities.llm_entities import LLMResult, LLMResultChunk, LLMResultChunkDelta
from core.model_runtime.entities.message_entities import (
AssistantPromptMessage,
- PromptMessageTool,
SystemPromptMessage,
UserPromptMessage,
)
diff --git a/api/tests/integration_tests/model_runtime/sagemaker/test_provider.py b/api/tests/integration_tests/model_runtime/sagemaker/test_provider.py
index 9f0b439d6c..41de2a17fd 100644
--- a/api/tests/integration_tests/model_runtime/sagemaker/test_provider.py
+++ b/api/tests/integration_tests/model_runtime/sagemaker/test_provider.py
@@ -1,5 +1,3 @@
-import os
-
import pytest
from core.model_runtime.errors.validate import CredentialsValidateFailedError
diff --git a/api/tests/integration_tests/model_runtime/sagemaker/test_text_embedding.py b/api/tests/integration_tests/model_runtime/sagemaker/test_text_embedding.py
index e4e404c7a8..f77601eea2 100644
--- a/api/tests/integration_tests/model_runtime/sagemaker/test_text_embedding.py
+++ b/api/tests/integration_tests/model_runtime/sagemaker/test_text_embedding.py
@@ -1,5 +1,3 @@
-import os
-
import pytest
from core.model_runtime.entities.text_embedding_entities import TextEmbeddingResult
diff --git a/api/tests/integration_tests/model_runtime/stepfun/test_llm.py b/api/tests/integration_tests/model_runtime/stepfun/test_llm.py
index c03b1bae1f..f9afca6f59 100644
--- a/api/tests/integration_tests/model_runtime/stepfun/test_llm.py
+++ b/api/tests/integration_tests/model_runtime/stepfun/test_llm.py
@@ -6,13 +6,11 @@ import pytest
from core.model_runtime.entities.llm_entities import LLMResult, LLMResultChunk, LLMResultChunkDelta
from core.model_runtime.entities.message_entities import (
AssistantPromptMessage,
- ImagePromptMessageContent,
PromptMessageTool,
SystemPromptMessage,
- TextPromptMessageContent,
UserPromptMessage,
)
-from core.model_runtime.entities.model_entities import AIModelEntity, ModelType
+from core.model_runtime.entities.model_entities import AIModelEntity
from core.model_runtime.errors.validate import CredentialsValidateFailedError
from core.model_runtime.model_providers.stepfun.llm.llm import StepfunLargeLanguageModel
diff --git a/api/tests/integration_tests/model_runtime/togetherai/test_llm.py b/api/tests/integration_tests/model_runtime/togetherai/test_llm.py
index 06ebc2a82d..5787e1bf6a 100644
--- a/api/tests/integration_tests/model_runtime/togetherai/test_llm.py
+++ b/api/tests/integration_tests/model_runtime/togetherai/test_llm.py
@@ -6,7 +6,6 @@ import pytest
from core.model_runtime.entities.llm_entities import LLMResult, LLMResultChunk, LLMResultChunkDelta
from core.model_runtime.entities.message_entities import (
AssistantPromptMessage,
- PromptMessageTool,
SystemPromptMessage,
UserPromptMessage,
)
diff --git a/api/tests/integration_tests/model_runtime/upstage/test_llm.py b/api/tests/integration_tests/model_runtime/upstage/test_llm.py
index bc7517acbe..0f39e902f3 100644
--- a/api/tests/integration_tests/model_runtime/upstage/test_llm.py
+++ b/api/tests/integration_tests/model_runtime/upstage/test_llm.py
@@ -10,9 +10,8 @@ from core.model_runtime.entities.message_entities import (
SystemPromptMessage,
UserPromptMessage,
)
-from core.model_runtime.entities.model_entities import AIModelEntity, ModelType
+from core.model_runtime.entities.model_entities import AIModelEntity
from core.model_runtime.errors.validate import CredentialsValidateFailedError
-from core.model_runtime.model_providers.__base.large_language_model import LargeLanguageModel
from core.model_runtime.model_providers.upstage.llm.llm import UpstageLargeLanguageModel
"""FOR MOCK FIXTURES, DO NOT REMOVE"""
diff --git a/api/tests/integration_tests/model_runtime/xinference/test_llm.py b/api/tests/integration_tests/model_runtime/xinference/test_llm.py
index fb5e03855d..5e4cde3638 100644
--- a/api/tests/integration_tests/model_runtime/xinference/test_llm.py
+++ b/api/tests/integration_tests/model_runtime/xinference/test_llm.py
@@ -8,10 +8,8 @@ from core.model_runtime.entities.message_entities import (
AssistantPromptMessage,
PromptMessageTool,
SystemPromptMessage,
- TextPromptMessageContent,
UserPromptMessage,
)
-from core.model_runtime.entities.model_entities import AIModelEntity
from core.model_runtime.errors.validate import CredentialsValidateFailedError
from core.model_runtime.model_providers.xinference.llm.llm import XinferenceAILargeLanguageModel
diff --git a/api/tests/integration_tests/vdb/pgvector/test_pgvector.py b/api/tests/integration_tests/vdb/pgvector/test_pgvector.py
index 72efdc2780..3d2cfde5d1 100644
--- a/api/tests/integration_tests/vdb/pgvector/test_pgvector.py
+++ b/api/tests/integration_tests/vdb/pgvector/test_pgvector.py
@@ -1,5 +1,4 @@
from core.rag.datasource.vdb.pgvector.pgvector import PGVector, PGVectorConfig
-from core.rag.models.document import Document
from tests.integration_tests.vdb.test_vector_store import (
AbstractVectorTest,
get_example_text,
diff --git a/api/tests/integration_tests/vdb/test_vector_store.py b/api/tests/integration_tests/vdb/test_vector_store.py
index a11cd225b3..50519e2052 100644
--- a/api/tests/integration_tests/vdb/test_vector_store.py
+++ b/api/tests/integration_tests/vdb/test_vector_store.py
@@ -1,4 +1,3 @@
-import random
import uuid
from unittest.mock import MagicMock
diff --git a/api/tests/integration_tests/workflow/nodes/__mock/code_executor.py b/api/tests/integration_tests/workflow/nodes/__mock/code_executor.py
index 6fb8c86b82..30414811ea 100644
--- a/api/tests/integration_tests/workflow/nodes/__mock/code_executor.py
+++ b/api/tests/integration_tests/workflow/nodes/__mock/code_executor.py
@@ -1,5 +1,5 @@
import os
-from typing import Literal, Optional
+from typing import Literal
import pytest
from _pytest.monkeypatch import MonkeyPatch
diff --git a/api/tests/integration_tests/workflow/nodes/test_parameter_extractor.py b/api/tests/integration_tests/workflow/nodes/test_parameter_extractor.py
index 88435c4022..4c695f7443 100644
--- a/api/tests/integration_tests/workflow/nodes/test_parameter_extractor.py
+++ b/api/tests/integration_tests/workflow/nodes/test_parameter_extractor.py
@@ -1,4 +1,3 @@
-import json
import os
import time
import uuid
diff --git a/api/tests/unit_tests/core/app/segments/test_variables.py b/api/tests/unit_tests/core/app/segments/test_variables.py
index b3f0ae626c..6179675cde 100644
--- a/api/tests/unit_tests/core/app/segments/test_variables.py
+++ b/api/tests/unit_tests/core/app/segments/test_variables.py
@@ -2,7 +2,6 @@ import pytest
from pydantic import ValidationError
from core.app.segments import (
- ArrayAnyVariable,
FloatVariable,
IntegerVariable,
ObjectVariable,
diff --git a/api/tests/unit_tests/core/rag/extractor/firecrawl/test_firecrawl.py b/api/tests/unit_tests/core/rag/extractor/firecrawl/test_firecrawl.py
index d5a1d8f436..8fcdf2e8e5 100644
--- a/api/tests/unit_tests/core/rag/extractor/firecrawl/test_firecrawl.py
+++ b/api/tests/unit_tests/core/rag/extractor/firecrawl/test_firecrawl.py
@@ -1,9 +1,6 @@
import os
-from unittest import mock
from core.rag.extractor.firecrawl.firecrawl_app import FirecrawlApp
-from core.rag.extractor.firecrawl.firecrawl_web_extractor import FirecrawlWebExtractor
-from core.rag.models.document import Document
from tests.unit_tests.core.rag.extractor.test_notion_extractor import _mock_response
From 4abca8614f2d24413946a3d1688720b1b304b668 Mon Sep 17 00:00:00 2001
From: NFish
Date: Tue, 8 Oct 2024 11:48:22 +0800
Subject: [PATCH 04/61] fix: Ignore the error toast notification if the status
is 401 and isPublicAPI is true (#9062)
---
web/service/base.ts | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/web/service/base.ts b/web/service/base.ts
index 83389d8be8..fbdd5c1fd3 100644
--- a/web/service/base.ts
+++ b/web/service/base.ts
@@ -359,9 +359,6 @@ const baseFetch = (
case 401: {
if (isPublicAPI) {
return bodyJson.then((data: ResponseError) => {
- if (!silent)
- Toast.notify({ type: 'error', message: data.message })
-
if (data.code === 'web_sso_auth_required')
requiredWebSSOLogin()
@@ -536,8 +533,6 @@ export const ssePost = (
.then((res) => {
if (!/^(2|3)\d{2}$/.test(String(res.status))) {
res.json().then((data: any) => {
- Toast.notify({ type: 'error', message: data.message || 'Server Error' })
-
if (isPublicAPI) {
if (data.code === 'web_sso_auth_required')
requiredWebSSOLogin()
@@ -546,7 +541,10 @@ export const ssePost = (
removeAccessToken()
globalThis.location.reload()
}
+ if (res.status === 401)
+ return
}
+ Toast.notify({ type: 'error', message: data.message || 'Server Error' })
})
onError?.('Server Error')
return
From 896998ef3fc28628a70d07e7ca483b253f3bd436 Mon Sep 17 00:00:00 2001
From: Bowen Liang
Date: Tue, 8 Oct 2024 15:11:45 +0800
Subject: [PATCH 05/61] chore: refine python dependency list and check
dependencies in order (#9061)
---
.github/workflows/api-tests.yml | 5 +-
api/poetry.lock | 2 +-
api/pyproject.toml | 73 ++++++++++---------
.../artifact_tests/dependencies/__init__.py | 0
.../dependencies/test_dependencies_sorted.py | 61 ++++++++++++++++
dev/pytest/pytest_artifacts.sh | 4 +
dev/sync-poetry | 3 +
7 files changed, 112 insertions(+), 36 deletions(-)
create mode 100644 api/tests/artifact_tests/dependencies/__init__.py
create mode 100644 api/tests/artifact_tests/dependencies/test_dependencies_sorted.py
create mode 100755 dev/pytest/pytest_artifacts.sh
diff --git a/.github/workflows/api-tests.yml b/.github/workflows/api-tests.yml
index 7c632f8a34..b1cf41a226 100644
--- a/.github/workflows/api-tests.yml
+++ b/.github/workflows/api-tests.yml
@@ -39,7 +39,7 @@ jobs:
api/pyproject.toml
api/poetry.lock
- - name: Poetry check
+ - name: Check Poetry lockfile
run: |
poetry check -C api --lock
poetry show -C api
@@ -47,6 +47,9 @@ jobs:
- name: Install dependencies
run: poetry install -C api --with dev
+ - name: Check dependencies in pyproject.toml
+ run: poetry run -C api bash dev/pytest/pytest_artifacts.sh
+
- name: Run Unit tests
run: poetry run -C api bash dev/pytest/pytest_unit_tests.sh
diff --git a/api/poetry.lock b/api/poetry.lock
index 4b9fdd1526..cf03f8c0f5 100644
--- a/api/poetry.lock
+++ b/api/poetry.lock
@@ -10595,4 +10595,4 @@ cffi = ["cffi (>=1.11)"]
[metadata]
lock-version = "2.0"
python-versions = ">=3.10,<3.13"
-content-hash = "d29d0c4ce384ef94fe65f0a2a145898bd1a117d4fd59c217d15bbb8993f4ce4e"
+content-hash = "fd183812f910faf4e840267501c571db5d758ad6eb328d106ba6f79a0322a555"
diff --git a/api/pyproject.toml b/api/pyproject.toml
index 1c12cc3a36..839df9ea67 100644
--- a/api/pyproject.toml
+++ b/api/pyproject.toml
@@ -104,25 +104,23 @@ name = "dify-api"
package-mode = false
############################################################
-# Main dependencies
+# [ Main ] Dependency group
############################################################
[tool.poetry.dependencies]
anthropic = "~0.23.1"
authlib = "1.3.1"
+azure-ai-inference = "~1.0.0b3"
+azure-ai-ml = "~1.20.0"
azure-identity = "1.16.1"
azure-storage-blob = "12.13.0"
beautifulsoup4 = "4.12.2"
boto3 = "1.35.17"
-sagemaker = "2.231.0"
bs4 = "~0.0.1"
cachetools = "~5.3.0"
celery = "~5.3.6"
chardet = "~5.1.0"
cohere = "~5.2.4"
-cos-python-sdk-v5 = "1.9.30"
-esdk-obs-python = "3.24.6.1"
-bce-python-sdk = "~0.9.23"
dashscope = { version = "~1.17.0", extras = ["tokenizer"] }
flask = "~3.0.1"
flask-compress = "~1.14"
@@ -130,7 +128,7 @@ flask-cors = "~4.0.0"
flask-login = "~0.6.3"
flask-migrate = "~4.0.5"
flask-restful = "~0.3.10"
-Flask-SQLAlchemy = "~3.1.1"
+flask-sqlalchemy = "~3.1.1"
gevent = "~23.9.1"
gmpy2 = "~2.2.1"
google-ai-generativelanguage = "0.6.9"
@@ -139,22 +137,22 @@ google-api-python-client = "2.90.0"
google-auth = "2.29.0"
google-auth-httplib2 = "0.2.0"
google-cloud-aiplatform = "1.49.0"
-google-cloud-storage = "2.16.0"
google-generativeai = "0.8.1"
googleapis-common-protos = "1.63.0"
gunicorn = "~22.0.0"
httpx = { version = "~0.27.0", extras = ["socks"] }
huggingface-hub = "~0.16.4"
jieba = "0.42.1"
-langfuse = "^2.48.0"
-langsmith = "^0.1.77"
+langfuse = "~2.51.3"
+langsmith = "~0.1.77"
mailchimp-transactional = "~1.0.50"
markdown = "~3.5.1"
-novita-client = "^0.5.7"
+nomic = "~3.1.2"
+novita-client = "~0.5.7"
numpy = "~1.26.4"
+oci = "~2.135.1"
openai = "~1.29.0"
openpyxl = "~3.1.5"
-oss2 = "2.18.5"
pandas = { version = "~2.2.2", extras = ["performance", "excel"] }
psycopg2-binary = "~2.9.6"
pycryptodome = "3.19.1"
@@ -171,7 +169,8 @@ readabilipy = "0.2.0"
redis = { version = "~5.0.3", extras = ["hiredis"] }
replicate = "~0.22.0"
resend = "~0.7.0"
-scikit-learn = "^1.5.1"
+sagemaker = "2.231.0"
+scikit-learn = "~1.5.1"
sentry-sdk = { version = "~1.44.1", extras = ["flask"] }
sqlalchemy = "~2.0.29"
tencentcloud-sdk-python-hunyuan = "~3.0.1158"
@@ -179,6 +178,8 @@ tiktoken = "~0.7.0"
tokenizers = "~0.15.0"
transformers = "~4.35.0"
unstructured = { version = "~0.10.27", extras = ["docx", "epub", "md", "msg", "ppt", "pptx"] }
+validators = "0.21.0"
+volcengine-python-sdk = {extras = ["ark"], version = "~1.0.98"}
websocket-client = "~1.7.0"
werkzeug = "~3.0.1"
xinference-client = "0.15.2"
@@ -187,32 +188,26 @@ zhipuai = "1.0.7"
# Before adding new dependency, consider place it in alphabet order (a-z) and suitable group.
############################################################
+# [ Indirect ] dependency group
# Related transparent dependencies with pinned version
# required by main implementations
############################################################
-azure-ai-ml = "^1.19.0"
-azure-ai-inference = "^1.0.0b3"
-volcengine-python-sdk = {extras = ["ark"], version = "^1.0.98"}
-oci = "^2.133.0"
-tos = "^2.7.1"
-nomic = "^3.1.2"
-validators = "0.21.0"
-[tool.poetry.group.indriect.dependencies]
+[tool.poetry.group.indirect.dependencies]
kaleido = "0.2.1"
rank-bm25 = "~0.2.2"
safetensors = "~0.4.3"
############################################################
-# Tool dependencies required by tool implementations
+# [ Tools ] dependency group
############################################################
-
-[tool.poetry.group.tool.dependencies]
+[tool.poetry.group.tools.dependencies]
arxiv = "2.1.0"
cloudscraper = "1.2.71"
-matplotlib = "~3.8.2"
-newspaper3k = "0.2.8"
duckduckgo-search = "~6.3.0"
jsonpath-ng = "1.6.1"
+matplotlib = "~3.8.2"
+newspaper3k = "0.2.8"
+nltk = "3.8.1"
numexpr = "~2.9.0"
opensearch-py = "2.4.0"
qrcode = "~7.4.2"
@@ -220,11 +215,23 @@ twilio = "~9.0.4"
vanna = { version = "0.5.5", extras = ["postgres", "mysql", "clickhouse", "duckdb"] }
wikipedia = "1.4.0"
yfinance = "~0.2.40"
-nltk = "3.8.1"
+
############################################################
-# VDB dependencies required by vector store clients
+# [ Storage ] dependency group
+# Required for storage clients
############################################################
+[tool.poetry.group.storage.dependencies]
+bce-python-sdk = "~0.9.23"
+cos-python-sdk-v5 = "1.9.30"
+esdk-obs-python = "3.24.6.1"
+google-cloud-storage = "2.16.0"
+oss2 = "2.18.5"
+tos = "~2.7.1"
+############################################################
+# [ VDB ] dependency group
+# Required by vector store clients
+############################################################
[tool.poetry.group.vdb.dependencies]
alibabacloud_gpdb20160503 = "~3.8.0"
alibabacloud_tea_openapi = "~0.3.9"
@@ -235,18 +242,17 @@ oracledb = "~2.2.1"
pgvecto-rs = { version = "~0.2.1", extras = ['sqlalchemy'] }
pgvector = "0.2.5"
pymilvus = "~2.4.4"
+qdrant-client = "1.7.3"
tcvectordb = "1.3.2"
tidb-vector = "0.0.9"
-qdrant-client = "1.7.3"
weaviate-client = "~3.21.0"
############################################################
-# Dev dependencies for running tests
+# [ Dev ] dependency group
+# Required for development and running tests
############################################################
-
[tool.poetry.group.dev]
optional = true
-
[tool.poetry.group.dev.dependencies]
coverage = "~7.2.4"
pytest = "~8.3.2"
@@ -255,12 +261,11 @@ pytest-env = "~1.1.3"
pytest-mock = "~3.14.0"
############################################################
-# Lint dependencies for code style linting
+# [ Lint ] dependency group
+# Required for code style linting
############################################################
-
[tool.poetry.group.lint]
optional = true
-
[tool.poetry.group.lint.dependencies]
dotenv-linter = "~0.5.0"
ruff = "~0.6.9"
diff --git a/api/tests/artifact_tests/dependencies/__init__.py b/api/tests/artifact_tests/dependencies/__init__.py
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/api/tests/artifact_tests/dependencies/test_dependencies_sorted.py b/api/tests/artifact_tests/dependencies/test_dependencies_sorted.py
new file mode 100644
index 0000000000..518cee1a3a
--- /dev/null
+++ b/api/tests/artifact_tests/dependencies/test_dependencies_sorted.py
@@ -0,0 +1,61 @@
+from typing import Any
+
+import toml
+
+ALL_DEPENDENCY_GROUP_NAMES = [
+ # default main group
+ "",
+ # required groups
+ "indirect",
+ "storage",
+ "tools",
+ "vdb",
+ # optional groups
+ "dev",
+ "lint",
+]
+
+
+def load_api_poetry_configs() -> dict[str, Any]:
+ pyproject_toml = toml.load("api/pyproject.toml")
+ return pyproject_toml.get("tool").get("poetry")
+
+
+def load_dependency_groups() -> dict[str, dict[str, dict[str, Any]]]:
+ poetry_configs = load_api_poetry_configs()
+ group_name_to_dependencies = {
+ group_name: (poetry_configs.get("group").get(group_name) if group_name else poetry_configs).get("dependencies")
+ for group_name in ALL_DEPENDENCY_GROUP_NAMES
+ }
+ return group_name_to_dependencies
+
+
+def test_group_dependencies_sorted():
+ for group_name, dependencies in load_dependency_groups().items():
+ dependency_names = list(dependencies.keys())
+ expected_dependency_names = sorted(set(dependency_names))
+ section = f"tool.poetry.group.{group_name}.dependencies" if group_name else "tool.poetry.dependencies"
+ assert expected_dependency_names == dependency_names, (
+ f"Dependencies in group {group_name} are not sorted. "
+ f"Check and fix [{section}] section in pyproject.toml file"
+ )
+
+
+def test_group_dependencies_version_operator():
+ for group_name, dependencies in load_dependency_groups().items():
+ for dependency_name, specification in dependencies.items():
+ version_spec = specification if isinstance(specification, str) else specification.get("version")
+ assert not version_spec.startswith("^"), (
+ f"'^' is not allowed in dependency version," f" but found in '{dependency_name} = {version_spec}'"
+ )
+
+
+def test_duplicated_dependency_crossing_groups():
+ all_dependency_names: list[str] = []
+ for dependencies in load_dependency_groups().values():
+ dependency_names = list(dependencies.keys())
+ all_dependency_names.extend(dependency_names)
+ expected_all_dependency_names = set(all_dependency_names)
+ assert sorted(expected_all_dependency_names) == sorted(
+ all_dependency_names
+ ), "Duplicated dependencies crossing groups are found"
diff --git a/dev/pytest/pytest_artifacts.sh b/dev/pytest/pytest_artifacts.sh
new file mode 100755
index 0000000000..d52acb2273
--- /dev/null
+++ b/dev/pytest/pytest_artifacts.sh
@@ -0,0 +1,4 @@
+#!/bin/bash
+set -x
+
+pytest api/tests/artifact_tests/
diff --git a/dev/sync-poetry b/dev/sync-poetry
index 2dd4dd4fc3..23d5d79e90 100755
--- a/dev/sync-poetry
+++ b/dev/sync-poetry
@@ -11,5 +11,8 @@ poetry check -C api --lock
if [ $? -ne 0 ]; then
# update poetry.lock
# refreshing lockfile only without updating locked versions
+ echo "poetry.lock is outdated, refreshing without updating locked versions ..."
poetry lock -C api --no-update
+else
+ echo "poetry.lock is ready."
fi
From 966e65bb66207b7cc538719d34c669019321e63d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E9=9D=9E=E6=B3=95=E6=93=8D=E4=BD=9C?=
Date: Tue, 8 Oct 2024 15:36:31 +0800
Subject: [PATCH 06/61] fix: zhipu ai web_search not work (#9058)
---
.../model_runtime/model_providers/zhipuai/llm/llm.py | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/api/core/model_runtime/model_providers/zhipuai/llm/llm.py b/api/core/model_runtime/model_providers/zhipuai/llm/llm.py
index ea331701ab..e0c4980523 100644
--- a/api/core/model_runtime/model_providers/zhipuai/llm/llm.py
+++ b/api/core/model_runtime/model_providers/zhipuai/llm/llm.py
@@ -223,6 +223,16 @@ class ZhipuAILargeLanguageModel(_CommonZhipuaiAI, LargeLanguageModel):
else:
new_prompt_messages.append(copy_prompt_message)
+ # zhipuai moved web_search param to tools
+ if "web_search" in model_parameters:
+ enable_web_search = model_parameters.get("web_search")
+ model_parameters.pop("web_search")
+ web_search_params = {"type": "web_search", "web_search": {"enable": enable_web_search}}
+ if "tools" in model_parameters:
+ model_parameters["tools"].append(web_search_params)
+ else:
+ model_parameters["tools"] = [web_search_params]
+
if model in {"glm-4v", "glm-4v-plus"}:
params = self._construct_glm_4v_parameter(model, new_prompt_messages, model_parameters)
else:
From 0564e8a284314e6f4664fa718260446743da56d6 Mon Sep 17 00:00:00 2001
From: Sota Oizumi <60801230+sotazum@users.noreply.github.com>
Date: Tue, 8 Oct 2024 16:39:47 +0900
Subject: [PATCH 07/61] docs: Add Google Cloud Terraform to README (#9065)
---
README.md | 6 +++++-
README_AR.md | 5 ++++-
README_CN.md | 6 +++++-
README_ES.md | 5 ++++-
README_FR.md | 5 ++++-
README_JA.md | 7 +++++--
README_KL.md | 7 +++++--
README_KR.md | 7 +++++--
README_TR.md | 8 ++++++--
README_VI.md | 6 +++++-
10 files changed, 48 insertions(+), 14 deletions(-)
diff --git a/README.md b/README.md
index 1c49c415fe..ac4a4e5839 100644
--- a/README.md
+++ b/README.md
@@ -196,10 +196,14 @@ If you'd like to configure a highly-available setup, there are community-contrib
#### Using Terraform for Deployment
+Deploy Dify to Cloud Platform with a single click using [terraform](https://www.terraform.io/)
+
##### Azure Global
-Deploy Dify to Azure with a single click using [terraform](https://www.terraform.io/).
- [Azure Terraform by @nikawang](https://github.com/nikawang/dify-azure-terraform)
+##### Google Cloud
+- [Google Cloud Terraform by @sotazum](https://github.com/DeNA/dify-google-cloud-terraform)
+
## Contributing
For those who'd like to contribute code, see our [Contribution Guide](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md).
diff --git a/README_AR.md b/README_AR.md
index 10d572cc49..42dbd9edff 100644
--- a/README_AR.md
+++ b/README_AR.md
@@ -179,10 +179,13 @@ docker compose up -d
#### استخدام Terraform للتوزيع
+انشر Dify إلى منصة السحابة بنقرة واحدة باستخدام [terraform](https://www.terraform.io/)
+
##### Azure Global
-استخدم [terraform](https://www.terraform.io/) لنشر Dify على Azure بنقرة واحدة.
- [Azure Terraform بواسطة @nikawang](https://github.com/nikawang/dify-azure-terraform)
+##### Google Cloud
+- [Google Cloud Terraform بواسطة @sotazum](https://github.com/DeNA/dify-google-cloud-terraform)
## المساهمة
diff --git a/README_CN.md b/README_CN.md
index 32551fcc31..afeca3147b 100644
--- a/README_CN.md
+++ b/README_CN.md
@@ -202,10 +202,14 @@ docker compose up -d
#### 使用 Terraform 部署
+使用 [terraform](https://www.terraform.io/) 一键将 Dify 部署到云平台
+
##### Azure Global
-使用 [terraform](https://www.terraform.io/) 一键部署 Dify 到 Azure。
- [Azure Terraform by @nikawang](https://github.com/nikawang/dify-azure-terraform)
+##### Google Cloud
+- [Google Cloud Terraform by @sotazum](https://github.com/DeNA/dify-google-cloud-terraform)
+
## Star History
[](https://star-history.com/#langgenius/dify&Date)
diff --git a/README_ES.md b/README_ES.md
index 2ae044b328..a6296aa93d 100644
--- a/README_ES.md
+++ b/README_ES.md
@@ -204,10 +204,13 @@ Si desea configurar una configuración de alta disponibilidad, la comunidad prop
#### Uso de Terraform para el despliegue
+Despliega Dify en una plataforma en la nube con un solo clic utilizando [terraform](https://www.terraform.io/)
+
##### Azure Global
-Utiliza [terraform](https://www.terraform.io/) para desplegar Dify en Azure con un solo clic.
- [Azure Terraform por @nikawang](https://github.com/nikawang/dify-azure-terraform)
+##### Google Cloud
+- [Google Cloud Terraform por @sotazum](https://github.com/DeNA/dify-google-cloud-terraform)
## Contribuir
diff --git a/README_FR.md b/README_FR.md
index 681d596749..da8b7baa3e 100644
--- a/README_FR.md
+++ b/README_FR.md
@@ -202,10 +202,13 @@ Si vous souhaitez configurer une configuration haute disponibilité, la communau
#### Utilisation de Terraform pour le déploiement
+Déployez Dify sur une plateforme cloud en un clic en utilisant [terraform](https://www.terraform.io/)
+
##### Azure Global
-Utilisez [terraform](https://www.terraform.io/) pour déployer Dify sur Azure en un clic.
- [Azure Terraform par @nikawang](https://github.com/nikawang/dify-azure-terraform)
+##### Google Cloud
+- [Google Cloud Terraform par @sotazum](https://github.com/DeNA/dify-google-cloud-terraform)
## Contribuer
diff --git a/README_JA.md b/README_JA.md
index 98966d6c38..8c6076362b 100644
--- a/README_JA.md
+++ b/README_JA.md
@@ -201,10 +201,13 @@ docker compose up -d
#### Terraformを使用したデプロイ
+[terraform](https://www.terraform.io/) を使用して、ワンクリックでDifyをクラウドプラットフォームにデプロイします
+
##### Azure Global
-[terraform](https://www.terraform.io/) を使用して、AzureにDifyをワンクリックでデプロイします。
-- [nikawangのAzure Terraform](https://github.com/nikawang/dify-azure-terraform)
+- [@nikawangによるAzure Terraform](https://github.com/nikawang/dify-azure-terraform)
+##### Google Cloud
+- [@sotazumによるGoogle Cloud Terraform](https://github.com/DeNA/dify-google-cloud-terraform)
## 貢献
diff --git a/README_KL.md b/README_KL.md
index 04620d42bb..ce2f78570b 100644
--- a/README_KL.md
+++ b/README_KL.md
@@ -202,10 +202,13 @@ If you'd like to configure a highly-available setup, there are community-contrib
#### Terraform atorlugu pilersitsineq
+wa'logh nIqHom neH ghun deployment toy'wI' [terraform](https://www.terraform.io/) lo'laH.
+
##### Azure Global
-Atoruk [terraform](https://www.terraform.io/) Dify-mik Azure-mut ataatsikkut ikkussuilluarlugu.
-- [Azure Terraform atorlugu @nikawang](https://github.com/nikawang/dify-azure-terraform)
+- [Azure Terraform mung @nikawang](https://github.com/nikawang/dify-azure-terraform)
+##### Google Cloud
+- [Google Cloud Terraform qachlot @sotazum](https://github.com/DeNA/dify-google-cloud-terraform)
## Contributing
diff --git a/README_KR.md b/README_KR.md
index a5f3bc68d0..87409bfb8c 100644
--- a/README_KR.md
+++ b/README_KR.md
@@ -39,7 +39,6 @@
-
@@ -195,10 +194,14 @@ Dify를 Kubernetes에 배포하고 프리미엄 스케일링 설정을 구성했
#### Terraform을 사용한 배포
+[terraform](https://www.terraform.io/)을 사용하여 단 한 번의 클릭으로 Dify를 클라우드 플랫폼에 배포하십시오
+
##### Azure Global
-[terraform](https://www.terraform.io/)을 사용하여 Azure에 Dify를 원클릭으로 배포하세요.
- [nikawang의 Azure Terraform](https://github.com/nikawang/dify-azure-terraform)
+##### Google Cloud
+- [sotazum의 Google Cloud Terraform](https://github.com/DeNA/dify-google-cloud-terraform)
+
## 기여
코드에 기여하고 싶은 분들은 [기여 가이드](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md)를 참조하세요.
diff --git a/README_TR.md b/README_TR.md
index 54b6db3f82..08080a8c7b 100644
--- a/README_TR.md
+++ b/README_TR.md
@@ -200,9 +200,13 @@ Yüksek kullanılabilirliğe sahip bir kurulum yapılandırmak isterseniz, Dify'
#### Dağıtım için Terraform Kullanımı
+Dify'ı bulut platformuna tek tıklamayla dağıtın [terraform](https://www.terraform.io/) kullanarak
+
##### Azure Global
-[Terraform](https://www.terraform.io/) kullanarak Dify'ı Azure'a tek tıklamayla dağıtın.
-- [@nikawang tarafından Azure Terraform](https://github.com/nikawang/dify-azure-terraform)
+- [Azure Terraform tarafından @nikawang](https://github.com/nikawang/dify-azure-terraform)
+
+##### Google Cloud
+- [Google Cloud Terraform tarafından @sotazum](https://github.com/DeNA/dify-google-cloud-terraform)
## Katkıda Bulunma
diff --git a/README_VI.md b/README_VI.md
index 6d4035eceb..d67f024c79 100644
--- a/README_VI.md
+++ b/README_VI.md
@@ -196,10 +196,14 @@ Nếu bạn muốn cấu hình một cài đặt có độ sẵn sàng cao, có
#### Sử dụng Terraform để Triển khai
+Triển khai Dify lên nền tảng đám mây với một cú nhấp chuột bằng cách sử dụng [terraform](https://www.terraform.io/)
+
##### Azure Global
-Triển khai Dify lên Azure chỉ với một cú nhấp chuột bằng cách sử dụng [terraform](https://www.terraform.io/).
- [Azure Terraform bởi @nikawang](https://github.com/nikawang/dify-azure-terraform)
+##### Google Cloud
+- [Google Cloud Terraform bởi @sotazum](https://github.com/DeNA/dify-google-cloud-terraform)
+
## Đóng góp
Đối với những người muốn đóng góp mã, xem [Hướng dẫn Đóng góp](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md) của chúng tôi.
From e741ee2f45f8d60e789ceb5bec05f25ebccaf124 Mon Sep 17 00:00:00 2001
From: Infinitnet <6189915+infinitnet@users.noreply.github.com>
Date: Tue, 8 Oct 2024 10:06:47 +0200
Subject: [PATCH 08/61] Correct max_tokens for OpenRouter Sonnet 3.5 (#9068)
---
.../model_providers/openrouter/llm/claude-3-5-sonnet.yaml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/api/core/model_runtime/model_providers/openrouter/llm/claude-3-5-sonnet.yaml b/api/core/model_runtime/model_providers/openrouter/llm/claude-3-5-sonnet.yaml
index 40558854e2..e829048e55 100644
--- a/api/core/model_runtime/model_providers/openrouter/llm/claude-3-5-sonnet.yaml
+++ b/api/core/model_runtime/model_providers/openrouter/llm/claude-3-5-sonnet.yaml
@@ -27,9 +27,9 @@ parameter_rules:
- name: max_tokens
use_template: max_tokens
required: true
- default: 4096
+ default: 8192
min: 1
- max: 4096
+ max: 8192
- name: response_format
use_template: response_format
pricing:
From 8204e0e14adbacff155855fcb810488dcc9c84bb Mon Sep 17 00:00:00 2001
From: gaocarri
Date: Tue, 8 Oct 2024 17:25:33 +0800
Subject: [PATCH 09/61] fix: Count exception occurs when searching
conversations (#8754)
Co-authored-by: zheng.gao
---
api/controllers/console/app/conversation.py | 1 +
1 file changed, 1 insertion(+)
diff --git a/api/controllers/console/app/conversation.py b/api/controllers/console/app/conversation.py
index df7bd352af..c1e16b3b9b 100644
--- a/api/controllers/console/app/conversation.py
+++ b/api/controllers/console/app/conversation.py
@@ -188,6 +188,7 @@ class ChatConversationApi(Resource):
subquery.c.from_end_user_session_id.ilike(keyword_filter),
),
)
+ .group_by(Conversation.id)
)
account = current_user
From 5213650fed92e3b693dc997534d406ce47c8e7e5 Mon Sep 17 00:00:00 2001
From: zhuhao <37029601+hwzhuhao@users.noreply.github.com>
Date: Tue, 8 Oct 2024 19:07:53 +0800
Subject: [PATCH 10/61] feat: update the xinf tool's API key to optional
(#9073)
---
.../builtin/xinference/tools/stable_diffusion.py | 15 +++++++++------
.../provider/builtin/xinference/xinference.py | 14 ++++++++++----
.../provider/builtin/xinference/xinference.yaml | 2 +-
3 files changed, 20 insertions(+), 11 deletions(-)
diff --git a/api/core/tools/provider/builtin/xinference/tools/stable_diffusion.py b/api/core/tools/provider/builtin/xinference/tools/stable_diffusion.py
index 847f2730f2..a44d3b730a 100644
--- a/api/core/tools/provider/builtin/xinference/tools/stable_diffusion.py
+++ b/api/core/tools/provider/builtin/xinference/tools/stable_diffusion.py
@@ -104,14 +104,15 @@ class StableDiffusionTool(BuiltinTool):
model = self.runtime.credentials.get("model", None)
if not model:
return self.create_text_message("Please input model")
-
+ api_key = self.runtime.credentials.get("api_key") or "abc"
+ headers = {"Authorization": f"Bearer {api_key}"}
# set model
try:
url = str(URL(base_url) / "sdapi" / "v1" / "options")
response = post(
url,
json={"sd_model_checkpoint": model},
- headers={"Authorization": f"Bearer {self.runtime.credentials['api_key']}"},
+ headers=headers,
)
if response.status_code != 200:
raise ToolProviderCredentialValidationError("Failed to set model, please tell user to set model")
@@ -257,14 +258,15 @@ class StableDiffusionTool(BuiltinTool):
draw_options["prompt"] = f"{lora},{prompt}"
else:
draw_options["prompt"] = prompt
-
+ api_key = self.runtime.credentials.get("api_key") or "abc"
+ headers = {"Authorization": f"Bearer {api_key}"}
try:
url = str(URL(base_url) / "sdapi" / "v1" / "img2img")
response = post(
url,
json=draw_options,
timeout=120,
- headers={"Authorization": f"Bearer {self.runtime.credentials['api_key']}"},
+ headers=headers,
)
if response.status_code != 200:
return self.create_text_message("Failed to generate image")
@@ -298,14 +300,15 @@ class StableDiffusionTool(BuiltinTool):
else:
draw_options["prompt"] = prompt
draw_options["override_settings"]["sd_model_checkpoint"] = model
-
+ api_key = self.runtime.credentials.get("api_key") or "abc"
+ headers = {"Authorization": f"Bearer {api_key}"}
try:
url = str(URL(base_url) / "sdapi" / "v1" / "txt2img")
response = post(
url,
json=draw_options,
timeout=120,
- headers={"Authorization": f"Bearer {self.runtime.credentials['api_key']}"},
+ headers=headers,
)
if response.status_code != 200:
return self.create_text_message("Failed to generate image")
diff --git a/api/core/tools/provider/builtin/xinference/xinference.py b/api/core/tools/provider/builtin/xinference/xinference.py
index 7c2428cc00..9692e4060e 100644
--- a/api/core/tools/provider/builtin/xinference/xinference.py
+++ b/api/core/tools/provider/builtin/xinference/xinference.py
@@ -6,12 +6,18 @@ from core.tools.provider.builtin_tool_provider import BuiltinToolProviderControl
class XinferenceProvider(BuiltinToolProviderController):
def _validate_credentials(self, credentials: dict) -> None:
- base_url = credentials.get("base_url")
- api_key = credentials.get("api_key")
- model = credentials.get("model")
+ base_url = credentials.get("base_url", "").removesuffix("/")
+ api_key = credentials.get("api_key", "")
+ if not api_key:
+ api_key = "abc"
+ credentials["api_key"] = api_key
+ model = credentials.get("model", "")
+ if not base_url or not model:
+ raise ToolProviderCredentialValidationError("Xinference base_url and model is required")
+ headers = {"Authorization": f"Bearer {api_key}"}
res = requests.post(
f"{base_url}/sdapi/v1/options",
- headers={"Authorization": f"Bearer {api_key}"},
+ headers=headers,
json={"sd_model_checkpoint": model},
)
if res.status_code != 200:
diff --git a/api/core/tools/provider/builtin/xinference/xinference.yaml b/api/core/tools/provider/builtin/xinference/xinference.yaml
index 19aaf5cbd1..b0c02b9cbc 100644
--- a/api/core/tools/provider/builtin/xinference/xinference.yaml
+++ b/api/core/tools/provider/builtin/xinference/xinference.yaml
@@ -31,7 +31,7 @@ credentials_for_provider:
zh_Hans: 请输入你的模型名称
api_key:
type: secret-input
- required: true
+ required: false
label:
en_US: API Key
zh_Hans: Xinference 服务器的 API Key
From 7121afdd4426648b99055b7041b5e99bc7b1ad3a Mon Sep 17 00:00:00 2001
From: Dongsheng Zhao <41723543+Blackman99@users.noreply.github.com>
Date: Tue, 8 Oct 2024 19:58:03 +0800
Subject: [PATCH 11/61] fix: #8969 (#9076)
---
.../base/chat/embedded-chatbot/theme/theme-context.ts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/web/app/components/base/chat/embedded-chatbot/theme/theme-context.ts b/web/app/components/base/chat/embedded-chatbot/theme/theme-context.ts
index fd424cd046..7a814e2521 100644
--- a/web/app/components/base/chat/embedded-chatbot/theme/theme-context.ts
+++ b/web/app/components/base/chat/embedded-chatbot/theme/theme-context.ts
@@ -26,7 +26,7 @@ export class Theme {
if (this.chatColorTheme !== null && this.chatColorTheme !== '') {
this.primaryColor = this.chatColorTheme ?? '#1C64F2'
this.backgroundHeaderColorStyle = `backgroundColor: ${this.primaryColor}`
- this.backgroundButtonDefaultColorStyle = `backgroundColor: ${this.primaryColor}`
+ this.backgroundButtonDefaultColorStyle = `backgroundColor: ${this.primaryColor}; color: ${colorFontOnHeaderStyle};`
this.roundedBackgroundColorStyle = `backgroundColor: ${hexToRGBA(this.primaryColor, 0.05)}`
this.chatBubbleColorStyle = `backgroundColor: ${hexToRGBA(this.primaryColor, 0.15)}`
this.chatBubbleColor = `${hexToRGBA(this.primaryColor, 0.15)}`
From 5b7de7705ebf1eba29f891ff2e6d7a22063a6284 Mon Sep 17 00:00:00 2001
From: zhuhao <37029601+hwzhuhao@users.noreply.github.com>
Date: Tue, 8 Oct 2024 23:25:11 +0800
Subject: [PATCH 12/61] feat: add timestamp conversion and timestamp retrieval
for time tool (#9085)
---
.../time/tools/localtime_to_timestamp.py | 44 +++++++++++++++++++
.../time/tools/localtime_to_timestamp.yaml | 33 ++++++++++++++
.../time/tools/timestamp_to_localtime.py | 44 +++++++++++++++++++
.../time/tools/timestamp_to_localtime.yaml | 33 ++++++++++++++
4 files changed, 154 insertions(+)
create mode 100644 api/core/tools/provider/builtin/time/tools/localtime_to_timestamp.py
create mode 100644 api/core/tools/provider/builtin/time/tools/localtime_to_timestamp.yaml
create mode 100644 api/core/tools/provider/builtin/time/tools/timestamp_to_localtime.py
create mode 100644 api/core/tools/provider/builtin/time/tools/timestamp_to_localtime.yaml
diff --git a/api/core/tools/provider/builtin/time/tools/localtime_to_timestamp.py b/api/core/tools/provider/builtin/time/tools/localtime_to_timestamp.py
new file mode 100644
index 0000000000..e16b732d02
--- /dev/null
+++ b/api/core/tools/provider/builtin/time/tools/localtime_to_timestamp.py
@@ -0,0 +1,44 @@
+from datetime import datetime
+from typing import Any, Union
+
+import pytz
+
+from core.tools.entities.tool_entities import ToolInvokeMessage
+from core.tools.errors import ToolInvokeError
+from core.tools.tool.builtin_tool import BuiltinTool
+
+
+class LocaltimeToTimestampTool(BuiltinTool):
+ def _invoke(
+ self,
+ user_id: str,
+ tool_parameters: dict[str, Any],
+ ) -> Union[ToolInvokeMessage, list[ToolInvokeMessage]]:
+ """
+ Convert localtime to timestamp
+ """
+ localtime = tool_parameters.get("localtime")
+ timezone = tool_parameters.get("timezone", "Asia/Shanghai")
+ if not timezone:
+ timezone = None
+ time_format = "%Y-%m-%d %H:%M:%S"
+
+ timestamp = self.localtime_to_timestamp(localtime, time_format, timezone)
+ if not timestamp:
+ return self.create_text_message(f"Invalid localtime: {localtime}")
+
+ return self.create_text_message(f"{timestamp}")
+
+ @staticmethod
+ def localtime_to_timestamp(localtime: str, time_format: str, local_tz=None) -> int | None:
+ try:
+ if local_tz is None:
+ local_tz = datetime.now().astimezone().tzinfo
+ if isinstance(local_tz, str):
+ local_tz = pytz.timezone(local_tz)
+ local_time = datetime.strptime(localtime, time_format)
+ localtime = local_tz.localize(local_time)
+ timestamp = int(localtime.timestamp())
+ return timestamp
+ except Exception as e:
+ raise ToolInvokeError(str(e))
diff --git a/api/core/tools/provider/builtin/time/tools/localtime_to_timestamp.yaml b/api/core/tools/provider/builtin/time/tools/localtime_to_timestamp.yaml
new file mode 100644
index 0000000000..6a3b90595f
--- /dev/null
+++ b/api/core/tools/provider/builtin/time/tools/localtime_to_timestamp.yaml
@@ -0,0 +1,33 @@
+identity:
+ name: localtime_to_timestamp
+ author: zhuhao
+ label:
+ en_US: localtime to timestamp
+ zh_Hans: 获取时间戳
+description:
+ human:
+ en_US: A tool for localtime convert to timestamp
+ zh_Hans: 获取时间戳
+ llm: A tool for localtime convert to timestamp
+parameters:
+ - name: localtime
+ type: string
+ required: true
+ form: llm
+ label:
+ en_US: localtime
+ zh_Hans: 本地时间
+ human_description:
+ en_US: localtime, such as 2024-1-1 0:0:0
+ zh_Hans: 本地时间, 比如2024-1-1 0:0:0
+ - name: timezone
+ type: string
+ required: false
+ form: llm
+ label:
+ en_US: Timezone
+ zh_Hans: 时区
+ human_description:
+ en_US: Timezone, such as Asia/Shanghai
+ zh_Hans: 时区, 比如Asia/Shanghai
+ default: Asia/Shanghai
diff --git a/api/core/tools/provider/builtin/time/tools/timestamp_to_localtime.py b/api/core/tools/provider/builtin/time/tools/timestamp_to_localtime.py
new file mode 100644
index 0000000000..bcdd34fd4e
--- /dev/null
+++ b/api/core/tools/provider/builtin/time/tools/timestamp_to_localtime.py
@@ -0,0 +1,44 @@
+from datetime import datetime
+from typing import Any, Union
+
+import pytz
+
+from core.tools.entities.tool_entities import ToolInvokeMessage
+from core.tools.errors import ToolInvokeError
+from core.tools.tool.builtin_tool import BuiltinTool
+
+
+class TimestampToLocaltimeTool(BuiltinTool):
+ def _invoke(
+ self,
+ user_id: str,
+ tool_parameters: dict[str, Any],
+ ) -> Union[ToolInvokeMessage, list[ToolInvokeMessage]]:
+ """
+ Convert timestamp to localtime
+ """
+ timestamp = tool_parameters.get("timestamp")
+ timezone = tool_parameters.get("timezone", "Asia/Shanghai")
+ if not timezone:
+ timezone = None
+ time_format = "%Y-%m-%d %H:%M:%S"
+
+ locatime = self.timestamp_to_localtime(timestamp, timezone)
+ if not locatime:
+ return self.create_text_message(f"Invalid timestamp: {timestamp}")
+
+ localtime_format = locatime.strftime(time_format)
+
+ return self.create_text_message(f"{localtime_format}")
+
+ @staticmethod
+ def timestamp_to_localtime(timestamp: int, local_tz=None) -> datetime | None:
+ try:
+ if local_tz is None:
+ local_tz = datetime.now().astimezone().tzinfo
+ if isinstance(local_tz, str):
+ local_tz = pytz.timezone(local_tz)
+ local_time = datetime.fromtimestamp(timestamp, local_tz)
+ return local_time
+ except Exception as e:
+ raise ToolInvokeError(str(e))
diff --git a/api/core/tools/provider/builtin/time/tools/timestamp_to_localtime.yaml b/api/core/tools/provider/builtin/time/tools/timestamp_to_localtime.yaml
new file mode 100644
index 0000000000..3794e717b4
--- /dev/null
+++ b/api/core/tools/provider/builtin/time/tools/timestamp_to_localtime.yaml
@@ -0,0 +1,33 @@
+identity:
+ name: timestamp_to_localtime
+ author: zhuhao
+ label:
+ en_US: Timestamp to localtime
+ zh_Hans: 时间戳转换
+description:
+ human:
+ en_US: A tool for timestamp convert to localtime
+ zh_Hans: 时间戳转换
+ llm: A tool for timestamp convert to localtime
+parameters:
+ - name: timestamp
+ type: number
+ required: true
+ form: llm
+ label:
+ en_US: Timestamp
+ zh_Hans: 时间戳
+ human_description:
+ en_US: Timestamp
+ zh_Hans: 时间戳
+ - name: timezone
+ type: string
+ required: false
+ form: llm
+ label:
+ en_US: Timezone
+ zh_Hans: 时区
+ human_description:
+ en_US: Timezone, such as Asia/Shanghai
+ zh_Hans: 时区, 比如Asia/Shanghai
+ default: Asia/Shanghai
From 3a0734d94cbcd0da4cc106006e5dcfbe2113c13c Mon Sep 17 00:00:00 2001
From: crazywoola <100913391+crazywoola@users.noreply.github.com>
Date: Wed, 9 Oct 2024 01:00:10 +0800
Subject: [PATCH 13/61] Feat/9081 add support for llamaguard through groq
provider (#9083)
---
.../model_providers/groq/llm/_position.yaml | 1 +
.../groq/llm/llama-guard-3-8b.yaml | 25 +++++++++++++++++++
2 files changed, 26 insertions(+)
create mode 100644 api/core/model_runtime/model_providers/groq/llm/llama-guard-3-8b.yaml
diff --git a/api/core/model_runtime/model_providers/groq/llm/_position.yaml b/api/core/model_runtime/model_providers/groq/llm/_position.yaml
index be115ca920..0613b19f87 100644
--- a/api/core/model_runtime/model_providers/groq/llm/_position.yaml
+++ b/api/core/model_runtime/model_providers/groq/llm/_position.yaml
@@ -5,3 +5,4 @@
- llama3-8b-8192
- mixtral-8x7b-32768
- llama2-70b-4096
+- llama-guard-3-8b
diff --git a/api/core/model_runtime/model_providers/groq/llm/llama-guard-3-8b.yaml b/api/core/model_runtime/model_providers/groq/llm/llama-guard-3-8b.yaml
new file mode 100644
index 0000000000..03779ccc66
--- /dev/null
+++ b/api/core/model_runtime/model_providers/groq/llm/llama-guard-3-8b.yaml
@@ -0,0 +1,25 @@
+model: llama-guard-3-8b
+label:
+ zh_Hans: Llama-Guard-3-8B
+ en_US: Llama-Guard-3-8B
+model_type: llm
+features:
+ - agent-thought
+model_properties:
+ mode: chat
+ context_size: 8192
+parameter_rules:
+ - name: temperature
+ use_template: temperature
+ - name: top_p
+ use_template: top_p
+ - name: max_tokens
+ use_template: max_tokens
+ default: 512
+ min: 1
+ max: 8192
+pricing:
+ input: '0.20'
+ output: '0.20'
+ unit: '0.000001'
+ currency: USD
From 0540995e5c9f14f9b5ad19ba794dc5f9a8671142 Mon Sep 17 00:00:00 2001
From: Pika
Date: Wed, 9 Oct 2024 10:22:20 +0800
Subject: [PATCH 14/61] fix: prompt-editor regex.lastIndex needed to reset
(#9097)
Co-authored-by: Chen(MAC)
---
...kflow-variable-block-replacement-block.tsx | 5 +++--
web/config/index.ts | 22 ++++++++++---------
2 files changed, 15 insertions(+), 12 deletions(-)
diff --git a/web/app/components/base/prompt-editor/plugins/workflow-variable-block/workflow-variable-block-replacement-block.tsx b/web/app/components/base/prompt-editor/plugins/workflow-variable-block/workflow-variable-block-replacement-block.tsx
index c88b1661ad..0a80ecc220 100644
--- a/web/app/components/base/prompt-editor/plugins/workflow-variable-block/workflow-variable-block-replacement-block.tsx
+++ b/web/app/components/base/prompt-editor/plugins/workflow-variable-block/workflow-variable-block-replacement-block.tsx
@@ -12,7 +12,7 @@ import type { WorkflowVariableBlockType } from '../../types'
import { CustomTextNode } from '../custom-text/node'
import { $createWorkflowVariableBlockNode } from './node'
import { WorkflowVariableBlockNode } from './index'
-import { VAR_REGEX as REGEX } from '@/config'
+import { VAR_REGEX as REGEX, resetReg } from '@/config'
const WorkflowVariableBlockReplacementBlock = ({
workflowNodesMap,
@@ -48,11 +48,12 @@ const WorkflowVariableBlockReplacementBlock = ({
}, [])
const transformListener = useCallback((textNode: any) => {
+ resetReg()
return decoratorTransform(textNode, getMatch, createWorkflowVariableBlockNode)
}, [createWorkflowVariableBlockNode, getMatch])
useEffect(() => {
- REGEX.lastIndex = 0
+ resetReg()
return mergeRegister(
editor.registerNodeTransform(CustomTextNode, transformListener),
)
diff --git a/web/config/index.ts b/web/config/index.ts
index 21fc2f211c..9eb4889441 100644
--- a/web/config/index.ts
+++ b/web/config/index.ts
@@ -158,28 +158,28 @@ export const DEFAULT_AGENT_SETTING = {
}
export const DEFAULT_AGENT_PROMPT = {
- chat: `Respond to the human as helpfully and accurately as possible.
+ chat: `Respond to the human as helpfully and accurately as possible.
{{instruction}}
-
+
You have access to the following tools:
-
+
{{tools}}
-
+
Use a json blob to specify a tool by providing an {{TOOL_NAME_KEY}} key (tool name) and an {{ACTION_INPUT_KEY}} key (tool input).
Valid "{{TOOL_NAME_KEY}}" values: "Final Answer" or {{tool_names}}
-
+
Provide only ONE action per $JSON_BLOB, as shown:
-
+
\`\`\`
{
"{{TOOL_NAME_KEY}}": $TOOL_NAME,
"{{ACTION_INPUT_KEY}}": $ACTION_INPUT
}
\`\`\`
-
+
Follow this format:
-
+
Question: input question to answer
Thought: consider previous and subsequent steps
Action:
@@ -196,10 +196,10 @@ export const DEFAULT_AGENT_PROMPT = {
"{{ACTION_INPUT_KEY}}": "Final response to human"
}
\`\`\`
-
+
Begin! Reminder to ALWAYS respond with a valid json blob of a single action. Use tools if necessary. Respond directly if appropriate. Format is Action:\`\`\`$JSON_BLOB\`\`\`then Observation:.`,
completion: `
- Respond to the human as helpfully and accurately as possible.
+ Respond to the human as helpfully and accurately as possible.
{{instruction}}
@@ -246,6 +246,8 @@ Thought: {{agent_scratchpad}}
export const VAR_REGEX = /\{\{(#[a-zA-Z0-9_-]{1,50}(\.[a-zA-Z_][a-zA-Z0-9_]{0,29}){1,10}#)\}\}/gi
+export const resetReg = () => VAR_REGEX.lastIndex = 0
+
export let textGenerationTimeoutMs = 60000
if (process.env.NEXT_PUBLIC_TEXT_GENERATION_TIMEOUT_MS && process.env.NEXT_PUBLIC_TEXT_GENERATION_TIMEOUT_MS !== '')
From 57994e4a244c7087cf6a9e282c20e0edc784cef5 Mon Sep 17 00:00:00 2001
From: ybalbert001 <120714773+ybalbert001@users.noreply.github.com>
Date: Wed, 9 Oct 2024 10:23:21 +0800
Subject: [PATCH 15/61] fix s3 presign url check problem, support two
versions(v2,v4) (#9093)
Co-authored-by: Yuanbo Li
---
api/core/file/message_file_parser.py | 36 +++++++++++++++++++++-------
1 file changed, 27 insertions(+), 9 deletions(-)
diff --git a/api/core/file/message_file_parser.py b/api/core/file/message_file_parser.py
index 83059b216e..641686bd7c 100644
--- a/api/core/file/message_file_parser.py
+++ b/api/core/file/message_file_parser.py
@@ -198,16 +198,34 @@ class MessageFileParser:
if "amazonaws.com" not in parsed_url.netloc:
return False
query_params = parse_qs(parsed_url.query)
- required_params = ["Signature", "Expires"]
- for param in required_params:
- if param not in query_params:
+
+ def check_presign_v2(query_params):
+ required_params = ["Signature", "Expires"]
+ for param in required_params:
+ if param not in query_params:
+ return False
+ if not query_params["Expires"][0].isdigit():
return False
- if not query_params["Expires"][0].isdigit():
- return False
- signature = query_params["Signature"][0]
- if not re.match(r"^[A-Za-z0-9+/]+={0,2}$", signature):
- return False
- return True
+ signature = query_params["Signature"][0]
+ if not re.match(r"^[A-Za-z0-9+/]+={0,2}$", signature):
+ return False
+
+ return True
+
+ def check_presign_v4(query_params):
+ required_params = ["X-Amz-Signature", "X-Amz-Expires"]
+ for param in required_params:
+ if param not in query_params:
+ return False
+ if not query_params["X-Amz-Expires"][0].isdigit():
+ return False
+ signature = query_params["X-Amz-Signature"][0]
+ if not re.match(r"^[A-Za-z0-9+/]+={0,2}$", signature):
+ return False
+
+ return True
+
+ return check_presign_v4(query_params) or check_presign_v2(query_params)
except Exception:
return False
From f8af9c6ad01587a133f1729eaaf0cf142f5ceabd Mon Sep 17 00:00:00 2001
From: SebastjanPrachovskij
<86522260+SebastjanPrachovskij@users.noreply.github.com>
Date: Wed, 9 Oct 2024 05:24:09 +0300
Subject: [PATCH 16/61] refactor: Update countries & languages list for
SearchApi engines (#9090)
---
.../builtin/searchapi/tools/google.yaml | 1526 ++++++++++++++++-
.../builtin/searchapi/tools/google_jobs.yaml | 1043 ++++++++++-
.../builtin/searchapi/tools/google_news.yaml | 1526 ++++++++++++++++-
3 files changed, 3950 insertions(+), 145 deletions(-)
diff --git a/api/core/tools/provider/builtin/searchapi/tools/google.yaml b/api/core/tools/provider/builtin/searchapi/tools/google.yaml
index b69a0e1d3e..0dc1b66724 100644
--- a/api/core/tools/provider/builtin/searchapi/tools/google.yaml
+++ b/api/core/tools/provider/builtin/searchapi/tools/google.yaml
@@ -65,206 +65,1206 @@ parameters:
form: form
default: US
options:
+ - value: AF
+ label:
+ en_US: Afghanistan
+ zh_Hans: 阿富汗
+ pt_BR: Afeganistão
+ - value: AL
+ label:
+ en_US: Albania
+ zh_Hans: 阿尔巴尼亚
+ pt_BR: Albânia
+ - value: DZ
+ label:
+ en_US: Algeria
+ zh_Hans: 阿尔及利亚
+ pt_BR: Argélia
+ - value: AS
+ label:
+ en_US: American Samoa
+ zh_Hans: 美属萨摩亚
+ pt_BR: Samoa Americana
+ - value: AD
+ label:
+ en_US: Andorra
+ zh_Hans: 安道尔
+ pt_BR: Andorra
+ - value: AO
+ label:
+ en_US: Angola
+ zh_Hans: 安哥拉
+ pt_BR: Angola
+ - value: AI
+ label:
+ en_US: Anguilla
+ zh_Hans: 安圭拉
+ pt_BR: Anguilla
+ - value: AQ
+ label:
+ en_US: Antarctica
+ zh_Hans: 南极洲
+ pt_BR: Antártica
+ - value: AG
+ label:
+ en_US: Antigua and Barbuda
+ zh_Hans: 安提瓜和巴布达
+ pt_BR: Antígua e Barbuda
- value: AR
label:
en_US: Argentina
zh_Hans: 阿根廷
pt_BR: Argentina
+ - value: AM
+ label:
+ en_US: Armenia
+ zh_Hans: 亚美尼亚
+ pt_BR: Armênia
+ - value: AW
+ label:
+ en_US: Aruba
+ zh_Hans: 阿鲁巴
+ pt_BR: Aruba
- value: AU
label:
en_US: Australia
zh_Hans: 澳大利亚
- pt_BR: Australia
+ pt_BR: Austrália
- value: AT
label:
en_US: Austria
zh_Hans: 奥地利
- pt_BR: Austria
+ pt_BR: Áustria
+ - value: AZ
+ label:
+ en_US: Azerbaijan
+ zh_Hans: 阿塞拜疆
+ pt_BR: Azerbaijão
+ - value: BS
+ label:
+ en_US: Bahamas
+ zh_Hans: 巴哈马
+ pt_BR: Bahamas
+ - value: BH
+ label:
+ en_US: Bahrain
+ zh_Hans: 巴林
+ pt_BR: Bahrein
+ - value: BD
+ label:
+ en_US: Bangladesh
+ zh_Hans: 孟加拉国
+ pt_BR: Bangladesh
+ - value: BB
+ label:
+ en_US: Barbados
+ zh_Hans: 巴巴多斯
+ pt_BR: Barbados
+ - value: BY
+ label:
+ en_US: Belarus
+ zh_Hans: 白俄罗斯
+ pt_BR: Bielorrússia
- value: BE
label:
en_US: Belgium
zh_Hans: 比利时
- pt_BR: Belgium
+ pt_BR: Bélgica
+ - value: BZ
+ label:
+ en_US: Belize
+ zh_Hans: 伯利兹
+ pt_BR: Belize
+ - value: BJ
+ label:
+ en_US: Benin
+ zh_Hans: 贝宁
+ pt_BR: Benim
+ - value: BM
+ label:
+ en_US: Bermuda
+ zh_Hans: 百慕大
+ pt_BR: Bermudas
+ - value: BT
+ label:
+ en_US: Bhutan
+ zh_Hans: 不丹
+ pt_BR: Butão
+ - value: BO
+ label:
+ en_US: Bolivia
+ zh_Hans: 玻利维亚
+ pt_BR: Bolívia
+ - value: BA
+ label:
+ en_US: Bosnia and Herzegovina
+ zh_Hans: 波斯尼亚和黑塞哥维那
+ pt_BR: Bósnia e Herzegovina
+ - value: BW
+ label:
+ en_US: Botswana
+ zh_Hans: 博茨瓦纳
+ pt_BR: Botsuana
+ - value: BV
+ label:
+ en_US: Bouvet Island
+ zh_Hans: 布韦岛
+ pt_BR: Ilha Bouvet
- value: BR
label:
en_US: Brazil
zh_Hans: 巴西
- pt_BR: Brazil
+ pt_BR: Brasil
+ - value: IO
+ label:
+ en_US: British Indian Ocean Territory
+ zh_Hans: 英属印度洋领地
+ pt_BR: Território Britânico do Oceano Índico
+ - value: BN
+ label:
+ en_US: Brunei Darussalam
+ zh_Hans: 文莱
+ pt_BR: Brunei Darussalam
+ - value: BG
+ label:
+ en_US: Bulgaria
+ zh_Hans: 保加利亚
+ pt_BR: Bulgária
+ - value: BF
+ label:
+ en_US: Burkina Faso
+ zh_Hans: 布基纳法索
+ pt_BR: Burkina Faso
+ - value: BI
+ label:
+ en_US: Burundi
+ zh_Hans: 布隆迪
+ pt_BR: Burundi
+ - value: KH
+ label:
+ en_US: Cambodia
+ zh_Hans: 柬埔寨
+ pt_BR: Camboja
+ - value: CM
+ label:
+ en_US: Cameroon
+ zh_Hans: 喀麦隆
+ pt_BR: Camarões
- value: CA
label:
en_US: Canada
zh_Hans: 加拿大
- pt_BR: Canada
+ pt_BR: Canadá
+ - value: CV
+ label:
+ en_US: Cape Verde
+ zh_Hans: 佛得角
+ pt_BR: Cabo Verde
+ - value: KY
+ label:
+ en_US: Cayman Islands
+ zh_Hans: 开曼群岛
+ pt_BR: Ilhas Cayman
+ - value: CF
+ label:
+ en_US: Central African Republic
+ zh_Hans: 中非共和国
+ pt_BR: República Centro-Africana
+ - value: TD
+ label:
+ en_US: Chad
+ zh_Hans: 乍得
+ pt_BR: Chade
- value: CL
label:
en_US: Chile
zh_Hans: 智利
pt_BR: Chile
- - value: CO
- label:
- en_US: Colombia
- zh_Hans: 哥伦比亚
- pt_BR: Colombia
- value: CN
label:
en_US: China
zh_Hans: 中国
pt_BR: China
+ - value: CX
+ label:
+ en_US: Christmas Island
+ zh_Hans: 圣诞岛
+ pt_BR: Ilha do Natal
+ - value: CC
+ label:
+ en_US: Cocos (Keeling) Islands
+ zh_Hans: 科科斯(基林)群岛
+ pt_BR: Ilhas Cocos (Keeling)
+ - value: CO
+ label:
+ en_US: Colombia
+ zh_Hans: 哥伦比亚
+ pt_BR: Colômbia
+ - value: KM
+ label:
+ en_US: Comoros
+ zh_Hans: 科摩罗
+ pt_BR: Comores
+ - value: CG
+ label:
+ en_US: Congo
+ zh_Hans: 刚果
+ pt_BR: Congo
+ - value: CD
+ label:
+ en_US: Congo, the Democratic Republic of the
+ zh_Hans: 刚果民主共和国
+ pt_BR: Congo, República Democrática do
+ - value: CK
+ label:
+ en_US: Cook Islands
+ zh_Hans: 库克群岛
+ pt_BR: Ilhas Cook
+ - value: CR
+ label:
+ en_US: Costa Rica
+ zh_Hans: 哥斯达黎加
+ pt_BR: Costa Rica
+ - value: CI
+ label:
+ en_US: Cote D'ivoire
+ zh_Hans: 科特迪瓦
+ pt_BR: Costa do Marfim
+ - value: HR
+ label:
+ en_US: Croatia
+ zh_Hans: 克罗地亚
+ pt_BR: Croácia
+ - value: CU
+ label:
+ en_US: Cuba
+ zh_Hans: 古巴
+ pt_BR: Cuba
+ - value: CY
+ label:
+ en_US: Cyprus
+ zh_Hans: 塞浦路斯
+ pt_BR: Chipre
- value: CZ
label:
en_US: Czech Republic
zh_Hans: 捷克共和国
- pt_BR: Czech Republic
+ pt_BR: República Tcheca
- value: DK
label:
en_US: Denmark
zh_Hans: 丹麦
- pt_BR: Denmark
+ pt_BR: Dinamarca
+ - value: DJ
+ label:
+ en_US: Djibouti
+ zh_Hans: 吉布提
+ pt_BR: Djibuti
+ - value: DM
+ label:
+ en_US: Dominica
+ zh_Hans: 多米尼克
+ pt_BR: Dominica
+ - value: DO
+ label:
+ en_US: Dominican Republic
+ zh_Hans: 多米尼加共和国
+ pt_BR: República Dominicana
+ - value: EC
+ label:
+ en_US: Ecuador
+ zh_Hans: 厄瓜多尔
+ pt_BR: Equador
+ - value: EG
+ label:
+ en_US: Egypt
+ zh_Hans: 埃及
+ pt_BR: Egito
+ - value: SV
+ label:
+ en_US: El Salvador
+ zh_Hans: 萨尔瓦多
+ pt_BR: El Salvador
+ - value: GQ
+ label:
+ en_US: Equatorial Guinea
+ zh_Hans: 赤道几内亚
+ pt_BR: Guiné Equatorial
+ - value: ER
+ label:
+ en_US: Eritrea
+ zh_Hans: 厄立特里亚
+ pt_BR: Eritreia
+ - value: EE
+ label:
+ en_US: Estonia
+ zh_Hans: 爱沙尼亚
+ pt_BR: Estônia
+ - value: ET
+ label:
+ en_US: Ethiopia
+ zh_Hans: 埃塞俄比亚
+ pt_BR: Etiópia
+ - value: FK
+ label:
+ en_US: Falkland Islands (Malvinas)
+ zh_Hans: 福克兰群岛(马尔维纳斯)
+ pt_BR: Ilhas Falkland (Malvinas)
+ - value: FO
+ label:
+ en_US: Faroe Islands
+ zh_Hans: 法罗群岛
+ pt_BR: Ilhas Faroe
+ - value: FJ
+ label:
+ en_US: Fiji
+ zh_Hans: 斐济
+ pt_BR: Fiji
- value: FI
label:
en_US: Finland
zh_Hans: 芬兰
- pt_BR: Finland
+ pt_BR: Finlândia
- value: FR
label:
en_US: France
zh_Hans: 法国
- pt_BR: France
+ pt_BR: França
+ - value: GF
+ label:
+ en_US: French Guiana
+ zh_Hans: 法属圭亚那
+ pt_BR: Guiana Francesa
+ - value: PF
+ label:
+ en_US: French Polynesia
+ zh_Hans: 法属波利尼西亚
+ pt_BR: Polinésia Francesa
+ - value: TF
+ label:
+ en_US: French Southern Territories
+ zh_Hans: 法属南部领地
+ pt_BR: Territórios Franceses do Sul
+ - value: GA
+ label:
+ en_US: Gabon
+ zh_Hans: 加蓬
+ pt_BR: Gabão
+ - value: GM
+ label:
+ en_US: Gambia
+ zh_Hans: 冈比亚
+ pt_BR: Gâmbia
+ - value: GE
+ label:
+ en_US: Georgia
+ zh_Hans: 格鲁吉亚
+ pt_BR: Geórgia
- value: DE
label:
en_US: Germany
zh_Hans: 德国
- pt_BR: Germany
+ pt_BR: Alemanha
+ - value: GH
+ label:
+ en_US: Ghana
+ zh_Hans: 加纳
+ pt_BR: Gana
+ - value: GI
+ label:
+ en_US: Gibraltar
+ zh_Hans: 直布罗陀
+ pt_BR: Gibraltar
+ - value: GR
+ label:
+ en_US: Greece
+ zh_Hans: 希腊
+ pt_BR: Grécia
+ - value: GL
+ label:
+ en_US: Greenland
+ zh_Hans: 格陵兰
+ pt_BR: Groenlândia
+ - value: GD
+ label:
+ en_US: Grenada
+ zh_Hans: 格林纳达
+ pt_BR: Granada
+ - value: GP
+ label:
+ en_US: Guadeloupe
+ zh_Hans: 瓜德罗普
+ pt_BR: Guadalupe
+ - value: GU
+ label:
+ en_US: Guam
+ zh_Hans: 关岛
+ pt_BR: Guam
+ - value: GT
+ label:
+ en_US: Guatemala
+ zh_Hans: 危地马拉
+ pt_BR: Guatemala
+ - value: GN
+ label:
+ en_US: Guinea
+ zh_Hans: 几内亚
+ pt_BR: Guiné
+ - value: GW
+ label:
+ en_US: Guinea-Bissau
+ zh_Hans: 几内亚比绍
+ pt_BR: Guiné-Bissau
+ - value: GY
+ label:
+ en_US: Guyana
+ zh_Hans: 圭亚那
+ pt_BR: Guiana
+ - value: HT
+ label:
+ en_US: Haiti
+ zh_Hans: 海地
+ pt_BR: Haiti
+ - value: HM
+ label:
+ en_US: Heard Island and McDonald Islands
+ zh_Hans: 赫德岛和麦克唐纳群岛
+ pt_BR: Ilha Heard e Ilhas McDonald
+ - value: VA
+ label:
+ en_US: Holy See (Vatican City State)
+ zh_Hans: 教廷(梵蒂冈城国)
+ pt_BR: Santa Sé (Estado da Cidade do Vaticano)
+ - value: HN
+ label:
+ en_US: Honduras
+ zh_Hans: 洪都拉斯
+ pt_BR: Honduras
- value: HK
label:
en_US: Hong Kong
zh_Hans: 香港
pt_BR: Hong Kong
+ - value: HU
+ label:
+ en_US: Hungary
+ zh_Hans: 匈牙利
+ pt_BR: Hungria
+ - value: IS
+ label:
+ en_US: Iceland
+ zh_Hans: 冰岛
+ pt_BR: Islândia
- value: IN
label:
en_US: India
zh_Hans: 印度
- pt_BR: India
+ pt_BR: Índia
- value: ID
label:
en_US: Indonesia
zh_Hans: 印度尼西亚
- pt_BR: Indonesia
+ pt_BR: Indonésia
+ - value: IR
+ label:
+ en_US: Iran, Islamic Republic of
+ zh_Hans: 伊朗
+ pt_BR: Irã
+ - value: IQ
+ label:
+ en_US: Iraq
+ zh_Hans: 伊拉克
+ pt_BR: Iraque
+ - value: IE
+ label:
+ en_US: Ireland
+ zh_Hans: 爱尔兰
+ pt_BR: Irlanda
+ - value: IL
+ label:
+ en_US: Israel
+ zh_Hans: 以色列
+ pt_BR: Israel
- value: IT
label:
en_US: Italy
zh_Hans: 意大利
- pt_BR: Italy
+ pt_BR: Itália
+ - value: JM
+ label:
+ en_US: Jamaica
+ zh_Hans: 牙买加
+ pt_BR: Jamaica
- value: JP
label:
en_US: Japan
zh_Hans: 日本
- pt_BR: Japan
+ pt_BR: Japão
+ - value: JO
+ label:
+ en_US: Jordan
+ zh_Hans: 约旦
+ pt_BR: Jordânia
+ - value: KZ
+ label:
+ en_US: Kazakhstan
+ zh_Hans: 哈萨克斯坦
+ pt_BR: Cazaquistão
+ - value: KE
+ label:
+ en_US: Kenya
+ zh_Hans: 肯尼亚
+ pt_BR: Quênia
+ - value: KI
+ label:
+ en_US: Kiribati
+ zh_Hans: 基里巴斯
+ pt_BR: Kiribati
+ - value: KP
+ label:
+ en_US: Korea, Democratic People's Republic of
+ zh_Hans: 朝鲜
+ pt_BR: Coreia, República Democrática Popular da
- value: KR
label:
- en_US: Korea
+ en_US: Korea, Republic of
zh_Hans: 韩国
- pt_BR: Korea
+ pt_BR: Coreia, República da
+ - value: KW
+ label:
+ en_US: Kuwait
+ zh_Hans: 科威特
+ pt_BR: Kuwait
+ - value: KG
+ label:
+ en_US: Kyrgyzstan
+ zh_Hans: 吉尔吉斯斯坦
+ pt_BR: Quirguistão
+ - value: LA
+ label:
+ en_US: Lao People's Democratic Republic
+ zh_Hans: 老挝
+ pt_BR: República Democrática Popular do Laos
+ - value: LV
+ label:
+ en_US: Latvia
+ zh_Hans: 拉脱维亚
+ pt_BR: Letônia
+ - value: LB
+ label:
+ en_US: Lebanon
+ zh_Hans: 黎巴嫩
+ pt_BR: Líbano
+ - value: LS
+ label:
+ en_US: Lesotho
+ zh_Hans: 莱索托
+ pt_BR: Lesoto
+ - value: LR
+ label:
+ en_US: Liberia
+ zh_Hans: 利比里亚
+ pt_BR: Libéria
+ - value: LY
+ label:
+ en_US: Libyan Arab Jamahiriya
+ zh_Hans: 利比亚
+ pt_BR: Líbia
+ - value: LI
+ label:
+ en_US: Liechtenstein
+ zh_Hans: 列支敦士登
+ pt_BR: Liechtenstein
+ - value: LT
+ label:
+ en_US: Lithuania
+ zh_Hans: 立陶宛
+ pt_BR: Lituânia
+ - value: LU
+ label:
+ en_US: Luxembourg
+ zh_Hans: 卢森堡
+ pt_BR: Luxemburgo
+ - value: MO
+ label:
+ en_US: Macao
+ zh_Hans: 澳门
+ pt_BR: Macau
+ - value: MK
+ label:
+ en_US: Macedonia, the Former Yugosalv Republic of
+ zh_Hans: 前南斯拉夫马其顿共和国
+ pt_BR: Macedônia, Ex-República Iugoslava da
+ - value: MG
+ label:
+ en_US: Madagascar
+ zh_Hans: 马达加斯加
+ pt_BR: Madagascar
+ - value: MW
+ label:
+ en_US: Malawi
+ zh_Hans: 马拉维
+ pt_BR: Malaui
- value: MY
label:
en_US: Malaysia
zh_Hans: 马来西亚
- pt_BR: Malaysia
+ pt_BR: Malásia
+ - value: MV
+ label:
+ en_US: Maldives
+ zh_Hans: 马尔代夫
+ pt_BR: Maldivas
+ - value: ML
+ label:
+ en_US: Mali
+ zh_Hans: 马里
+ pt_BR: Mali
+ - value: MT
+ label:
+ en_US: Malta
+ zh_Hans: 马耳他
+ pt_BR: Malta
+ - value: MH
+ label:
+ en_US: Marshall Islands
+ zh_Hans: 马绍尔群岛
+ pt_BR: Ilhas Marshall
+ - value: MQ
+ label:
+ en_US: Martinique
+ zh_Hans: 马提尼克
+ pt_BR: Martinica
+ - value: MR
+ label:
+ en_US: Mauritania
+ zh_Hans: 毛里塔尼亚
+ pt_BR: Mauritânia
+ - value: MU
+ label:
+ en_US: Mauritius
+ zh_Hans: 毛里求斯
+ pt_BR: Maurício
+ - value: YT
+ label:
+ en_US: Mayotte
+ zh_Hans: 马约特
+ pt_BR: Mayotte
- value: MX
label:
en_US: Mexico
zh_Hans: 墨西哥
- pt_BR: Mexico
+ pt_BR: México
+ - value: FM
+ label:
+ en_US: Micronesia, Federated States of
+ zh_Hans: 密克罗尼西亚联邦
+ pt_BR: Micronésia, Estados Federados da
+ - value: MD
+ label:
+ en_US: Moldova, Republic of
+ zh_Hans: 摩尔多瓦共和国
+ pt_BR: Moldávia, República da
+ - value: MC
+ label:
+ en_US: Monaco
+ zh_Hans: 摩纳哥
+ pt_BR: Mônaco
+ - value: MN
+ label:
+ en_US: Mongolia
+ zh_Hans: 蒙古
+ pt_BR: Mongólia
+ - value: MS
+ label:
+ en_US: Montserrat
+ zh_Hans: 蒙特塞拉特
+ pt_BR: Montserrat
+ - value: MA
+ label:
+ en_US: Morocco
+ zh_Hans: 摩洛哥
+ pt_BR: Marrocos
+ - value: MZ
+ label:
+ en_US: Mozambique
+ zh_Hans: 莫桑比克
+ pt_BR: Moçambique
+ - value: MM
+ label:
+ en_US: Myanmar
+ zh_Hans: 缅甸
+ pt_BR: Mianmar
+ - value: NA
+ label:
+ en_US: Namibia
+ zh_Hans: 纳米比亚
+ pt_BR: Namíbia
+ - value: NR
+ label:
+ en_US: Nauru
+ zh_Hans: 瑙鲁
+ pt_BR: Nauru
+ - value: NP
+ label:
+ en_US: Nepal
+ zh_Hans: 尼泊尔
+ pt_BR: Nepal
- value: NL
label:
en_US: Netherlands
zh_Hans: 荷兰
- pt_BR: Netherlands
+ pt_BR: Países Baixos
+ - value: AN
+ label:
+ en_US: Netherlands Antilles
+ zh_Hans: 荷属安的列斯
+ pt_BR: Antilhas Holandesas
+ - value: NC
+ label:
+ en_US: New Caledonia
+ zh_Hans: 新喀里多尼亚
+ pt_BR: Nova Caledônia
- value: NZ
label:
en_US: New Zealand
zh_Hans: 新西兰
- pt_BR: New Zealand
- - value: 'NO'
+ pt_BR: Nova Zelândia
+ - value: NI
+ label:
+ en_US: Nicaragua
+ zh_Hans: 尼加拉瓜
+ pt_BR: Nicarágua
+ - value: NE
+ label:
+ en_US: Niger
+ zh_Hans: 尼日尔
+ pt_BR: Níger
+ - value: NG
+ label:
+ en_US: Nigeria
+ zh_Hans: 尼日利亚
+ pt_BR: Nigéria
+ - value: NU
+ label:
+ en_US: Niue
+ zh_Hans: 纽埃
+ pt_BR: Niue
+ - value: NF
+ label:
+ en_US: Norfolk Island
+ zh_Hans: 诺福克岛
+ pt_BR: Ilha Norfolk
+ - value: MP
+ label:
+ en_US: Northern Mariana Islands
+ zh_Hans: 北马里亚纳群岛
+ pt_BR: Ilhas Marianas do Norte
+ - value: "NO"
label:
en_US: Norway
zh_Hans: 挪威
- pt_BR: Norway
+ pt_BR: Noruega
+ - value: OM
+ label:
+ en_US: Oman
+ zh_Hans: 阿曼
+ pt_BR: Omã
+ - value: PK
+ label:
+ en_US: Pakistan
+ zh_Hans: 巴基斯坦
+ pt_BR: Paquistão
+ - value: PW
+ label:
+ en_US: Palau
+ zh_Hans: 帕劳
+ pt_BR: Palau
+ - value: PS
+ label:
+ en_US: Palestinian Territory, Occupied
+ zh_Hans: 巴勒斯坦领土
+ pt_BR: Palestina, Território Ocupado
+ - value: PA
+ label:
+ en_US: Panama
+ zh_Hans: 巴拿马
+ pt_BR: Panamá
+ - value: PG
+ label:
+ en_US: Papua New Guinea
+ zh_Hans: 巴布亚新几内亚
+ pt_BR: Papua Nova Guiné
+ - value: PY
+ label:
+ en_US: Paraguay
+ zh_Hans: 巴拉圭
+ pt_BR: Paraguai
+ - value: PE
+ label:
+ en_US: Peru
+ zh_Hans: 秘鲁
+ pt_BR: Peru
- value: PH
label:
en_US: Philippines
zh_Hans: 菲律宾
- pt_BR: Philippines
+ pt_BR: Filipinas
+ - value: PN
+ label:
+ en_US: Pitcairn
+ zh_Hans: 皮特凯恩岛
+ pt_BR: Pitcairn
- value: PL
label:
en_US: Poland
zh_Hans: 波兰
- pt_BR: Poland
+ pt_BR: Polônia
- value: PT
label:
en_US: Portugal
zh_Hans: 葡萄牙
pt_BR: Portugal
+ - value: PR
+ label:
+ en_US: Puerto Rico
+ zh_Hans: 波多黎各
+ pt_BR: Porto Rico
+ - value: QA
+ label:
+ en_US: Qatar
+ zh_Hans: 卡塔尔
+ pt_BR: Catar
+ - value: RE
+ label:
+ en_US: Reunion
+ zh_Hans: 留尼旺
+ pt_BR: Reunião
+ - value: RO
+ label:
+ en_US: Romania
+ zh_Hans: 罗马尼亚
+ pt_BR: Romênia
- value: RU
label:
- en_US: Russia
- zh_Hans: 俄罗斯
- pt_BR: Russia
+ en_US: Russian Federation
+ zh_Hans: 俄罗斯联邦
+ pt_BR: Rússia
+ - value: RW
+ label:
+ en_US: Rwanda
+ zh_Hans: 卢旺达
+ pt_BR: Ruanda
+ - value: SH
+ label:
+ en_US: Saint Helena
+ zh_Hans: 圣赫勒拿
+ pt_BR: Santa Helena
+ - value: KN
+ label:
+ en_US: Saint Kitts and Nevis
+ zh_Hans: 圣基茨和尼维斯
+ pt_BR: São Cristóvão e Nevis
+ - value: LC
+ label:
+ en_US: Saint Lucia
+ zh_Hans: 圣卢西亚
+ pt_BR: Santa Lúcia
+ - value: PM
+ label:
+ en_US: Saint Pierre and Miquelon
+ zh_Hans: 圣皮埃尔和密克隆
+ pt_BR: São Pedro e Miquelon
+ - value: VC
+ label:
+ en_US: Saint Vincent and the Grenadines
+ zh_Hans: 圣文森特和格林纳丁斯
+ pt_BR: São Vicente e Granadinas
+ - value: WS
+ label:
+ en_US: Samoa
+ zh_Hans: 萨摩亚
+ pt_BR: Samoa
+ - value: SM
+ label:
+ en_US: San Marino
+ zh_Hans: 圣马力诺
+ pt_BR: San Marino
+ - value: ST
+ label:
+ en_US: Sao Tome and Principe
+ zh_Hans: 圣多美和普林西比
+ pt_BR: São Tomé e Príncipe
- value: SA
label:
en_US: Saudi Arabia
zh_Hans: 沙特阿拉伯
- pt_BR: Saudi Arabia
+ pt_BR: Arábia Saudita
+ - value: SN
+ label:
+ en_US: Senegal
+ zh_Hans: 塞内加尔
+ pt_BR: Senegal
+ - value: RS
+ label:
+ en_US: Serbia and Montenegro
+ zh_Hans: 塞尔维亚和黑山
+ pt_BR: Sérvia e Montenegro
+ - value: SC
+ label:
+ en_US: Seychelles
+ zh_Hans: 塞舌尔
+ pt_BR: Seicheles
+ - value: SL
+ label:
+ en_US: Sierra Leone
+ zh_Hans: 塞拉利昂
+ pt_BR: Serra Leoa
- value: SG
label:
en_US: Singapore
zh_Hans: 新加坡
- pt_BR: Singapore
+ pt_BR: Singapura
+ - value: SK
+ label:
+ en_US: Slovakia
+ zh_Hans: 斯洛伐克
+ pt_BR: Eslováquia
+ - value: SI
+ label:
+ en_US: Slovenia
+ zh_Hans: 斯洛文尼亚
+ pt_BR: Eslovênia
+ - value: SB
+ label:
+ en_US: Solomon Islands
+ zh_Hans: 所罗门群岛
+ pt_BR: Ilhas Salomão
+ - value: SO
+ label:
+ en_US: Somalia
+ zh_Hans: 索马里
+ pt_BR: Somália
- value: ZA
label:
en_US: South Africa
zh_Hans: 南非
- pt_BR: South Africa
+ pt_BR: África do Sul
+ - value: GS
+ label:
+ en_US: South Georgia and the South Sandwich Islands
+ zh_Hans: 南乔治亚和南桑威奇群岛
+ pt_BR: Geórgia do Sul e Ilhas Sandwich do Sul
- value: ES
label:
en_US: Spain
zh_Hans: 西班牙
- pt_BR: Spain
+ pt_BR: Espanha
+ - value: LK
+ label:
+ en_US: Sri Lanka
+ zh_Hans: 斯里兰卡
+ pt_BR: Sri Lanka
+ - value: SD
+ label:
+ en_US: Sudan
+ zh_Hans: 苏丹
+ pt_BR: Sudão
+ - value: SR
+ label:
+ en_US: Suriname
+ zh_Hans: 苏里南
+ pt_BR: Suriname
+ - value: SJ
+ label:
+ en_US: Svalbard and Jan Mayen
+ zh_Hans: 斯瓦尔巴特和扬马延岛
+ pt_BR: Svalbard e Jan Mayen
+ - value: SZ
+ label:
+ en_US: Swaziland
+ zh_Hans: 斯威士兰
+ pt_BR: Essuatíni
- value: SE
label:
en_US: Sweden
zh_Hans: 瑞典
- pt_BR: Sweden
+ pt_BR: Suécia
- value: CH
label:
en_US: Switzerland
zh_Hans: 瑞士
- pt_BR: Switzerland
+ pt_BR: Suíça
+ - value: SY
+ label:
+ en_US: Syrian Arab Republic
+ zh_Hans: 叙利亚
+ pt_BR: Síria
- value: TW
label:
- en_US: Taiwan
+ en_US: Taiwan, Province of China
zh_Hans: 台湾
pt_BR: Taiwan
+ - value: TJ
+ label:
+ en_US: Tajikistan
+ zh_Hans: 塔吉克斯坦
+ pt_BR: Tajiquistão
+ - value: TZ
+ label:
+ en_US: Tanzania, United Republic of
+ zh_Hans: 坦桑尼亚联合共和国
+ pt_BR: Tanzânia
- value: TH
label:
en_US: Thailand
zh_Hans: 泰国
- pt_BR: Thailand
+ pt_BR: Tailândia
+ - value: TL
+ label:
+ en_US: Timor-Leste
+ zh_Hans: 东帝汶
+ pt_BR: Timor-Leste
+ - value: TG
+ label:
+ en_US: Togo
+ zh_Hans: 多哥
+ pt_BR: Togo
+ - value: TK
+ label:
+ en_US: Tokelau
+ zh_Hans: 托克劳
+ pt_BR: Toquelau
+ - value: TO
+ label:
+ en_US: Tonga
+ zh_Hans: 汤加
+ pt_BR: Tonga
+ - value: TT
+ label:
+ en_US: Trinidad and Tobago
+ zh_Hans: 特立尼达和多巴哥
+ pt_BR: Trindade e Tobago
+ - value: TN
+ label:
+ en_US: Tunisia
+ zh_Hans: 突尼斯
+ pt_BR: Tunísia
- value: TR
label:
en_US: Turkey
zh_Hans: 土耳其
- pt_BR: Turkey
+ pt_BR: Turquia
+ - value: TM
+ label:
+ en_US: Turkmenistan
+ zh_Hans: 土库曼斯坦
+ pt_BR: Turcomenistão
+ - value: TC
+ label:
+ en_US: Turks and Caicos Islands
+ zh_Hans: 特克斯和凯科斯群岛
+ pt_BR: Ilhas Turks e Caicos
+ - value: TV
+ label:
+ en_US: Tuvalu
+ zh_Hans: 图瓦卢
+ pt_BR: Tuvalu
+ - value: UG
+ label:
+ en_US: Uganda
+ zh_Hans: 乌干达
+ pt_BR: Uganda
+ - value: UA
+ label:
+ en_US: Ukraine
+ zh_Hans: 乌克兰
+ pt_BR: Ucrânia
+ - value: AE
+ label:
+ en_US: United Arab Emirates
+ zh_Hans: 阿联酋
+ pt_BR: Emirados Árabes Unidos
+ - value: UK
+ label:
+ en_US: United Kingdom
+ zh_Hans: 英国
+ pt_BR: Reino Unido
- value: GB
label:
en_US: United Kingdom
zh_Hans: 英国
- pt_BR: United Kingdom
+ pt_BR: Reino Unido
- value: US
label:
en_US: United States
zh_Hans: 美国
- pt_BR: United States
+ pt_BR: Estados Unidos
+ - value: UM
+ label:
+ en_US: United States Minor Outlying Islands
+ zh_Hans: 美国本土外小岛屿
+ pt_BR: Ilhas Menores Distantes dos Estados Unidos
+ - value: UY
+ label:
+ en_US: Uruguay
+ zh_Hans: 乌拉圭
+ pt_BR: Uruguai
+ - value: UZ
+ label:
+ en_US: Uzbekistan
+ zh_Hans: 乌兹别克斯坦
+ pt_BR: Uzbequistão
+ - value: VU
+ label:
+ en_US: Vanuatu
+ zh_Hans: 瓦努阿图
+ pt_BR: Vanuatu
+ - value: VE
+ label:
+ en_US: Venezuela
+ zh_Hans: 委内瑞拉
+ pt_BR: Venezuela
+ - value: VN
+ label:
+ en_US: Viet Nam
+ zh_Hans: 越南
+ pt_BR: Vietnã
+ - value: VG
+ label:
+ en_US: Virgin Islands, British
+ zh_Hans: 英属维尔京群岛
+ pt_BR: Ilhas Virgens Britânicas
+ - value: VI
+ label:
+ en_US: Virgin Islands, U.S.
+ zh_Hans: 美属维尔京群岛
+ pt_BR: Ilhas Virgens dos EUA
+ - value: WF
+ label:
+ en_US: Wallis and Futuna
+ zh_Hans: 瓦利斯和富图纳群岛
+ pt_BR: Wallis e Futuna
+ - value: EH
+ label:
+ en_US: Western Sahara
+ zh_Hans: 西撒哈拉
+ pt_BR: Saara Ocidental
+ - value: YE
+ label:
+ en_US: Yemen
+ zh_Hans: 也门
+ pt_BR: Iémen
+ - value: ZM
+ label:
+ en_US: Zambia
+ zh_Hans: 赞比亚
+ pt_BR: Zâmbia
+ - value: ZW
+ label:
+ en_US: Zimbabwe
+ zh_Hans: 津巴布韦
+ pt_BR: Zimbábue
- name: hl
type: select
label:
@@ -277,18 +1277,94 @@ parameters:
default: en
form: form
options:
+ - value: af
+ label:
+ en_US: Afrikaans
+ zh_Hans: 南非语
+ - value: ak
+ label:
+ en_US: Akan
+ zh_Hans: 阿坎语
+ - value: sq
+ label:
+ en_US: Albanian
+ zh_Hans: 阿尔巴尼亚语
+ - value: ws
+ label:
+ en_US: Samoa
+ zh_Hans: 萨摩亚语
+ - value: am
+ label:
+ en_US: Amharic
+ zh_Hans: 阿姆哈拉语
- value: ar
label:
en_US: Arabic
zh_Hans: 阿拉伯语
+ - value: hy
+ label:
+ en_US: Armenian
+ zh_Hans: 亚美尼亚语
+ - value: az
+ label:
+ en_US: Azerbaijani
+ zh_Hans: 阿塞拜疆语
+ - value: eu
+ label:
+ en_US: Basque
+ zh_Hans: 巴斯克语
+ - value: be
+ label:
+ en_US: Belarusian
+ zh_Hans: 白俄罗斯语
+ - value: bem
+ label:
+ en_US: Bemba
+ zh_Hans: 班巴语
+ - value: bn
+ label:
+ en_US: Bengali
+ zh_Hans: 孟加拉语
+ - value: bh
+ label:
+ en_US: Bihari
+ zh_Hans: 比哈尔语
+ - value: xx-bork
+ label:
+ en_US: Bork, bork, bork!
+ zh_Hans: 博克语
+ - value: bs
+ label:
+ en_US: Bosnian
+ zh_Hans: 波斯尼亚语
+ - value: br
+ label:
+ en_US: Breton
+ zh_Hans: 布列塔尼语
- value: bg
label:
en_US: Bulgarian
zh_Hans: 保加利亚语
+ - value: bt
+ label:
+ en_US: Bhutanese
+ zh_Hans: 不丹语
+ - value: km
+ label:
+ en_US: Cambodian
+ zh_Hans: 高棉语
- value: ca
label:
en_US: Catalan
zh_Hans: 加泰罗尼亚语
+ - value: chr
+ label:
+ en_US: Cherokee
+ zh_Hans: 切罗基语
+ - value: ny
+ label:
+ en_US: Chichewa
+ zh_Hans: 齐切瓦语
- value: zh-cn
label:
en_US: Chinese (Simplified)
@@ -297,6 +1373,14 @@ parameters:
label:
en_US: Chinese (Traditional)
zh_Hans: 中文(繁体)
+ - value: co
+ label:
+ en_US: Corsican
+ zh_Hans: 科西嘉语
+ - value: hr
+ label:
+ en_US: Croatian
+ zh_Hans: 克罗地亚语
- value: cs
label:
en_US: Czech
@@ -309,14 +1393,34 @@ parameters:
label:
en_US: Dutch
zh_Hans: 荷兰语
+ - value: xx-elmer
+ label:
+ en_US: Elmer Fudd
+ zh_Hans: 艾尔默福德语
- value: en
label:
en_US: English
zh_Hans: 英语
+ - value: eo
+ label:
+ en_US: Esperanto
+ zh_Hans: 世界语
- value: et
label:
en_US: Estonian
zh_Hans: 爱沙尼亚语
+ - value: ee
+ label:
+ en_US: Ewe
+ zh_Hans: 埃维语
+ - value: fo
+ label:
+ en_US: Faroese
+ zh_Hans: 法罗语
+ - value: tl
+ label:
+ en_US: Filipino
+ zh_Hans: 菲律宾语
- value: fi
label:
en_US: Finnish
@@ -325,6 +1429,22 @@ parameters:
label:
en_US: French
zh_Hans: 法语
+ - value: fy
+ label:
+ en_US: Frisian
+ zh_Hans: 弗里西亚语
+ - value: gaa
+ label:
+ en_US: Ga
+ zh_Hans: 加语
+ - value: gl
+ label:
+ en_US: Galician
+ zh_Hans: 加利西亚语
+ - value: ka
+ label:
+ en_US: Georgian
+ zh_Hans: 格鲁吉亚语
- value: de
label:
en_US: German
@@ -333,6 +1453,34 @@ parameters:
label:
en_US: Greek
zh_Hans: 希腊语
+ - value: kl
+ label:
+ en_US: Greenlandic
+ zh_Hans: 格陵兰语
+ - value: gn
+ label:
+ en_US: Guarani
+ zh_Hans: 瓜拉尼语
+ - value: gu
+ label:
+ en_US: Gujarati
+ zh_Hans: 古吉拉特语
+ - value: xx-hacker
+ label:
+ en_US: Hacker
+ zh_Hans: 黑客语
+ - value: ht
+ label:
+ en_US: Haitian Creole
+ zh_Hans: 海地克里奥尔语
+ - value: ha
+ label:
+ en_US: Hausa
+ zh_Hans: 豪萨语
+ - value: haw
+ label:
+ en_US: Hawaiian
+ zh_Hans: 夏威夷语
- value: iw
label:
en_US: Hebrew
@@ -345,10 +1493,26 @@ parameters:
label:
en_US: Hungarian
zh_Hans: 匈牙利语
+ - value: is
+ label:
+ en_US: Icelandic
+ zh_Hans: 冰岛语
+ - value: ig
+ label:
+ en_US: Igbo
+ zh_Hans: 伊博语
- value: id
label:
en_US: Indonesian
zh_Hans: 印尼语
+ - value: ia
+ label:
+ en_US: Interlingua
+ zh_Hans: 国际语
+ - value: ga
+ label:
+ en_US: Irish
+ zh_Hans: 爱尔兰语
- value: it
label:
en_US: Italian
@@ -357,22 +1521,94 @@ parameters:
label:
en_US: Japanese
zh_Hans: 日语
+ - value: jw
+ label:
+ en_US: Javanese
+ zh_Hans: 爪哇语
- value: kn
label:
en_US: Kannada
zh_Hans: 卡纳达语
+ - value: kk
+ label:
+ en_US: Kazakh
+ zh_Hans: 哈萨克语
+ - value: rw
+ label:
+ en_US: Kinyarwanda
+ zh_Hans: 基尼亚卢旺达语
+ - value: rn
+ label:
+ en_US: Kirundi
+ zh_Hans: 基隆迪语
+ - value: xx-klingon
+ label:
+ en_US: Klingon
+ zh_Hans: 克林贡语
+ - value: kg
+ label:
+ en_US: Kongo
+ zh_Hans: 刚果语
- value: ko
label:
en_US: Korean
zh_Hans: 韩语
+ - value: kri
+ label:
+ en_US: Krio (Sierra Leone)
+ zh_Hans: 塞拉利昂克里奥尔语
+ - value: ku
+ label:
+ en_US: Kurdish
+ zh_Hans: 库尔德语
+ - value: ckb
+ label:
+ en_US: Kurdish (Soranî)
+ zh_Hans: 库尔德语(索拉尼)
+ - value: ky
+ label:
+ en_US: Kyrgyz
+ zh_Hans: 吉尔吉斯语
+ - value: lo
+ label:
+ en_US: Laothian
+ zh_Hans: 老挝语
+ - value: la
+ label:
+ en_US: Latin
+ zh_Hans: 拉丁语
- value: lv
label:
en_US: Latvian
zh_Hans: 拉脱维亚语
+ - value: ln
+ label:
+ en_US: Lingala
+ zh_Hans: 林加拉语
- value: lt
label:
en_US: Lithuanian
zh_Hans: 立陶宛语
+ - value: loz
+ label:
+ en_US: Lozi
+ zh_Hans: 洛齐语
+ - value: lg
+ label:
+ en_US: Luganda
+ zh_Hans: 卢干达语
+ - value: ach
+ label:
+ en_US: Luo
+ zh_Hans: 卢奥语
+ - value: mk
+ label:
+ en_US: Macedonian
+ zh_Hans: 马其顿语
+ - value: mg
+ label:
+ en_US: Malagasy
+ zh_Hans: 马尔加什语
- value: my
label:
en_US: Malay
@@ -381,18 +1617,90 @@ parameters:
label:
en_US: Malayalam
zh_Hans: 马拉雅拉姆语
+ - value: mt
+ label:
+ en_US: Maltese
+ zh_Hans: 马耳他语
+ - value: mv
+ label:
+ en_US: Maldives
+ zh_Hans: 马尔代夫语
+ - value: mi
+ label:
+ en_US: Maori
+ zh_Hans: 毛利语
- value: mr
label:
en_US: Marathi
zh_Hans: 马拉地语
+ - value: mfe
+ label:
+ en_US: Mauritian Creole
+ zh_Hans: 毛里求斯克里奥尔语
+ - value: mo
+ label:
+ en_US: Moldavian
+ zh_Hans: 摩尔达维亚语
+ - value: mn
+ label:
+ en_US: Mongolian
+ zh_Hans: 蒙古语
+ - value: sr-me
+ label:
+ en_US: Montenegrin
+ zh_Hans: 黑山语
+ - value: ne
+ label:
+ en_US: Nepali
+ zh_Hans: 尼泊尔语
+ - value: pcm
+ label:
+ en_US: Nigerian Pidgin
+ zh_Hans: 尼日利亚皮钦语
+ - value: nso
+ label:
+ en_US: Northern Sotho
+ zh_Hans: 北索托语
- value: "no"
label:
en_US: Norwegian
zh_Hans: 挪威语
+ - value: nn
+ label:
+ en_US: Norwegian (Nynorsk)
+ zh_Hans: 挪威语(尼诺斯克语)
+ - value: oc
+ label:
+ en_US: Occitan
+ zh_Hans: 奥克语
+ - value: or
+ label:
+ en_US: Oriya
+ zh_Hans: 奥里亚语
+ - value: om
+ label:
+ en_US: Oromo
+ zh_Hans: 奥罗莫语
+ - value: ps
+ label:
+ en_US: Pashto
+ zh_Hans: 普什图语
+ - value: fa
+ label:
+ en_US: Persian
+ zh_Hans: 波斯语
+ - value: xx-pirate
+ label:
+ en_US: Pirate
+ zh_Hans: 海盗语
- value: pl
label:
en_US: Polish
zh_Hans: 波兰语
+ - value: pt
+ label:
+ en_US: Portuguese
+ zh_Hans: 葡萄牙语
- value: pt-br
label:
en_US: Portuguese (Brazil)
@@ -405,18 +1713,62 @@ parameters:
label:
en_US: Punjabi
zh_Hans: 旁遮普语
+ - value: qu
+ label:
+ en_US: Quechua
+ zh_Hans: 克丘亚语
- value: ro
label:
en_US: Romanian
zh_Hans: 罗马尼亚语
+ - value: rm
+ label:
+ en_US: Romansh
+ zh_Hans: 罗曼什语
+ - value: nyn
+ label:
+ en_US: Runyakitara
+ zh_Hans: 卢尼亚基塔拉语
- value: ru
label:
en_US: Russian
zh_Hans: 俄语
+ - value: gd
+ label:
+ en_US: Scots Gaelic
+ zh_Hans: 苏格兰盖尔语
- value: sr
label:
en_US: Serbian
zh_Hans: 塞尔维亚语
+ - value: sh
+ label:
+ en_US: Serbo-Croatian
+ zh_Hans: 塞尔维亚-克罗地亚语
+ - value: st
+ label:
+ en_US: Sesotho
+ zh_Hans: 塞索托语
+ - value: tn
+ label:
+ en_US: Setswana
+ zh_Hans: 塞茨瓦纳语
+ - value: crs
+ label:
+ en_US: Seychellois Creole
+ zh_Hans: 塞舌尔克里奥尔语
+ - value: sn
+ label:
+ en_US: Shona
+ zh_Hans: 绍纳语
+ - value: sd
+ label:
+ en_US: Sindhi
+ zh_Hans: 信德语
+ - value: si
+ label:
+ en_US: Sinhalese
+ zh_Hans: 僧伽罗语
- value: sk
label:
en_US: Slovak
@@ -425,18 +1777,42 @@ parameters:
label:
en_US: Slovenian
zh_Hans: 斯洛文尼亚语
+ - value: so
+ label:
+ en_US: Somali
+ zh_Hans: 索马里语
- value: es
label:
en_US: Spanish
zh_Hans: 西班牙语
+ - value: es-419
+ label:
+ en_US: Spanish (Latin American)
+ zh_Hans: 西班牙语(拉丁美洲)
+ - value: su
+ label:
+ en_US: Sundanese
+ zh_Hans: 巽他语
+ - value: sw
+ label:
+ en_US: Swahili
+ zh_Hans: 斯瓦希里语
- value: sv
label:
en_US: Swedish
zh_Hans: 瑞典语
+ - value: tg
+ label:
+ en_US: Tajik
+ zh_Hans: 塔吉克语
- value: ta
label:
en_US: Tamil
zh_Hans: 泰米尔语
+ - value: tt
+ label:
+ en_US: Tatar
+ zh_Hans: 鞑靼语
- value: te
label:
en_US: Telugu
@@ -445,18 +1821,82 @@ parameters:
label:
en_US: Thai
zh_Hans: 泰语
+ - value: ti
+ label:
+ en_US: Tigrinya
+ zh_Hans: 提格利尼亚语
+ - value: to
+ label:
+ en_US: Tonga
+ zh_Hans: 汤加语
+ - value: lua
+ label:
+ en_US: Tshiluba
+ zh_Hans: 卢巴语
+ - value: tum
+ label:
+ en_US: Tumbuka
+ zh_Hans: 图布卡语
- value: tr
label:
en_US: Turkish
zh_Hans: 土耳其语
+ - value: tk
+ label:
+ en_US: Turkmen
+ zh_Hans: 土库曼语
+ - value: tw
+ label:
+ en_US: Twi
+ zh_Hans: 契维语
+ - value: ug
+ label:
+ en_US: Uighur
+ zh_Hans: 维吾尔语
- value: uk
label:
en_US: Ukrainian
zh_Hans: 乌克兰语
+ - value: ur
+ label:
+ en_US: Urdu
+ zh_Hans: 乌尔都语
+ - value: uz
+ label:
+ en_US: Uzbek
+ zh_Hans: 乌兹别克语
+ - value: vu
+ label:
+ en_US: Vanuatu
+ zh_Hans: 瓦努阿图语
- value: vi
label:
en_US: Vietnamese
zh_Hans: 越南语
+ - value: cy
+ label:
+ en_US: Welsh
+ zh_Hans: 威尔士语
+ - value: wo
+ label:
+ en_US: Wolof
+ zh_Hans: 沃洛夫语
+ - value: xh
+ label:
+ en_US: Xhosa
+ zh_Hans: 科萨语
+ - value: yi
+ label:
+ en_US: Yiddish
+ zh_Hans: 意第绪语
+ - value: yo
+ label:
+ en_US: Yoruba
+ zh_Hans: 约鲁巴语
+ - value: zu
+ label:
+ en_US: Zulu
+ zh_Hans: 祖鲁语
- name: google_domain
type: string
required: false
diff --git a/api/core/tools/provider/builtin/searchapi/tools/google_jobs.yaml b/api/core/tools/provider/builtin/searchapi/tools/google_jobs.yaml
index 9033bc0f87..3e00e20fbd 100644
--- a/api/core/tools/provider/builtin/searchapi/tools/google_jobs.yaml
+++ b/api/core/tools/provider/builtin/searchapi/tools/google_jobs.yaml
@@ -65,36 +65,141 @@ parameters:
form: form
default: US
options:
- - value: AR
- label:
- en_US: Argentina
- zh_Hans: 阿根廷
- pt_BR: Argentina
- - value: AU
- label:
- en_US: Australia
- zh_Hans: 澳大利亚
- pt_BR: Australia
+ - value: DZ
+ label:
+ en_US: Algeria
+ zh_Hans: 阿尔及利亚
+ pt_BR: Algeria
+ - value: AS
+ label:
+ en_US: American Samoa
+ zh_Hans: 美属萨摩亚
+ pt_BR: American Samoa
+ - value: AO
+ label:
+ en_US: Angola
+ zh_Hans: 安哥拉
+ pt_BR: Angola
+ - value: AI
+ label:
+ en_US: Anguilla
+ zh_Hans: 安圭拉
+ pt_BR: Anguilla
+ - value: AG
+ label:
+ en_US: Antigua and Barbuda
+ zh_Hans: 安提瓜和巴布达
+ pt_BR: Antigua and Barbuda
+ - value: AW
+ label:
+ en_US: Aruba
+ zh_Hans: 阿鲁巴
+ pt_BR: Aruba
- value: AT
label:
en_US: Austria
zh_Hans: 奥地利
pt_BR: Austria
+ - value: BS
+ label:
+ en_US: Bahamas
+ zh_Hans: 巴哈马
+ pt_BR: Bahamas
+ - value: BH
+ label:
+ en_US: Bahrain
+ zh_Hans: 巴林
+ pt_BR: Bahrain
+ - value: BD
+ label:
+ en_US: Bangladesh
+ zh_Hans: 孟加拉国
+ pt_BR: Bangladesh
+ - value: BY
+ label:
+ en_US: Belarus
+ zh_Hans: 白俄罗斯
+ pt_BR: Belarus
- value: BE
label:
en_US: Belgium
zh_Hans: 比利时
pt_BR: Belgium
+ - value: BZ
+ label:
+ en_US: Belize
+ zh_Hans: 伯利兹
+ pt_BR: Belize
+ - value: BJ
+ label:
+ en_US: Benin
+ zh_Hans: 贝宁
+ pt_BR: Benin
+ - value: BM
+ label:
+ en_US: Bermuda
+ zh_Hans: 百慕大
+ pt_BR: Bermuda
+ - value: BO
+ label:
+ en_US: Bolivia
+ zh_Hans: 玻利维亚
+ pt_BR: Bolivia
+ - value: BW
+ label:
+ en_US: Botswana
+ zh_Hans: 博茨瓦纳
+ pt_BR: Botswana
- value: BR
label:
en_US: Brazil
zh_Hans: 巴西
pt_BR: Brazil
+ - value: IO
+ label:
+ en_US: British Indian Ocean Territory
+ zh_Hans: 英属印度洋领地
+ pt_BR: British Indian Ocean Territory
+ - value: BF
+ label:
+ en_US: Burkina Faso
+ zh_Hans: 布基纳法索
+ pt_BR: Burkina Faso
+ - value: BI
+ label:
+ en_US: Burundi
+ zh_Hans: 布隆迪
+ pt_BR: Burundi
+ - value: CM
+ label:
+ en_US: Cameroon
+ zh_Hans: 喀麦隆
+ pt_BR: Cameroon
- value: CA
label:
en_US: Canada
zh_Hans: 加拿大
pt_BR: Canada
+ - value: CV
+ label:
+ en_US: Cape Verde
+ zh_Hans: 佛得角
+ pt_BR: Cape Verde
+ - value: KY
+ label:
+ en_US: Cayman Islands
+ zh_Hans: 开曼群岛
+ pt_BR: Cayman Islands
+ - value: CF
+ label:
+ en_US: Central African Republic
+ zh_Hans: 中非共和国
+ pt_BR: Central African Republic
+ - value: TD
+ label:
+ en_US: Chad
+ zh_Hans: 乍得
+ pt_BR: Chad
- value: CL
label:
en_US: Chile
@@ -105,36 +210,141 @@ parameters:
en_US: Colombia
zh_Hans: 哥伦比亚
pt_BR: Colombia
- - value: CN
- label:
- en_US: China
- zh_Hans: 中国
- pt_BR: China
- - value: CZ
- label:
- en_US: Czech Republic
- zh_Hans: 捷克共和国
- pt_BR: Czech Republic
+ - value: CD
+ label:
+ en_US: Congo, the Democratic Republic of the
+ zh_Hans: 刚果民主共和国
+ pt_BR: Congo, the Democratic Republic of the
+ - value: CR
+ label:
+ en_US: Costa Rica
+ zh_Hans: 哥斯达黎加
+ pt_BR: Costa Rica
+ - value: CI
+ label:
+ en_US: Cote D'ivoire
+ zh_Hans: 科特迪瓦
+ pt_BR: Cote D'ivoire
+ - value: CU
+ label:
+ en_US: Cuba
+ zh_Hans: 古巴
+ pt_BR: Cuba
- value: DK
label:
en_US: Denmark
zh_Hans: 丹麦
pt_BR: Denmark
- - value: FI
- label:
- en_US: Finland
- zh_Hans: 芬兰
- pt_BR: Finland
+ - value: DJ
+ label:
+ en_US: Djibouti
+ zh_Hans: 吉布提
+ pt_BR: Djibouti
+ - value: DM
+ label:
+ en_US: Dominica
+ zh_Hans: 多米尼克
+ pt_BR: Dominica
+ - value: DO
+ label:
+ en_US: Dominican Republic
+ zh_Hans: 多米尼加共和国
+ pt_BR: Dominican Republic
+ - value: EC
+ label:
+ en_US: Ecuador
+ zh_Hans: 厄瓜多尔
+ pt_BR: Ecuador
+ - value: EG
+ label:
+ en_US: Egypt
+ zh_Hans: 埃及
+ pt_BR: Egypt
+ - value: SV
+ label:
+ en_US: El Salvador
+ zh_Hans: 萨尔瓦多
+ pt_BR: El Salvador
+ - value: ET
+ label:
+ en_US: Ethiopia
+ zh_Hans: 埃塞俄比亚
+ pt_BR: Ethiopia
+ - value: FK
+ label:
+ en_US: Falkland Islands (Malvinas)
+ zh_Hans: 福克兰群岛(马尔维纳斯)
+ pt_BR: Falkland Islands (Malvinas)
- value: FR
label:
en_US: France
zh_Hans: 法国
pt_BR: France
+ - value: GF
+ label:
+ en_US: French Guiana
+ zh_Hans: 法属圭亚那
+ pt_BR: French Guiana
+ - value: PF
+ label:
+ en_US: French Polynesia
+ zh_Hans: 法属波利尼西亚
+ pt_BR: French Polynesia
+ - value: TF
+ label:
+ en_US: French Southern Territories
+ zh_Hans: 法属南部领地
+ pt_BR: French Southern Territories
+ - value: GA
+ label:
+ en_US: Gabon
+ zh_Hans: 加蓬
+ pt_BR: Gabon
+ - value: GM
+ label:
+ en_US: Gambia
+ zh_Hans: 冈比亚
+ pt_BR: Gambia
- value: DE
label:
en_US: Germany
zh_Hans: 德国
pt_BR: Germany
+ - value: GH
+ label:
+ en_US: Ghana
+ zh_Hans: 加纳
+ pt_BR: Ghana
+ - value: GR
+ label:
+ en_US: Greece
+ zh_Hans: 希腊
+ pt_BR: Greece
+ - value: GP
+ label:
+ en_US: Guadeloupe
+ zh_Hans: 瓜德罗普
+ pt_BR: Guadeloupe
+ - value: GT
+ label:
+ en_US: Guatemala
+ zh_Hans: 危地马拉
+ pt_BR: Guatemala
+ - value: GY
+ label:
+ en_US: Guyana
+ zh_Hans: 圭亚那
+ pt_BR: Guyana
+ - value: HT
+ label:
+ en_US: Haiti
+ zh_Hans: 海地
+ pt_BR: Haiti
+ - value: HN
+ label:
+ en_US: Honduras
+ zh_Hans: 洪都拉斯
+ pt_BR: Honduras
- value: HK
label:
en_US: Hong Kong
@@ -150,91 +360,291 @@ parameters:
en_US: Indonesia
zh_Hans: 印度尼西亚
pt_BR: Indonesia
+ - value: IQ
+ label:
+ en_US: Iraq
+ zh_Hans: 伊拉克
+ pt_BR: Iraq
- value: IT
label:
en_US: Italy
zh_Hans: 意大利
pt_BR: Italy
+ - value: JM
+ label:
+ en_US: Jamaica
+ zh_Hans: 牙买加
+ pt_BR: Jamaica
- value: JP
label:
en_US: Japan
zh_Hans: 日本
pt_BR: Japan
- - value: KR
- label:
- en_US: Korea
- zh_Hans: 韩国
- pt_BR: Korea
+ - value: JO
+ label:
+ en_US: Jordan
+ zh_Hans: 约旦
+ pt_BR: Jordan
+ - value: KZ
+ label:
+ en_US: Kazakhstan
+ zh_Hans: 哈萨克斯坦
+ pt_BR: Kazakhstan
+ - value: KE
+ label:
+ en_US: Kenya
+ zh_Hans: 肯尼亚
+ pt_BR: Kenya
+ - value: KW
+ label:
+ en_US: Kuwait
+ zh_Hans: 科威特
+ pt_BR: Kuwait
+ - value: KG
+ label:
+ en_US: Kyrgyzstan
+ zh_Hans: 吉尔吉斯斯坦
+ pt_BR: Kyrgyzstan
+ - value: LB
+ label:
+ en_US: Lebanon
+ zh_Hans: 黎巴嫩
+ pt_BR: Lebanon
+ - value: LS
+ label:
+ en_US: Lesotho
+ zh_Hans: 莱索托
+ pt_BR: Lesotho
+ - value: LY
+ label:
+ en_US: Libyan Arab Jamahiriya
+ zh_Hans: 利比亚
+ pt_BR: Libyan Arab Jamahiriya
+ - value: MG
+ label:
+ en_US: Madagascar
+ zh_Hans: 马达加斯加
+ pt_BR: Madagascar
+ - value: MW
+ label:
+ en_US: Malawi
+ zh_Hans: 马拉维
+ pt_BR: Malawi
- value: MY
label:
en_US: Malaysia
zh_Hans: 马来西亚
pt_BR: Malaysia
+ - value: ML
+ label:
+ en_US: Mali
+ zh_Hans: 马里
+ pt_BR: Mali
+ - value: MQ
+ label:
+ en_US: Martinique
+ zh_Hans: 马提尼克
+ pt_BR: Martinique
+ - value: MU
+ label:
+ en_US: Mauritius
+ zh_Hans: 毛里求斯
+ pt_BR: Mauritius
+ - value: YT
+ label:
+ en_US: Mayotte
+ zh_Hans: 马约特
+ pt_BR: Mayotte
- value: MX
label:
en_US: Mexico
zh_Hans: 墨西哥
pt_BR: Mexico
+ - value: MS
+ label:
+ en_US: Montserrat
+ zh_Hans: 蒙特塞拉特
+ pt_BR: Montserrat
+ - value: MA
+ label:
+ en_US: Morocco
+ zh_Hans: 摩洛哥
+ pt_BR: Morocco
+ - value: MZ
+ label:
+ en_US: Mozambique
+ zh_Hans: 莫桑比克
+ pt_BR: Mozambique
+ - value: NA
+ label:
+ en_US: Namibia
+ zh_Hans: 纳米比亚
+ pt_BR: Namibia
- value: NL
label:
en_US: Netherlands
zh_Hans: 荷兰
pt_BR: Netherlands
- - value: NZ
- label:
- en_US: New Zealand
- zh_Hans: 新西兰
- pt_BR: New Zealand
- - value: 'NO'
- label:
- en_US: Norway
- zh_Hans: 挪威
- pt_BR: Norway
+ - value: NC
+ label:
+ en_US: New Caledonia
+ zh_Hans: 新喀里多尼亚
+ pt_BR: New Caledonia
+ - value: NI
+ label:
+ en_US: Nicaragua
+ zh_Hans: 尼加拉瓜
+ pt_BR: Nicaragua
+ - value: NE
+ label:
+ en_US: Niger
+ zh_Hans: 尼日尔
+ pt_BR: Niger
+ - value: NG
+ label:
+ en_US: Nigeria
+ zh_Hans: 尼日利亚
+ pt_BR: Nigeria
+ - value: OM
+ label:
+ en_US: Oman
+ zh_Hans: 阿曼
+ pt_BR: Oman
+ - value: PK
+ label:
+ en_US: Pakistan
+ zh_Hans: 巴基斯坦
+ pt_BR: Pakistan
+ - value: PS
+ label:
+ en_US: Palestinian Territory, Occupied
+ zh_Hans: 巴勒斯坦领土
+ pt_BR: Palestinian Territory, Occupied
+ - value: PA
+ label:
+ en_US: Panama
+ zh_Hans: 巴拿马
+ pt_BR: Panama
+ - value: PY
+ label:
+ en_US: Paraguay
+ zh_Hans: 巴拉圭
+ pt_BR: Paraguay
+ - value: PE
+ label:
+ en_US: Peru
+ zh_Hans: 秘鲁
+ pt_BR: Peru
- value: PH
label:
en_US: Philippines
zh_Hans: 菲律宾
pt_BR: Philippines
- - value: PL
- label:
- en_US: Poland
- zh_Hans: 波兰
- pt_BR: Poland
- value: PT
label:
en_US: Portugal
zh_Hans: 葡萄牙
pt_BR: Portugal
+ - value: PR
+ label:
+ en_US: Puerto Rico
+ zh_Hans: 波多黎各
+ pt_BR: Puerto Rico
+ - value: QA
+ label:
+ en_US: Qatar
+ zh_Hans: 卡塔尔
+ pt_BR: Qatar
+ - value: RE
+ label:
+ en_US: Reunion
+ zh_Hans: 留尼旺
+ pt_BR: Reunion
- value: RU
label:
- en_US: Russia
- zh_Hans: 俄罗斯
- pt_BR: Russia
+ en_US: Russian Federation
+ zh_Hans: 俄罗斯联邦
+ pt_BR: Russian Federation
+ - value: RW
+ label:
+ en_US: Rwanda
+ zh_Hans: 卢旺达
+ pt_BR: Rwanda
+ - value: SH
+ label:
+ en_US: Saint Helena
+ zh_Hans: 圣赫勒拿
+ pt_BR: Saint Helena
+ - value: PM
+ label:
+ en_US: Saint Pierre and Miquelon
+ zh_Hans: 圣皮埃尔和密克隆
+ pt_BR: Saint Pierre and Miquelon
+ - value: VC
+ label:
+ en_US: Saint Vincent and the Grenadines
+ zh_Hans: 圣文森特和格林纳丁斯
+ pt_BR: Saint Vincent and the Grenadines
+ - value: ST
+ label:
+ en_US: Sao Tome and Principe
+ zh_Hans: 圣多美和普林西比
+ pt_BR: Sao Tome and Principe
- value: SA
label:
en_US: Saudi Arabia
zh_Hans: 沙特阿拉伯
pt_BR: Saudi Arabia
+ - value: SN
+ label:
+ en_US: Senegal
+ zh_Hans: 塞内加尔
+ pt_BR: Senegal
+ - value: SC
+ label:
+ en_US: Seychelles
+ zh_Hans: 塞舌尔
+ pt_BR: Seychelles
+ - value: SL
+ label:
+ en_US: Sierra Leone
+ zh_Hans: 塞拉利昂
+ pt_BR: Sierra Leone
- value: SG
label:
en_US: Singapore
zh_Hans: 新加坡
pt_BR: Singapore
+ - value: SO
+ label:
+ en_US: Somalia
+ zh_Hans: 索马里
+ pt_BR: Somalia
- value: ZA
label:
en_US: South Africa
zh_Hans: 南非
pt_BR: South Africa
+ - value: GS
+ label:
+ en_US: South Georgia and the South Sandwich Islands
+ zh_Hans: 南乔治亚和南桑威奇群岛
+ pt_BR: South Georgia and the South Sandwich Islands
- value: ES
label:
en_US: Spain
zh_Hans: 西班牙
pt_BR: Spain
- - value: SE
+ - value: LK
+ label:
+ en_US: Sri Lanka
+ zh_Hans: 斯里兰卡
+ pt_BR: Sri Lanka
+ - value: SR
label:
- en_US: Sweden
- zh_Hans: 瑞典
- pt_BR: Sweden
+ en_US: Suriname
+ zh_Hans: 苏里南
+ pt_BR: Suriname
- value: CH
label:
en_US: Switzerland
@@ -242,19 +652,54 @@ parameters:
pt_BR: Switzerland
- value: TW
label:
- en_US: Taiwan
- zh_Hans: 台湾
- pt_BR: Taiwan
+ en_US: Taiwan, Province of China
+ zh_Hans: 中国台湾省
+ pt_BR: Taiwan, Province of China
+ - value: TZ
+ label:
+ en_US: Tanzania, United Republic of
+ zh_Hans: 坦桑尼亚联合共和国
+ pt_BR: Tanzania, United Republic of
- value: TH
label:
en_US: Thailand
zh_Hans: 泰国
pt_BR: Thailand
- - value: TR
+ - value: TG
+ label:
+ en_US: Togo
+ zh_Hans: 多哥
+ pt_BR: Togo
+ - value: TT
+ label:
+ en_US: Trinidad and Tobago
+ zh_Hans: 特立尼达和多巴哥
+ pt_BR: Trinidad and Tobago
+ - value: TN
+ label:
+ en_US: Tunisia
+ zh_Hans: 突尼斯
+ pt_BR: Tunisia
+ - value: TC
+ label:
+ en_US: Turks and Caicos Islands
+ zh_Hans: 特克斯和凯科斯群岛
+ pt_BR: Turks and Caicos Islands
+ - value: UG
+ label:
+ en_US: Uganda
+ zh_Hans: 乌干达
+ pt_BR: Uganda
+ - value: AE
+ label:
+ en_US: United Arab Emirates
+ zh_Hans: 阿联酋
+ pt_BR: United Arab Emirates
+ - value: UK
label:
- en_US: Turkey
- zh_Hans: 土耳其
- pt_BR: Turkey
+ en_US: United Kingdom
+ zh_Hans: 英国
+ pt_BR: United Kingdom
- value: GB
label:
en_US: United Kingdom
@@ -265,6 +710,46 @@ parameters:
en_US: United States
zh_Hans: 美国
pt_BR: United States
+ - value: UY
+ label:
+ en_US: Uruguay
+ zh_Hans: 乌拉圭
+ pt_BR: Uruguay
+ - value: UZ
+ label:
+ en_US: Uzbekistan
+ zh_Hans: 乌兹别克斯坦
+ pt_BR: Uzbekistan
+ - value: VE
+ label:
+ en_US: Venezuela
+ zh_Hans: 委内瑞拉
+ pt_BR: Venezuela
+ - value: VN
+ label:
+ en_US: Viet Nam
+ zh_Hans: 越南
+ pt_BR: Viet Nam
+ - value: VG
+ label:
+ en_US: Virgin Islands, British
+ zh_Hans: 英属维尔京群岛
+ pt_BR: Virgin Islands, British
+ - value: VI
+ label:
+ en_US: Virgin Islands, U.S.
+ zh_Hans: 美属维尔京群岛
+ pt_BR: Virgin Islands, U.S.
+ - value: ZM
+ label:
+ en_US: Zambia
+ zh_Hans: 赞比亚
+ pt_BR: Zambia
+ - value: ZW
+ label:
+ en_US: Zimbabwe
+ zh_Hans: 津巴布韦
+ pt_BR: Zimbabwe
- name: hl
type: select
label:
@@ -277,18 +762,94 @@ parameters:
default: en
form: form
options:
+ - value: af
+ label:
+ en_US: Afrikaans
+ zh_Hans: 南非语
+ - value: ak
+ label:
+ en_US: Akan
+ zh_Hans: 阿坎语
+ - value: sq
+ label:
+ en_US: Albanian
+ zh_Hans: 阿尔巴尼亚语
+ - value: ws
+ label:
+ en_US: Samoa
+ zh_Hans: 萨摩亚语
+ - value: am
+ label:
+ en_US: Amharic
+ zh_Hans: 阿姆哈拉语
- value: ar
label:
en_US: Arabic
zh_Hans: 阿拉伯语
+ - value: hy
+ label:
+ en_US: Armenian
+ zh_Hans: 亚美尼亚语
+ - value: az
+ label:
+ en_US: Azerbaijani
+ zh_Hans: 阿塞拜疆语
+ - value: eu
+ label:
+ en_US: Basque
+ zh_Hans: 巴斯克语
+ - value: be
+ label:
+ en_US: Belarusian
+ zh_Hans: 白俄罗斯语
+ - value: bem
+ label:
+ en_US: Bemba
+ zh_Hans: 班巴语
+ - value: bn
+ label:
+ en_US: Bengali
+ zh_Hans: 孟加拉语
+ - value: bh
+ label:
+ en_US: Bihari
+ zh_Hans: 比哈尔语
+ - value: xx-bork
+ label:
+ en_US: Bork, bork, bork!
+ zh_Hans: 博克语
+ - value: bs
+ label:
+ en_US: Bosnian
+ zh_Hans: 波斯尼亚语
+ - value: br
+ label:
+ en_US: Breton
+ zh_Hans: 布列塔尼语
- value: bg
label:
en_US: Bulgarian
zh_Hans: 保加利亚语
+ - value: bt
+ label:
+ en_US: Bhutanese
+ zh_Hans: 不丹语
+ - value: km
+ label:
+ en_US: Cambodian
+ zh_Hans: 高棉语
- value: ca
label:
en_US: Catalan
zh_Hans: 加泰罗尼亚语
+ - value: chr
+ label:
+ en_US: Cherokee
+ zh_Hans: 切罗基语
+ - value: ny
+ label:
+ en_US: Chichewa
+ zh_Hans: 齐切瓦语
- value: zh-cn
label:
en_US: Chinese (Simplified)
@@ -297,6 +858,14 @@ parameters:
label:
en_US: Chinese (Traditional)
zh_Hans: 中文(繁体)
+ - value: co
+ label:
+ en_US: Corsican
+ zh_Hans: 科西嘉语
+ - value: hr
+ label:
+ en_US: Croatian
+ zh_Hans: 克罗地亚语
- value: cs
label:
en_US: Czech
@@ -309,14 +878,34 @@ parameters:
label:
en_US: Dutch
zh_Hans: 荷兰语
+ - value: xx-elmer
+ label:
+ en_US: Elmer Fudd
+ zh_Hans: 艾尔默福德语
- value: en
label:
en_US: English
zh_Hans: 英语
+ - value: eo
+ label:
+ en_US: Esperanto
+ zh_Hans: 世界语
- value: et
label:
en_US: Estonian
zh_Hans: 爱沙尼亚语
+ - value: ee
+ label:
+ en_US: Ewe
+ zh_Hans: 埃维语
+ - value: fo
+ label:
+ en_US: Faroese
+ zh_Hans: 法罗语
+ - value: tl
+ label:
+ en_US: Filipino
+ zh_Hans: 菲律宾语
- value: fi
label:
en_US: Finnish
@@ -325,6 +914,22 @@ parameters:
label:
en_US: French
zh_Hans: 法语
+ - value: fy
+ label:
+ en_US: Frisian
+ zh_Hans: 弗里西亚语
+ - value: gaa
+ label:
+ en_US: Ga
+ zh_Hans: 加语
+ - value: gl
+ label:
+ en_US: Galician
+ zh_Hans: 加利西亚语
+ - value: ka
+ label:
+ en_US: Georgian
+ zh_Hans: 格鲁吉亚语
- value: de
label:
en_US: German
@@ -333,6 +938,34 @@ parameters:
label:
en_US: Greek
zh_Hans: 希腊语
+ - value: kl
+ label:
+ en_US: Greenlandic
+ zh_Hans: 格陵兰语
+ - value: gn
+ label:
+ en_US: Guarani
+ zh_Hans: 瓜拉尼语
+ - value: gu
+ label:
+ en_US: Gujarati
+ zh_Hans: 古吉拉特语
+ - value: xx-hacker
+ label:
+ en_US: Hacker
+ zh_Hans: 黑客语
+ - value: ht
+ label:
+ en_US: Haitian Creole
+ zh_Hans: 海地克里奥尔语
+ - value: ha
+ label:
+ en_US: Hausa
+ zh_Hans: 豪萨语
+ - value: haw
+ label:
+ en_US: Hawaiian
+ zh_Hans: 夏威夷语
- value: iw
label:
en_US: Hebrew
@@ -345,10 +978,26 @@ parameters:
label:
en_US: Hungarian
zh_Hans: 匈牙利语
+ - value: is
+ label:
+ en_US: Icelandic
+ zh_Hans: 冰岛语
+ - value: ig
+ label:
+ en_US: Igbo
+ zh_Hans: 伊博语
- value: id
label:
en_US: Indonesian
zh_Hans: 印尼语
+ - value: ia
+ label:
+ en_US: Interlingua
+ zh_Hans: 国际语
+ - value: ga
+ label:
+ en_US: Irish
+ zh_Hans: 爱尔兰语
- value: it
label:
en_US: Italian
@@ -357,22 +1006,94 @@ parameters:
label:
en_US: Japanese
zh_Hans: 日语
+ - value: jw
+ label:
+ en_US: Javanese
+ zh_Hans: 爪哇语
- value: kn
label:
en_US: Kannada
zh_Hans: 卡纳达语
+ - value: kk
+ label:
+ en_US: Kazakh
+ zh_Hans: 哈萨克语
+ - value: rw
+ label:
+ en_US: Kinyarwanda
+ zh_Hans: 基尼亚卢旺达语
+ - value: rn
+ label:
+ en_US: Kirundi
+ zh_Hans: 基隆迪语
+ - value: xx-klingon
+ label:
+ en_US: Klingon
+ zh_Hans: 克林贡语
+ - value: kg
+ label:
+ en_US: Kongo
+ zh_Hans: 刚果语
- value: ko
label:
en_US: Korean
zh_Hans: 韩语
+ - value: kri
+ label:
+ en_US: Krio (Sierra Leone)
+ zh_Hans: 塞拉利昂克里奥尔语
+ - value: ku
+ label:
+ en_US: Kurdish
+ zh_Hans: 库尔德语
+ - value: ckb
+ label:
+ en_US: Kurdish (Soranî)
+ zh_Hans: 库尔德语(索拉尼)
+ - value: ky
+ label:
+ en_US: Kyrgyz
+ zh_Hans: 吉尔吉斯语
+ - value: lo
+ label:
+ en_US: Laothian
+ zh_Hans: 老挝语
+ - value: la
+ label:
+ en_US: Latin
+ zh_Hans: 拉丁语
- value: lv
label:
en_US: Latvian
zh_Hans: 拉脱维亚语
+ - value: ln
+ label:
+ en_US: Lingala
+ zh_Hans: 林加拉语
- value: lt
label:
en_US: Lithuanian
zh_Hans: 立陶宛语
+ - value: loz
+ label:
+ en_US: Lozi
+ zh_Hans: 洛齐语
+ - value: lg
+ label:
+ en_US: Luganda
+ zh_Hans: 卢干达语
+ - value: ach
+ label:
+ en_US: Luo
+ zh_Hans: 卢奥语
+ - value: mk
+ label:
+ en_US: Macedonian
+ zh_Hans: 马其顿语
+ - value: mg
+ label:
+ en_US: Malagasy
+ zh_Hans: 马尔加什语
- value: my
label:
en_US: Malay
@@ -381,18 +1102,90 @@ parameters:
label:
en_US: Malayalam
zh_Hans: 马拉雅拉姆语
+ - value: mt
+ label:
+ en_US: Maltese
+ zh_Hans: 马耳他语
+ - value: mv
+ label:
+ en_US: Maldives
+ zh_Hans: 马尔代夫语
+ - value: mi
+ label:
+ en_US: Maori
+ zh_Hans: 毛利语
- value: mr
label:
en_US: Marathi
zh_Hans: 马拉地语
+ - value: mfe
+ label:
+ en_US: Mauritian Creole
+ zh_Hans: 毛里求斯克里奥尔语
+ - value: mo
+ label:
+ en_US: Moldavian
+ zh_Hans: 摩尔达维亚语
+ - value: mn
+ label:
+ en_US: Mongolian
+ zh_Hans: 蒙古语
+ - value: sr-me
+ label:
+ en_US: Montenegrin
+ zh_Hans: 黑山语
+ - value: ne
+ label:
+ en_US: Nepali
+ zh_Hans: 尼泊尔语
+ - value: pcm
+ label:
+ en_US: Nigerian Pidgin
+ zh_Hans: 尼日利亚皮钦语
+ - value: nso
+ label:
+ en_US: Northern Sotho
+ zh_Hans: 北索托语
- value: "no"
label:
en_US: Norwegian
zh_Hans: 挪威语
+ - value: nn
+ label:
+ en_US: Norwegian (Nynorsk)
+ zh_Hans: 挪威语(尼诺斯克语)
+ - value: oc
+ label:
+ en_US: Occitan
+ zh_Hans: 奥克语
+ - value: or
+ label:
+ en_US: Oriya
+ zh_Hans: 奥里亚语
+ - value: om
+ label:
+ en_US: Oromo
+ zh_Hans: 奥罗莫语
+ - value: ps
+ label:
+ en_US: Pashto
+ zh_Hans: 普什图语
+ - value: fa
+ label:
+ en_US: Persian
+ zh_Hans: 波斯语
+ - value: xx-pirate
+ label:
+ en_US: Pirate
+ zh_Hans: 海盗语
- value: pl
label:
en_US: Polish
zh_Hans: 波兰语
+ - value: pt
+ label:
+ en_US: Portuguese
+ zh_Hans: 葡萄牙语
- value: pt-br
label:
en_US: Portuguese (Brazil)
@@ -405,18 +1198,62 @@ parameters:
label:
en_US: Punjabi
zh_Hans: 旁遮普语
+ - value: qu
+ label:
+ en_US: Quechua
+ zh_Hans: 克丘亚语
- value: ro
label:
en_US: Romanian
zh_Hans: 罗马尼亚语
+ - value: rm
+ label:
+ en_US: Romansh
+ zh_Hans: 罗曼什语
+ - value: nyn
+ label:
+ en_US: Runyakitara
+ zh_Hans: 卢尼亚基塔拉语
- value: ru
label:
en_US: Russian
zh_Hans: 俄语
+ - value: gd
+ label:
+ en_US: Scots Gaelic
+ zh_Hans: 苏格兰盖尔语
- value: sr
label:
en_US: Serbian
zh_Hans: 塞尔维亚语
+ - value: sh
+ label:
+ en_US: Serbo-Croatian
+ zh_Hans: 塞尔维亚-克罗地亚语
+ - value: st
+ label:
+ en_US: Sesotho
+ zh_Hans: 塞索托语
+ - value: tn
+ label:
+ en_US: Setswana
+ zh_Hans: 塞茨瓦纳语
+ - value: crs
+ label:
+ en_US: Seychellois Creole
+ zh_Hans: 塞舌尔克里奥尔语
+ - value: sn
+ label:
+ en_US: Shona
+ zh_Hans: 绍纳语
+ - value: sd
+ label:
+ en_US: Sindhi
+ zh_Hans: 信德语
+ - value: si
+ label:
+ en_US: Sinhalese
+ zh_Hans: 僧伽罗语
- value: sk
label:
en_US: Slovak
@@ -425,18 +1262,42 @@ parameters:
label:
en_US: Slovenian
zh_Hans: 斯洛文尼亚语
+ - value: so
+ label:
+ en_US: Somali
+ zh_Hans: 索马里语
- value: es
label:
en_US: Spanish
zh_Hans: 西班牙语
+ - value: es-419
+ label:
+ en_US: Spanish (Latin American)
+ zh_Hans: 西班牙语(拉丁美洲)
+ - value: su
+ label:
+ en_US: Sundanese
+ zh_Hans: 巽他语
+ - value: sw
+ label:
+ en_US: Swahili
+ zh_Hans: 斯瓦希里语
- value: sv
label:
en_US: Swedish
zh_Hans: 瑞典语
+ - value: tg
+ label:
+ en_US: Tajik
+ zh_Hans: 塔吉克语
- value: ta
label:
en_US: Tamil
zh_Hans: 泰米尔语
+ - value: tt
+ label:
+ en_US: Tatar
+ zh_Hans: 鞑靼语
- value: te
label:
en_US: Telugu
@@ -445,18 +1306,82 @@ parameters:
label:
en_US: Thai
zh_Hans: 泰语
+ - value: ti
+ label:
+ en_US: Tigrinya
+ zh_Hans: 提格利尼亚语
+ - value: to
+ label:
+ en_US: Tonga
+ zh_Hans: 汤加语
+ - value: lua
+ label:
+ en_US: Tshiluba
+ zh_Hans: 卢巴语
+ - value: tum
+ label:
+ en_US: Tumbuka
+ zh_Hans: 图布卡语
- value: tr
label:
en_US: Turkish
zh_Hans: 土耳其语
+ - value: tk
+ label:
+ en_US: Turkmen
+ zh_Hans: 土库曼语
+ - value: tw
+ label:
+ en_US: Twi
+ zh_Hans: 契维语
+ - value: ug
+ label:
+ en_US: Uighur
+ zh_Hans: 维吾尔语
- value: uk
label:
en_US: Ukrainian
zh_Hans: 乌克兰语
+ - value: ur
+ label:
+ en_US: Urdu
+ zh_Hans: 乌尔都语
+ - value: uz
+ label:
+ en_US: Uzbek
+ zh_Hans: 乌兹别克语
+ - value: vu
+ label:
+ en_US: Vanuatu
+ zh_Hans: 瓦努阿图语
- value: vi
label:
en_US: Vietnamese
zh_Hans: 越南语
+ - value: cy
+ label:
+ en_US: Welsh
+ zh_Hans: 威尔士语
+ - value: wo
+ label:
+ en_US: Wolof
+ zh_Hans: 沃洛夫语
+ - value: xh
+ label:
+ en_US: Xhosa
+ zh_Hans: 科萨语
+ - value: yi
+ label:
+ en_US: Yiddish
+ zh_Hans: 意第绪语
+ - value: yo
+ label:
+ en_US: Yoruba
+ zh_Hans: 约鲁巴语
+ - value: zu
+ label:
+ en_US: Zulu
+ zh_Hans: 祖鲁语
- name: is_remote
type: select
label:
diff --git a/api/core/tools/provider/builtin/searchapi/tools/google_news.yaml b/api/core/tools/provider/builtin/searchapi/tools/google_news.yaml
index cbb0edf982..ff34af34cc 100644
--- a/api/core/tools/provider/builtin/searchapi/tools/google_news.yaml
+++ b/api/core/tools/provider/builtin/searchapi/tools/google_news.yaml
@@ -65,206 +65,1206 @@ parameters:
form: form
default: US
options:
+ - value: AF
+ label:
+ en_US: Afghanistan
+ zh_Hans: 阿富汗
+ pt_BR: Afeganistão
+ - value: AL
+ label:
+ en_US: Albania
+ zh_Hans: 阿尔巴尼亚
+ pt_BR: Albânia
+ - value: DZ
+ label:
+ en_US: Algeria
+ zh_Hans: 阿尔及利亚
+ pt_BR: Argélia
+ - value: AS
+ label:
+ en_US: American Samoa
+ zh_Hans: 美属萨摩亚
+ pt_BR: Samoa Americana
+ - value: AD
+ label:
+ en_US: Andorra
+ zh_Hans: 安道尔
+ pt_BR: Andorra
+ - value: AO
+ label:
+ en_US: Angola
+ zh_Hans: 安哥拉
+ pt_BR: Angola
+ - value: AI
+ label:
+ en_US: Anguilla
+ zh_Hans: 安圭拉
+ pt_BR: Anguilla
+ - value: AQ
+ label:
+ en_US: Antarctica
+ zh_Hans: 南极洲
+ pt_BR: Antártica
+ - value: AG
+ label:
+ en_US: Antigua and Barbuda
+ zh_Hans: 安提瓜和巴布达
+ pt_BR: Antígua e Barbuda
- value: AR
label:
en_US: Argentina
zh_Hans: 阿根廷
pt_BR: Argentina
+ - value: AM
+ label:
+ en_US: Armenia
+ zh_Hans: 亚美尼亚
+ pt_BR: Armênia
+ - value: AW
+ label:
+ en_US: Aruba
+ zh_Hans: 阿鲁巴
+ pt_BR: Aruba
- value: AU
label:
en_US: Australia
zh_Hans: 澳大利亚
- pt_BR: Australia
+ pt_BR: Austrália
- value: AT
label:
en_US: Austria
zh_Hans: 奥地利
- pt_BR: Austria
+ pt_BR: Áustria
+ - value: AZ
+ label:
+ en_US: Azerbaijan
+ zh_Hans: 阿塞拜疆
+ pt_BR: Azerbaijão
+ - value: BS
+ label:
+ en_US: Bahamas
+ zh_Hans: 巴哈马
+ pt_BR: Bahamas
+ - value: BH
+ label:
+ en_US: Bahrain
+ zh_Hans: 巴林
+ pt_BR: Bahrein
+ - value: BD
+ label:
+ en_US: Bangladesh
+ zh_Hans: 孟加拉国
+ pt_BR: Bangladesh
+ - value: BB
+ label:
+ en_US: Barbados
+ zh_Hans: 巴巴多斯
+ pt_BR: Barbados
+ - value: BY
+ label:
+ en_US: Belarus
+ zh_Hans: 白俄罗斯
+ pt_BR: Bielorrússia
- value: BE
label:
en_US: Belgium
zh_Hans: 比利时
- pt_BR: Belgium
+ pt_BR: Bélgica
+ - value: BZ
+ label:
+ en_US: Belize
+ zh_Hans: 伯利兹
+ pt_BR: Belize
+ - value: BJ
+ label:
+ en_US: Benin
+ zh_Hans: 贝宁
+ pt_BR: Benim
+ - value: BM
+ label:
+ en_US: Bermuda
+ zh_Hans: 百慕大
+ pt_BR: Bermudas
+ - value: BT
+ label:
+ en_US: Bhutan
+ zh_Hans: 不丹
+ pt_BR: Butão
+ - value: BO
+ label:
+ en_US: Bolivia
+ zh_Hans: 玻利维亚
+ pt_BR: Bolívia
+ - value: BA
+ label:
+ en_US: Bosnia and Herzegovina
+ zh_Hans: 波斯尼亚和黑塞哥维那
+ pt_BR: Bósnia e Herzegovina
+ - value: BW
+ label:
+ en_US: Botswana
+ zh_Hans: 博茨瓦纳
+ pt_BR: Botsuana
+ - value: BV
+ label:
+ en_US: Bouvet Island
+ zh_Hans: 布韦岛
+ pt_BR: Ilha Bouvet
- value: BR
label:
en_US: Brazil
zh_Hans: 巴西
- pt_BR: Brazil
+ pt_BR: Brasil
+ - value: IO
+ label:
+ en_US: British Indian Ocean Territory
+ zh_Hans: 英属印度洋领地
+ pt_BR: Território Britânico do Oceano Índico
+ - value: BN
+ label:
+ en_US: Brunei Darussalam
+ zh_Hans: 文莱
+ pt_BR: Brunei Darussalam
+ - value: BG
+ label:
+ en_US: Bulgaria
+ zh_Hans: 保加利亚
+ pt_BR: Bulgária
+ - value: BF
+ label:
+ en_US: Burkina Faso
+ zh_Hans: 布基纳法索
+ pt_BR: Burkina Faso
+ - value: BI
+ label:
+ en_US: Burundi
+ zh_Hans: 布隆迪
+ pt_BR: Burundi
+ - value: KH
+ label:
+ en_US: Cambodia
+ zh_Hans: 柬埔寨
+ pt_BR: Camboja
+ - value: CM
+ label:
+ en_US: Cameroon
+ zh_Hans: 喀麦隆
+ pt_BR: Camarões
- value: CA
label:
en_US: Canada
zh_Hans: 加拿大
- pt_BR: Canada
+ pt_BR: Canadá
+ - value: CV
+ label:
+ en_US: Cape Verde
+ zh_Hans: 佛得角
+ pt_BR: Cabo Verde
+ - value: KY
+ label:
+ en_US: Cayman Islands
+ zh_Hans: 开曼群岛
+ pt_BR: Ilhas Cayman
+ - value: CF
+ label:
+ en_US: Central African Republic
+ zh_Hans: 中非共和国
+ pt_BR: República Centro-Africana
+ - value: TD
+ label:
+ en_US: Chad
+ zh_Hans: 乍得
+ pt_BR: Chade
- value: CL
label:
en_US: Chile
zh_Hans: 智利
pt_BR: Chile
- - value: CO
- label:
- en_US: Colombia
- zh_Hans: 哥伦比亚
- pt_BR: Colombia
- value: CN
label:
en_US: China
zh_Hans: 中国
pt_BR: China
+ - value: CX
+ label:
+ en_US: Christmas Island
+ zh_Hans: 圣诞岛
+ pt_BR: Ilha do Natal
+ - value: CC
+ label:
+ en_US: Cocos (Keeling) Islands
+ zh_Hans: 科科斯(基林)群岛
+ pt_BR: Ilhas Cocos (Keeling)
+ - value: CO
+ label:
+ en_US: Colombia
+ zh_Hans: 哥伦比亚
+ pt_BR: Colômbia
+ - value: KM
+ label:
+ en_US: Comoros
+ zh_Hans: 科摩罗
+ pt_BR: Comores
+ - value: CG
+ label:
+ en_US: Congo
+ zh_Hans: 刚果
+ pt_BR: Congo
+ - value: CD
+ label:
+ en_US: Congo, the Democratic Republic of the
+ zh_Hans: 刚果民主共和国
+ pt_BR: Congo, República Democrática do
+ - value: CK
+ label:
+ en_US: Cook Islands
+ zh_Hans: 库克群岛
+ pt_BR: Ilhas Cook
+ - value: CR
+ label:
+ en_US: Costa Rica
+ zh_Hans: 哥斯达黎加
+ pt_BR: Costa Rica
+ - value: CI
+ label:
+ en_US: Cote D'ivoire
+ zh_Hans: 科特迪瓦
+ pt_BR: Costa do Marfim
+ - value: HR
+ label:
+ en_US: Croatia
+ zh_Hans: 克罗地亚
+ pt_BR: Croácia
+ - value: CU
+ label:
+ en_US: Cuba
+ zh_Hans: 古巴
+ pt_BR: Cuba
+ - value: CY
+ label:
+ en_US: Cyprus
+ zh_Hans: 塞浦路斯
+ pt_BR: Chipre
- value: CZ
label:
en_US: Czech Republic
zh_Hans: 捷克共和国
- pt_BR: Czech Republic
+ pt_BR: República Tcheca
- value: DK
label:
en_US: Denmark
zh_Hans: 丹麦
- pt_BR: Denmark
+ pt_BR: Dinamarca
+ - value: DJ
+ label:
+ en_US: Djibouti
+ zh_Hans: 吉布提
+ pt_BR: Djibuti
+ - value: DM
+ label:
+ en_US: Dominica
+ zh_Hans: 多米尼克
+ pt_BR: Dominica
+ - value: DO
+ label:
+ en_US: Dominican Republic
+ zh_Hans: 多米尼加共和国
+ pt_BR: República Dominicana
+ - value: EC
+ label:
+ en_US: Ecuador
+ zh_Hans: 厄瓜多尔
+ pt_BR: Equador
+ - value: EG
+ label:
+ en_US: Egypt
+ zh_Hans: 埃及
+ pt_BR: Egito
+ - value: SV
+ label:
+ en_US: El Salvador
+ zh_Hans: 萨尔瓦多
+ pt_BR: El Salvador
+ - value: GQ
+ label:
+ en_US: Equatorial Guinea
+ zh_Hans: 赤道几内亚
+ pt_BR: Guiné Equatorial
+ - value: ER
+ label:
+ en_US: Eritrea
+ zh_Hans: 厄立特里亚
+ pt_BR: Eritreia
+ - value: EE
+ label:
+ en_US: Estonia
+ zh_Hans: 爱沙尼亚
+ pt_BR: Estônia
+ - value: ET
+ label:
+ en_US: Ethiopia
+ zh_Hans: 埃塞俄比亚
+ pt_BR: Etiópia
+ - value: FK
+ label:
+ en_US: Falkland Islands (Malvinas)
+ zh_Hans: 福克兰群岛(马尔维纳斯)
+ pt_BR: Ilhas Falkland (Malvinas)
+ - value: FO
+ label:
+ en_US: Faroe Islands
+ zh_Hans: 法罗群岛
+ pt_BR: Ilhas Faroe
+ - value: FJ
+ label:
+ en_US: Fiji
+ zh_Hans: 斐济
+ pt_BR: Fiji
- value: FI
label:
en_US: Finland
zh_Hans: 芬兰
- pt_BR: Finland
+ pt_BR: Finlândia
- value: FR
label:
en_US: France
zh_Hans: 法国
- pt_BR: France
+ pt_BR: França
+ - value: GF
+ label:
+ en_US: French Guiana
+ zh_Hans: 法属圭亚那
+ pt_BR: Guiana Francesa
+ - value: PF
+ label:
+ en_US: French Polynesia
+ zh_Hans: 法属波利尼西亚
+ pt_BR: Polinésia Francesa
+ - value: TF
+ label:
+ en_US: French Southern Territories
+ zh_Hans: 法属南部领地
+ pt_BR: Territórios Franceses do Sul
+ - value: GA
+ label:
+ en_US: Gabon
+ zh_Hans: 加蓬
+ pt_BR: Gabão
+ - value: GM
+ label:
+ en_US: Gambia
+ zh_Hans: 冈比亚
+ pt_BR: Gâmbia
+ - value: GE
+ label:
+ en_US: Georgia
+ zh_Hans: 格鲁吉亚
+ pt_BR: Geórgia
- value: DE
label:
en_US: Germany
zh_Hans: 德国
- pt_BR: Germany
+ pt_BR: Alemanha
+ - value: GH
+ label:
+ en_US: Ghana
+ zh_Hans: 加纳
+ pt_BR: Gana
+ - value: GI
+ label:
+ en_US: Gibraltar
+ zh_Hans: 直布罗陀
+ pt_BR: Gibraltar
+ - value: GR
+ label:
+ en_US: Greece
+ zh_Hans: 希腊
+ pt_BR: Grécia
+ - value: GL
+ label:
+ en_US: Greenland
+ zh_Hans: 格陵兰
+ pt_BR: Groenlândia
+ - value: GD
+ label:
+ en_US: Grenada
+ zh_Hans: 格林纳达
+ pt_BR: Granada
+ - value: GP
+ label:
+ en_US: Guadeloupe
+ zh_Hans: 瓜德罗普
+ pt_BR: Guadalupe
+ - value: GU
+ label:
+ en_US: Guam
+ zh_Hans: 关岛
+ pt_BR: Guam
+ - value: GT
+ label:
+ en_US: Guatemala
+ zh_Hans: 危地马拉
+ pt_BR: Guatemala
+ - value: GN
+ label:
+ en_US: Guinea
+ zh_Hans: 几内亚
+ pt_BR: Guiné
+ - value: GW
+ label:
+ en_US: Guinea-Bissau
+ zh_Hans: 几内亚比绍
+ pt_BR: Guiné-Bissau
+ - value: GY
+ label:
+ en_US: Guyana
+ zh_Hans: 圭亚那
+ pt_BR: Guiana
+ - value: HT
+ label:
+ en_US: Haiti
+ zh_Hans: 海地
+ pt_BR: Haiti
+ - value: HM
+ label:
+ en_US: Heard Island and McDonald Islands
+ zh_Hans: 赫德岛和麦克唐纳群岛
+ pt_BR: Ilha Heard e Ilhas McDonald
+ - value: VA
+ label:
+ en_US: Holy See (Vatican City State)
+ zh_Hans: 教廷(梵蒂冈城国)
+ pt_BR: Santa Sé (Estado da Cidade do Vaticano)
+ - value: HN
+ label:
+ en_US: Honduras
+ zh_Hans: 洪都拉斯
+ pt_BR: Honduras
- value: HK
label:
en_US: Hong Kong
zh_Hans: 香港
pt_BR: Hong Kong
+ - value: HU
+ label:
+ en_US: Hungary
+ zh_Hans: 匈牙利
+ pt_BR: Hungria
+ - value: IS
+ label:
+ en_US: Iceland
+ zh_Hans: 冰岛
+ pt_BR: Islândia
- value: IN
label:
en_US: India
zh_Hans: 印度
- pt_BR: India
+ pt_BR: Índia
- value: ID
label:
en_US: Indonesia
zh_Hans: 印度尼西亚
- pt_BR: Indonesia
+ pt_BR: Indonésia
+ - value: IR
+ label:
+ en_US: Iran, Islamic Republic of
+ zh_Hans: 伊朗
+ pt_BR: Irã
+ - value: IQ
+ label:
+ en_US: Iraq
+ zh_Hans: 伊拉克
+ pt_BR: Iraque
+ - value: IE
+ label:
+ en_US: Ireland
+ zh_Hans: 爱尔兰
+ pt_BR: Irlanda
+ - value: IL
+ label:
+ en_US: Israel
+ zh_Hans: 以色列
+ pt_BR: Israel
- value: IT
label:
en_US: Italy
zh_Hans: 意大利
- pt_BR: Italy
+ pt_BR: Itália
+ - value: JM
+ label:
+ en_US: Jamaica
+ zh_Hans: 牙买加
+ pt_BR: Jamaica
- value: JP
label:
en_US: Japan
zh_Hans: 日本
- pt_BR: Japan
+ pt_BR: Japão
+ - value: JO
+ label:
+ en_US: Jordan
+ zh_Hans: 约旦
+ pt_BR: Jordânia
+ - value: KZ
+ label:
+ en_US: Kazakhstan
+ zh_Hans: 哈萨克斯坦
+ pt_BR: Cazaquistão
+ - value: KE
+ label:
+ en_US: Kenya
+ zh_Hans: 肯尼亚
+ pt_BR: Quênia
+ - value: KI
+ label:
+ en_US: Kiribati
+ zh_Hans: 基里巴斯
+ pt_BR: Kiribati
+ - value: KP
+ label:
+ en_US: Korea, Democratic People's Republic of
+ zh_Hans: 朝鲜
+ pt_BR: Coreia, República Democrática Popular da
- value: KR
label:
- en_US: Korea
+ en_US: Korea, Republic of
zh_Hans: 韩国
- pt_BR: Korea
+ pt_BR: Coreia, República da
+ - value: KW
+ label:
+ en_US: Kuwait
+ zh_Hans: 科威特
+ pt_BR: Kuwait
+ - value: KG
+ label:
+ en_US: Kyrgyzstan
+ zh_Hans: 吉尔吉斯斯坦
+ pt_BR: Quirguistão
+ - value: LA
+ label:
+ en_US: Lao People's Democratic Republic
+ zh_Hans: 老挝
+ pt_BR: República Democrática Popular do Laos
+ - value: LV
+ label:
+ en_US: Latvia
+ zh_Hans: 拉脱维亚
+ pt_BR: Letônia
+ - value: LB
+ label:
+ en_US: Lebanon
+ zh_Hans: 黎巴嫩
+ pt_BR: Líbano
+ - value: LS
+ label:
+ en_US: Lesotho
+ zh_Hans: 莱索托
+ pt_BR: Lesoto
+ - value: LR
+ label:
+ en_US: Liberia
+ zh_Hans: 利比里亚
+ pt_BR: Libéria
+ - value: LY
+ label:
+ en_US: Libyan Arab Jamahiriya
+ zh_Hans: 利比亚
+ pt_BR: Líbia
+ - value: LI
+ label:
+ en_US: Liechtenstein
+ zh_Hans: 列支敦士登
+ pt_BR: Liechtenstein
+ - value: LT
+ label:
+ en_US: Lithuania
+ zh_Hans: 立陶宛
+ pt_BR: Lituânia
+ - value: LU
+ label:
+ en_US: Luxembourg
+ zh_Hans: 卢森堡
+ pt_BR: Luxemburgo
+ - value: MO
+ label:
+ en_US: Macao
+ zh_Hans: 澳门
+ pt_BR: Macau
+ - value: MK
+ label:
+ en_US: Macedonia, the Former Yugosalv Republic of
+ zh_Hans: 前南斯拉夫马其顿共和国
+ pt_BR: Macedônia, Ex-República Iugoslava da
+ - value: MG
+ label:
+ en_US: Madagascar
+ zh_Hans: 马达加斯加
+ pt_BR: Madagascar
+ - value: MW
+ label:
+ en_US: Malawi
+ zh_Hans: 马拉维
+ pt_BR: Malaui
- value: MY
label:
en_US: Malaysia
zh_Hans: 马来西亚
- pt_BR: Malaysia
+ pt_BR: Malásia
+ - value: MV
+ label:
+ en_US: Maldives
+ zh_Hans: 马尔代夫
+ pt_BR: Maldivas
+ - value: ML
+ label:
+ en_US: Mali
+ zh_Hans: 马里
+ pt_BR: Mali
+ - value: MT
+ label:
+ en_US: Malta
+ zh_Hans: 马耳他
+ pt_BR: Malta
+ - value: MH
+ label:
+ en_US: Marshall Islands
+ zh_Hans: 马绍尔群岛
+ pt_BR: Ilhas Marshall
+ - value: MQ
+ label:
+ en_US: Martinique
+ zh_Hans: 马提尼克
+ pt_BR: Martinica
+ - value: MR
+ label:
+ en_US: Mauritania
+ zh_Hans: 毛里塔尼亚
+ pt_BR: Mauritânia
+ - value: MU
+ label:
+ en_US: Mauritius
+ zh_Hans: 毛里求斯
+ pt_BR: Maurício
+ - value: YT
+ label:
+ en_US: Mayotte
+ zh_Hans: 马约特
+ pt_BR: Mayotte
- value: MX
label:
en_US: Mexico
zh_Hans: 墨西哥
- pt_BR: Mexico
+ pt_BR: México
+ - value: FM
+ label:
+ en_US: Micronesia, Federated States of
+ zh_Hans: 密克罗尼西亚联邦
+ pt_BR: Micronésia, Estados Federados da
+ - value: MD
+ label:
+ en_US: Moldova, Republic of
+ zh_Hans: 摩尔多瓦共和国
+ pt_BR: Moldávia, República da
+ - value: MC
+ label:
+ en_US: Monaco
+ zh_Hans: 摩纳哥
+ pt_BR: Mônaco
+ - value: MN
+ label:
+ en_US: Mongolia
+ zh_Hans: 蒙古
+ pt_BR: Mongólia
+ - value: MS
+ label:
+ en_US: Montserrat
+ zh_Hans: 蒙特塞拉特
+ pt_BR: Montserrat
+ - value: MA
+ label:
+ en_US: Morocco
+ zh_Hans: 摩洛哥
+ pt_BR: Marrocos
+ - value: MZ
+ label:
+ en_US: Mozambique
+ zh_Hans: 莫桑比克
+ pt_BR: Moçambique
+ - value: MM
+ label:
+ en_US: Myanmar
+ zh_Hans: 缅甸
+ pt_BR: Mianmar
+ - value: NA
+ label:
+ en_US: Namibia
+ zh_Hans: 纳米比亚
+ pt_BR: Namíbia
+ - value: NR
+ label:
+ en_US: Nauru
+ zh_Hans: 瑙鲁
+ pt_BR: Nauru
+ - value: NP
+ label:
+ en_US: Nepal
+ zh_Hans: 尼泊尔
+ pt_BR: Nepal
- value: NL
label:
en_US: Netherlands
zh_Hans: 荷兰
- pt_BR: Netherlands
+ pt_BR: Países Baixos
+ - value: AN
+ label:
+ en_US: Netherlands Antilles
+ zh_Hans: 荷属安的列斯
+ pt_BR: Antilhas Holandesas
+ - value: NC
+ label:
+ en_US: New Caledonia
+ zh_Hans: 新喀里多尼亚
+ pt_BR: Nova Caledônia
- value: NZ
label:
en_US: New Zealand
zh_Hans: 新西兰
- pt_BR: New Zealand
- - value: 'NO'
+ pt_BR: Nova Zelândia
+ - value: NI
+ label:
+ en_US: Nicaragua
+ zh_Hans: 尼加拉瓜
+ pt_BR: Nicarágua
+ - value: NE
+ label:
+ en_US: Niger
+ zh_Hans: 尼日尔
+ pt_BR: Níger
+ - value: NG
+ label:
+ en_US: Nigeria
+ zh_Hans: 尼日利亚
+ pt_BR: Nigéria
+ - value: NU
+ label:
+ en_US: Niue
+ zh_Hans: 纽埃
+ pt_BR: Niue
+ - value: NF
+ label:
+ en_US: Norfolk Island
+ zh_Hans: 诺福克岛
+ pt_BR: Ilha Norfolk
+ - value: MP
+ label:
+ en_US: Northern Mariana Islands
+ zh_Hans: 北马里亚纳群岛
+ pt_BR: Ilhas Marianas do Norte
+ - value: "NO"
label:
en_US: Norway
zh_Hans: 挪威
- pt_BR: Norway
+ pt_BR: Noruega
+ - value: OM
+ label:
+ en_US: Oman
+ zh_Hans: 阿曼
+ pt_BR: Omã
+ - value: PK
+ label:
+ en_US: Pakistan
+ zh_Hans: 巴基斯坦
+ pt_BR: Paquistão
+ - value: PW
+ label:
+ en_US: Palau
+ zh_Hans: 帕劳
+ pt_BR: Palau
+ - value: PS
+ label:
+ en_US: Palestinian Territory, Occupied
+ zh_Hans: 巴勒斯坦领土
+ pt_BR: Palestina, Território Ocupado
+ - value: PA
+ label:
+ en_US: Panama
+ zh_Hans: 巴拿马
+ pt_BR: Panamá
+ - value: PG
+ label:
+ en_US: Papua New Guinea
+ zh_Hans: 巴布亚新几内亚
+ pt_BR: Papua Nova Guiné
+ - value: PY
+ label:
+ en_US: Paraguay
+ zh_Hans: 巴拉圭
+ pt_BR: Paraguai
+ - value: PE
+ label:
+ en_US: Peru
+ zh_Hans: 秘鲁
+ pt_BR: Peru
- value: PH
label:
en_US: Philippines
zh_Hans: 菲律宾
- pt_BR: Philippines
+ pt_BR: Filipinas
+ - value: PN
+ label:
+ en_US: Pitcairn
+ zh_Hans: 皮特凯恩岛
+ pt_BR: Pitcairn
- value: PL
label:
en_US: Poland
zh_Hans: 波兰
- pt_BR: Poland
+ pt_BR: Polônia
- value: PT
label:
en_US: Portugal
zh_Hans: 葡萄牙
pt_BR: Portugal
+ - value: PR
+ label:
+ en_US: Puerto Rico
+ zh_Hans: 波多黎各
+ pt_BR: Porto Rico
+ - value: QA
+ label:
+ en_US: Qatar
+ zh_Hans: 卡塔尔
+ pt_BR: Catar
+ - value: RE
+ label:
+ en_US: Reunion
+ zh_Hans: 留尼旺
+ pt_BR: Reunião
+ - value: RO
+ label:
+ en_US: Romania
+ zh_Hans: 罗马尼亚
+ pt_BR: Romênia
- value: RU
label:
- en_US: Russia
- zh_Hans: 俄罗斯
- pt_BR: Russia
+ en_US: Russian Federation
+ zh_Hans: 俄罗斯联邦
+ pt_BR: Rússia
+ - value: RW
+ label:
+ en_US: Rwanda
+ zh_Hans: 卢旺达
+ pt_BR: Ruanda
+ - value: SH
+ label:
+ en_US: Saint Helena
+ zh_Hans: 圣赫勒拿
+ pt_BR: Santa Helena
+ - value: KN
+ label:
+ en_US: Saint Kitts and Nevis
+ zh_Hans: 圣基茨和尼维斯
+ pt_BR: São Cristóvão e Nevis
+ - value: LC
+ label:
+ en_US: Saint Lucia
+ zh_Hans: 圣卢西亚
+ pt_BR: Santa Lúcia
+ - value: PM
+ label:
+ en_US: Saint Pierre and Miquelon
+ zh_Hans: 圣皮埃尔和密克隆
+ pt_BR: São Pedro e Miquelon
+ - value: VC
+ label:
+ en_US: Saint Vincent and the Grenadines
+ zh_Hans: 圣文森特和格林纳丁斯
+ pt_BR: São Vicente e Granadinas
+ - value: WS
+ label:
+ en_US: Samoa
+ zh_Hans: 萨摩亚
+ pt_BR: Samoa
+ - value: SM
+ label:
+ en_US: San Marino
+ zh_Hans: 圣马力诺
+ pt_BR: San Marino
+ - value: ST
+ label:
+ en_US: Sao Tome and Principe
+ zh_Hans: 圣多美和普林西比
+ pt_BR: São Tomé e Príncipe
- value: SA
label:
en_US: Saudi Arabia
zh_Hans: 沙特阿拉伯
- pt_BR: Saudi Arabia
+ pt_BR: Arábia Saudita
+ - value: SN
+ label:
+ en_US: Senegal
+ zh_Hans: 塞内加尔
+ pt_BR: Senegal
+ - value: RS
+ label:
+ en_US: Serbia and Montenegro
+ zh_Hans: 塞尔维亚和黑山
+ pt_BR: Sérvia e Montenegro
+ - value: SC
+ label:
+ en_US: Seychelles
+ zh_Hans: 塞舌尔
+ pt_BR: Seicheles
+ - value: SL
+ label:
+ en_US: Sierra Leone
+ zh_Hans: 塞拉利昂
+ pt_BR: Serra Leoa
- value: SG
label:
en_US: Singapore
zh_Hans: 新加坡
- pt_BR: Singapore
+ pt_BR: Singapura
+ - value: SK
+ label:
+ en_US: Slovakia
+ zh_Hans: 斯洛伐克
+ pt_BR: Eslováquia
+ - value: SI
+ label:
+ en_US: Slovenia
+ zh_Hans: 斯洛文尼亚
+ pt_BR: Eslovênia
+ - value: SB
+ label:
+ en_US: Solomon Islands
+ zh_Hans: 所罗门群岛
+ pt_BR: Ilhas Salomão
+ - value: SO
+ label:
+ en_US: Somalia
+ zh_Hans: 索马里
+ pt_BR: Somália
- value: ZA
label:
en_US: South Africa
zh_Hans: 南非
- pt_BR: South Africa
+ pt_BR: África do Sul
+ - value: GS
+ label:
+ en_US: South Georgia and the South Sandwich Islands
+ zh_Hans: 南乔治亚和南桑威奇群岛
+ pt_BR: Geórgia do Sul e Ilhas Sandwich do Sul
- value: ES
label:
en_US: Spain
zh_Hans: 西班牙
- pt_BR: Spain
+ pt_BR: Espanha
+ - value: LK
+ label:
+ en_US: Sri Lanka
+ zh_Hans: 斯里兰卡
+ pt_BR: Sri Lanka
+ - value: SD
+ label:
+ en_US: Sudan
+ zh_Hans: 苏丹
+ pt_BR: Sudão
+ - value: SR
+ label:
+ en_US: Suriname
+ zh_Hans: 苏里南
+ pt_BR: Suriname
+ - value: SJ
+ label:
+ en_US: Svalbard and Jan Mayen
+ zh_Hans: 斯瓦尔巴特和扬马延岛
+ pt_BR: Svalbard e Jan Mayen
+ - value: SZ
+ label:
+ en_US: Swaziland
+ zh_Hans: 斯威士兰
+ pt_BR: Essuatíni
- value: SE
label:
en_US: Sweden
zh_Hans: 瑞典
- pt_BR: Sweden
+ pt_BR: Suécia
- value: CH
label:
en_US: Switzerland
zh_Hans: 瑞士
- pt_BR: Switzerland
+ pt_BR: Suíça
+ - value: SY
+ label:
+ en_US: Syrian Arab Republic
+ zh_Hans: 叙利亚
+ pt_BR: Síria
- value: TW
label:
- en_US: Taiwan
+ en_US: Taiwan, Province of China
zh_Hans: 台湾
pt_BR: Taiwan
+ - value: TJ
+ label:
+ en_US: Tajikistan
+ zh_Hans: 塔吉克斯坦
+ pt_BR: Tajiquistão
+ - value: TZ
+ label:
+ en_US: Tanzania, United Republic of
+ zh_Hans: 坦桑尼亚联合共和国
+ pt_BR: Tanzânia
- value: TH
label:
en_US: Thailand
zh_Hans: 泰国
- pt_BR: Thailand
+ pt_BR: Tailândia
+ - value: TL
+ label:
+ en_US: Timor-Leste
+ zh_Hans: 东帝汶
+ pt_BR: Timor-Leste
+ - value: TG
+ label:
+ en_US: Togo
+ zh_Hans: 多哥
+ pt_BR: Togo
+ - value: TK
+ label:
+ en_US: Tokelau
+ zh_Hans: 托克劳
+ pt_BR: Toquelau
+ - value: TO
+ label:
+ en_US: Tonga
+ zh_Hans: 汤加
+ pt_BR: Tonga
+ - value: TT
+ label:
+ en_US: Trinidad and Tobago
+ zh_Hans: 特立尼达和多巴哥
+ pt_BR: Trindade e Tobago
+ - value: TN
+ label:
+ en_US: Tunisia
+ zh_Hans: 突尼斯
+ pt_BR: Tunísia
- value: TR
label:
en_US: Turkey
zh_Hans: 土耳其
- pt_BR: Turkey
+ pt_BR: Turquia
+ - value: TM
+ label:
+ en_US: Turkmenistan
+ zh_Hans: 土库曼斯坦
+ pt_BR: Turcomenistão
+ - value: TC
+ label:
+ en_US: Turks and Caicos Islands
+ zh_Hans: 特克斯和凯科斯群岛
+ pt_BR: Ilhas Turks e Caicos
+ - value: TV
+ label:
+ en_US: Tuvalu
+ zh_Hans: 图瓦卢
+ pt_BR: Tuvalu
+ - value: UG
+ label:
+ en_US: Uganda
+ zh_Hans: 乌干达
+ pt_BR: Uganda
+ - value: UA
+ label:
+ en_US: Ukraine
+ zh_Hans: 乌克兰
+ pt_BR: Ucrânia
+ - value: AE
+ label:
+ en_US: United Arab Emirates
+ zh_Hans: 阿联酋
+ pt_BR: Emirados Árabes Unidos
+ - value: UK
+ label:
+ en_US: United Kingdom
+ zh_Hans: 英国
+ pt_BR: Reino Unido
- value: GB
label:
en_US: United Kingdom
zh_Hans: 英国
- pt_BR: United Kingdom
+ pt_BR: Reino Unido
- value: US
label:
en_US: United States
zh_Hans: 美国
- pt_BR: United States
+ pt_BR: Estados Unidos
+ - value: UM
+ label:
+ en_US: United States Minor Outlying Islands
+ zh_Hans: 美国本土外小岛屿
+ pt_BR: Ilhas Menores Distantes dos Estados Unidos
+ - value: UY
+ label:
+ en_US: Uruguay
+ zh_Hans: 乌拉圭
+ pt_BR: Uruguai
+ - value: UZ
+ label:
+ en_US: Uzbekistan
+ zh_Hans: 乌兹别克斯坦
+ pt_BR: Uzbequistão
+ - value: VU
+ label:
+ en_US: Vanuatu
+ zh_Hans: 瓦努阿图
+ pt_BR: Vanuatu
+ - value: VE
+ label:
+ en_US: Venezuela
+ zh_Hans: 委内瑞拉
+ pt_BR: Venezuela
+ - value: VN
+ label:
+ en_US: Viet Nam
+ zh_Hans: 越南
+ pt_BR: Vietnã
+ - value: VG
+ label:
+ en_US: Virgin Islands, British
+ zh_Hans: 英属维尔京群岛
+ pt_BR: Ilhas Virgens Britânicas
+ - value: VI
+ label:
+ en_US: Virgin Islands, U.S.
+ zh_Hans: 美属维尔京群岛
+ pt_BR: Ilhas Virgens dos EUA
+ - value: WF
+ label:
+ en_US: Wallis and Futuna
+ zh_Hans: 瓦利斯和富图纳群岛
+ pt_BR: Wallis e Futuna
+ - value: EH
+ label:
+ en_US: Western Sahara
+ zh_Hans: 西撒哈拉
+ pt_BR: Saara Ocidental
+ - value: YE
+ label:
+ en_US: Yemen
+ zh_Hans: 也门
+ pt_BR: Iémen
+ - value: ZM
+ label:
+ en_US: Zambia
+ zh_Hans: 赞比亚
+ pt_BR: Zâmbia
+ - value: ZW
+ label:
+ en_US: Zimbabwe
+ zh_Hans: 津巴布韦
+ pt_BR: Zimbábue
- name: hl
type: select
label:
@@ -277,18 +1277,94 @@ parameters:
default: en
form: form
options:
+ - value: af
+ label:
+ en_US: Afrikaans
+ zh_Hans: 南非语
+ - value: ak
+ label:
+ en_US: Akan
+ zh_Hans: 阿坎语
+ - value: sq
+ label:
+ en_US: Albanian
+ zh_Hans: 阿尔巴尼亚语
+ - value: ws
+ label:
+ en_US: Samoa
+ zh_Hans: 萨摩亚语
+ - value: am
+ label:
+ en_US: Amharic
+ zh_Hans: 阿姆哈拉语
- value: ar
label:
en_US: Arabic
zh_Hans: 阿拉伯语
+ - value: hy
+ label:
+ en_US: Armenian
+ zh_Hans: 亚美尼亚语
+ - value: az
+ label:
+ en_US: Azerbaijani
+ zh_Hans: 阿塞拜疆语
+ - value: eu
+ label:
+ en_US: Basque
+ zh_Hans: 巴斯克语
+ - value: be
+ label:
+ en_US: Belarusian
+ zh_Hans: 白俄罗斯语
+ - value: bem
+ label:
+ en_US: Bemba
+ zh_Hans: 班巴语
+ - value: bn
+ label:
+ en_US: Bengali
+ zh_Hans: 孟加拉语
+ - value: bh
+ label:
+ en_US: Bihari
+ zh_Hans: 比哈尔语
+ - value: xx-bork
+ label:
+ en_US: Bork, bork, bork!
+ zh_Hans: 博克语
+ - value: bs
+ label:
+ en_US: Bosnian
+ zh_Hans: 波斯尼亚语
+ - value: br
+ label:
+ en_US: Breton
+ zh_Hans: 布列塔尼语
- value: bg
label:
en_US: Bulgarian
zh_Hans: 保加利亚语
+ - value: bt
+ label:
+ en_US: Bhutanese
+ zh_Hans: 不丹语
+ - value: km
+ label:
+ en_US: Cambodian
+ zh_Hans: 高棉语
- value: ca
label:
en_US: Catalan
zh_Hans: 加泰罗尼亚语
+ - value: chr
+ label:
+ en_US: Cherokee
+ zh_Hans: 切罗基语
+ - value: ny
+ label:
+ en_US: Chichewa
+ zh_Hans: 齐切瓦语
- value: zh-cn
label:
en_US: Chinese (Simplified)
@@ -297,6 +1373,14 @@ parameters:
label:
en_US: Chinese (Traditional)
zh_Hans: 中文(繁体)
+ - value: co
+ label:
+ en_US: Corsican
+ zh_Hans: 科西嘉语
+ - value: hr
+ label:
+ en_US: Croatian
+ zh_Hans: 克罗地亚语
- value: cs
label:
en_US: Czech
@@ -309,14 +1393,34 @@ parameters:
label:
en_US: Dutch
zh_Hans: 荷兰语
+ - value: xx-elmer
+ label:
+ en_US: Elmer Fudd
+ zh_Hans: 艾尔默福德语
- value: en
label:
en_US: English
zh_Hans: 英语
+ - value: eo
+ label:
+ en_US: Esperanto
+ zh_Hans: 世界语
- value: et
label:
en_US: Estonian
zh_Hans: 爱沙尼亚语
+ - value: ee
+ label:
+ en_US: Ewe
+ zh_Hans: 埃维语
+ - value: fo
+ label:
+ en_US: Faroese
+ zh_Hans: 法罗语
+ - value: tl
+ label:
+ en_US: Filipino
+ zh_Hans: 菲律宾语
- value: fi
label:
en_US: Finnish
@@ -325,6 +1429,22 @@ parameters:
label:
en_US: French
zh_Hans: 法语
+ - value: fy
+ label:
+ en_US: Frisian
+ zh_Hans: 弗里西亚语
+ - value: gaa
+ label:
+ en_US: Ga
+ zh_Hans: 加语
+ - value: gl
+ label:
+ en_US: Galician
+ zh_Hans: 加利西亚语
+ - value: ka
+ label:
+ en_US: Georgian
+ zh_Hans: 格鲁吉亚语
- value: de
label:
en_US: German
@@ -333,6 +1453,34 @@ parameters:
label:
en_US: Greek
zh_Hans: 希腊语
+ - value: kl
+ label:
+ en_US: Greenlandic
+ zh_Hans: 格陵兰语
+ - value: gn
+ label:
+ en_US: Guarani
+ zh_Hans: 瓜拉尼语
+ - value: gu
+ label:
+ en_US: Gujarati
+ zh_Hans: 古吉拉特语
+ - value: xx-hacker
+ label:
+ en_US: Hacker
+ zh_Hans: 黑客语
+ - value: ht
+ label:
+ en_US: Haitian Creole
+ zh_Hans: 海地克里奥尔语
+ - value: ha
+ label:
+ en_US: Hausa
+ zh_Hans: 豪萨语
+ - value: haw
+ label:
+ en_US: Hawaiian
+ zh_Hans: 夏威夷语
- value: iw
label:
en_US: Hebrew
@@ -345,10 +1493,26 @@ parameters:
label:
en_US: Hungarian
zh_Hans: 匈牙利语
+ - value: is
+ label:
+ en_US: Icelandic
+ zh_Hans: 冰岛语
+ - value: ig
+ label:
+ en_US: Igbo
+ zh_Hans: 伊博语
- value: id
label:
en_US: Indonesian
zh_Hans: 印尼语
+ - value: ia
+ label:
+ en_US: Interlingua
+ zh_Hans: 国际语
+ - value: ga
+ label:
+ en_US: Irish
+ zh_Hans: 爱尔兰语
- value: it
label:
en_US: Italian
@@ -357,22 +1521,94 @@ parameters:
label:
en_US: Japanese
zh_Hans: 日语
+ - value: jw
+ label:
+ en_US: Javanese
+ zh_Hans: 爪哇语
- value: kn
label:
en_US: Kannada
zh_Hans: 卡纳达语
+ - value: kk
+ label:
+ en_US: Kazakh
+ zh_Hans: 哈萨克语
+ - value: rw
+ label:
+ en_US: Kinyarwanda
+ zh_Hans: 基尼亚卢旺达语
+ - value: rn
+ label:
+ en_US: Kirundi
+ zh_Hans: 基隆迪语
+ - value: xx-klingon
+ label:
+ en_US: Klingon
+ zh_Hans: 克林贡语
+ - value: kg
+ label:
+ en_US: Kongo
+ zh_Hans: 刚果语
- value: ko
label:
en_US: Korean
zh_Hans: 韩语
+ - value: kri
+ label:
+ en_US: Krio (Sierra Leone)
+ zh_Hans: 塞拉利昂克里奥尔语
+ - value: ku
+ label:
+ en_US: Kurdish
+ zh_Hans: 库尔德语
+ - value: ckb
+ label:
+ en_US: Kurdish (Soranî)
+ zh_Hans: 库尔德语(索拉尼)
+ - value: ky
+ label:
+ en_US: Kyrgyz
+ zh_Hans: 吉尔吉斯语
+ - value: lo
+ label:
+ en_US: Laothian
+ zh_Hans: 老挝语
+ - value: la
+ label:
+ en_US: Latin
+ zh_Hans: 拉丁语
- value: lv
label:
en_US: Latvian
zh_Hans: 拉脱维亚语
+ - value: ln
+ label:
+ en_US: Lingala
+ zh_Hans: 林加拉语
- value: lt
label:
en_US: Lithuanian
zh_Hans: 立陶宛语
+ - value: loz
+ label:
+ en_US: Lozi
+ zh_Hans: 洛齐语
+ - value: lg
+ label:
+ en_US: Luganda
+ zh_Hans: 卢干达语
+ - value: ach
+ label:
+ en_US: Luo
+ zh_Hans: 卢奥语
+ - value: mk
+ label:
+ en_US: Macedonian
+ zh_Hans: 马其顿语
+ - value: mg
+ label:
+ en_US: Malagasy
+ zh_Hans: 马尔加什语
- value: my
label:
en_US: Malay
@@ -381,18 +1617,90 @@ parameters:
label:
en_US: Malayalam
zh_Hans: 马拉雅拉姆语
+ - value: mt
+ label:
+ en_US: Maltese
+ zh_Hans: 马耳他语
+ - value: mv
+ label:
+ en_US: Maldives
+ zh_Hans: 马尔代夫语
+ - value: mi
+ label:
+ en_US: Maori
+ zh_Hans: 毛利语
- value: mr
label:
en_US: Marathi
zh_Hans: 马拉地语
+ - value: mfe
+ label:
+ en_US: Mauritian Creole
+ zh_Hans: 毛里求斯克里奥尔语
+ - value: mo
+ label:
+ en_US: Moldavian
+ zh_Hans: 摩尔达维亚语
+ - value: mn
+ label:
+ en_US: Mongolian
+ zh_Hans: 蒙古语
+ - value: sr-me
+ label:
+ en_US: Montenegrin
+ zh_Hans: 黑山语
+ - value: ne
+ label:
+ en_US: Nepali
+ zh_Hans: 尼泊尔语
+ - value: pcm
+ label:
+ en_US: Nigerian Pidgin
+ zh_Hans: 尼日利亚皮钦语
+ - value: nso
+ label:
+ en_US: Northern Sotho
+ zh_Hans: 北索托语
- value: "no"
label:
en_US: Norwegian
zh_Hans: 挪威语
+ - value: nn
+ label:
+ en_US: Norwegian (Nynorsk)
+ zh_Hans: 挪威语(尼诺斯克语)
+ - value: oc
+ label:
+ en_US: Occitan
+ zh_Hans: 奥克语
+ - value: or
+ label:
+ en_US: Oriya
+ zh_Hans: 奥里亚语
+ - value: om
+ label:
+ en_US: Oromo
+ zh_Hans: 奥罗莫语
+ - value: ps
+ label:
+ en_US: Pashto
+ zh_Hans: 普什图语
+ - value: fa
+ label:
+ en_US: Persian
+ zh_Hans: 波斯语
+ - value: xx-pirate
+ label:
+ en_US: Pirate
+ zh_Hans: 海盗语
- value: pl
label:
en_US: Polish
zh_Hans: 波兰语
+ - value: pt
+ label:
+ en_US: Portuguese
+ zh_Hans: 葡萄牙语
- value: pt-br
label:
en_US: Portuguese (Brazil)
@@ -405,18 +1713,62 @@ parameters:
label:
en_US: Punjabi
zh_Hans: 旁遮普语
+ - value: qu
+ label:
+ en_US: Quechua
+ zh_Hans: 克丘亚语
- value: ro
label:
en_US: Romanian
zh_Hans: 罗马尼亚语
+ - value: rm
+ label:
+ en_US: Romansh
+ zh_Hans: 罗曼什语
+ - value: nyn
+ label:
+ en_US: Runyakitara
+ zh_Hans: 卢尼亚基塔拉语
- value: ru
label:
en_US: Russian
zh_Hans: 俄语
+ - value: gd
+ label:
+ en_US: Scots Gaelic
+ zh_Hans: 苏格兰盖尔语
- value: sr
label:
en_US: Serbian
zh_Hans: 塞尔维亚语
+ - value: sh
+ label:
+ en_US: Serbo-Croatian
+ zh_Hans: 塞尔维亚-克罗地亚语
+ - value: st
+ label:
+ en_US: Sesotho
+ zh_Hans: 塞索托语
+ - value: tn
+ label:
+ en_US: Setswana
+ zh_Hans: 塞茨瓦纳语
+ - value: crs
+ label:
+ en_US: Seychellois Creole
+ zh_Hans: 塞舌尔克里奥尔语
+ - value: sn
+ label:
+ en_US: Shona
+ zh_Hans: 绍纳语
+ - value: sd
+ label:
+ en_US: Sindhi
+ zh_Hans: 信德语
+ - value: si
+ label:
+ en_US: Sinhalese
+ zh_Hans: 僧伽罗语
- value: sk
label:
en_US: Slovak
@@ -425,18 +1777,42 @@ parameters:
label:
en_US: Slovenian
zh_Hans: 斯洛文尼亚语
+ - value: so
+ label:
+ en_US: Somali
+ zh_Hans: 索马里语
- value: es
label:
en_US: Spanish
zh_Hans: 西班牙语
+ - value: es-419
+ label:
+ en_US: Spanish (Latin American)
+ zh_Hans: 西班牙语(拉丁美洲)
+ - value: su
+ label:
+ en_US: Sundanese
+ zh_Hans: 巽他语
+ - value: sw
+ label:
+ en_US: Swahili
+ zh_Hans: 斯瓦希里语
- value: sv
label:
en_US: Swedish
zh_Hans: 瑞典语
+ - value: tg
+ label:
+ en_US: Tajik
+ zh_Hans: 塔吉克语
- value: ta
label:
en_US: Tamil
zh_Hans: 泰米尔语
+ - value: tt
+ label:
+ en_US: Tatar
+ zh_Hans: 鞑靼语
- value: te
label:
en_US: Telugu
@@ -445,18 +1821,82 @@ parameters:
label:
en_US: Thai
zh_Hans: 泰语
+ - value: ti
+ label:
+ en_US: Tigrinya
+ zh_Hans: 提格利尼亚语
+ - value: to
+ label:
+ en_US: Tonga
+ zh_Hans: 汤加语
+ - value: lua
+ label:
+ en_US: Tshiluba
+ zh_Hans: 卢巴语
+ - value: tum
+ label:
+ en_US: Tumbuka
+ zh_Hans: 图布卡语
- value: tr
label:
en_US: Turkish
zh_Hans: 土耳其语
+ - value: tk
+ label:
+ en_US: Turkmen
+ zh_Hans: 土库曼语
+ - value: tw
+ label:
+ en_US: Twi
+ zh_Hans: 契维语
+ - value: ug
+ label:
+ en_US: Uighur
+ zh_Hans: 维吾尔语
- value: uk
label:
en_US: Ukrainian
zh_Hans: 乌克兰语
+ - value: ur
+ label:
+ en_US: Urdu
+ zh_Hans: 乌尔都语
+ - value: uz
+ label:
+ en_US: Uzbek
+ zh_Hans: 乌兹别克语
+ - value: vu
+ label:
+ en_US: Vanuatu
+ zh_Hans: 瓦努阿图语
- value: vi
label:
en_US: Vietnamese
zh_Hans: 越南语
+ - value: cy
+ label:
+ en_US: Welsh
+ zh_Hans: 威尔士语
+ - value: wo
+ label:
+ en_US: Wolof
+ zh_Hans: 沃洛夫语
+ - value: xh
+ label:
+ en_US: Xhosa
+ zh_Hans: 科萨语
+ - value: yi
+ label:
+ en_US: Yiddish
+ zh_Hans: 意第绪语
+ - value: yo
+ label:
+ en_US: Yoruba
+ zh_Hans: 约鲁巴语
+ - value: zu
+ label:
+ en_US: Zulu
+ zh_Hans: 祖鲁语
- name: google_domain
type: string
required: false
From 5e250403d30fe8492ffe828ac601befb262e1cf2 Mon Sep 17 00:00:00 2001
From: zhuhao <37029601+hwzhuhao@users.noreply.github.com>
Date: Wed, 9 Oct 2024 11:04:26 +0800
Subject: [PATCH 17/61] chore: add the missing tool names to the _position file
(#9099)
---
api/core/tools/provider/_position.yaml | 66 +++++++++++++++++++-------
1 file changed, 48 insertions(+), 18 deletions(-)
diff --git a/api/core/tools/provider/_position.yaml b/api/core/tools/provider/_position.yaml
index e0a8e7511e..6bab9a09d8 100644
--- a/api/core/tools/provider/_position.yaml
+++ b/api/core/tools/provider/_position.yaml
@@ -5,31 +5,41 @@
- searchapi
- serper
- searxng
+- websearch
+- tavily
+- stackexchange
+- pubmed
+- arxiv
+- aws
+- nominatim
+- devdocs
+- spider
+- firecrawl
+- brave
+- crossref
+- jina
+- webscraper
- dalle
- azuredalle
- stability
-- wikipedia
-- nominatim
-- yahoo
-- alphavantage
-- arxiv
-- pubmed
- stablediffusion
-- webscraper
-- jina
+- cogview
+- comfyui
+- getimgai
+- siliconflow
+- spark
+- stepfun
+- xinference
+- alphavantage
+- yahoo
+- openweather
+- gaode
- aippt
-- youtube
-- code
-- wolframalpha
-- maths
-- github
- chart
-- time
-- vectorizer
-- gaode
-- wecom
-- qrcode
+- youtube
+- did
- dingtalk
+- discord
- feishu
- feishu_base
- feishu_document
@@ -39,4 +49,24 @@
- feishu_calendar
- feishu_spreadsheet
- slack
+- twilio
+- wecom
+- wikipedia
+- code
+- wolframalpha
+- maths
+- github
+- gitlab
+- time
+- vectorizer
+- qrcode
- tianditu
+- google_translate
+- hap
+- json_process
+- judge0ce
+- novitaai
+- onebot
+- regex
+- trello
+- vanna
From 4be1aa516c3d48d0b1f8973d2827a732ab552f28 Mon Sep 17 00:00:00 2001
From: zhuhao <37029601+hwzhuhao@users.noreply.github.com>
Date: Wed, 9 Oct 2024 12:53:03 +0800
Subject: [PATCH 18/61] feat: add tags for vanna tools (#9102)
---
api/core/tools/provider/builtin/vanna/vanna.yaml | 3 +++
1 file changed, 3 insertions(+)
diff --git a/api/core/tools/provider/builtin/vanna/vanna.yaml b/api/core/tools/provider/builtin/vanna/vanna.yaml
index b29fa103e1..7f953be172 100644
--- a/api/core/tools/provider/builtin/vanna/vanna.yaml
+++ b/api/core/tools/provider/builtin/vanna/vanna.yaml
@@ -8,6 +8,9 @@ identity:
en_US: The fastest way to get actionable insights from your database just by asking questions.
zh_Hans: 一个基于大模型和RAG的Text2SQL工具。
icon: icon.png
+ tags:
+ - utilities
+ - productivity
credentials_for_provider:
api_key:
type: secret-input
From 5fcd614186217673c5f3e6de054cecb30330a85c Mon Sep 17 00:00:00 2001
From: zhuhao <37029601+hwzhuhao@users.noreply.github.com>
Date: Wed, 9 Oct 2024 12:53:55 +0800
Subject: [PATCH 19/61] feat: output the execution results of tool should only
in debug mode (#9104)
---
.../agent_tool_callback_handler.py | 41 +++++++++++--------
1 file changed, 23 insertions(+), 18 deletions(-)
diff --git a/api/core/callback_handler/agent_tool_callback_handler.py b/api/core/callback_handler/agent_tool_callback_handler.py
index 99e992fd89..d826edf6a0 100644
--- a/api/core/callback_handler/agent_tool_callback_handler.py
+++ b/api/core/callback_handler/agent_tool_callback_handler.py
@@ -1,9 +1,9 @@
-import os
from collections.abc import Mapping, Sequence
from typing import Any, Optional, TextIO, Union
from pydantic import BaseModel
+from configs import dify_config
from core.ops.entities.trace_entity import TraceTaskName
from core.ops.ops_trace_manager import TraceQueueManager, TraceTask
from core.tools.entities.tool_entities import ToolInvokeMessage
@@ -50,7 +50,8 @@ class DifyAgentCallbackHandler(BaseModel):
tool_inputs: Mapping[str, Any],
) -> None:
"""Do nothing."""
- print_text("\n[on_tool_start] ToolCall:" + tool_name + "\n" + str(tool_inputs) + "\n", color=self.color)
+ if dify_config.DEBUG:
+ print_text("\n[on_tool_start] ToolCall:" + tool_name + "\n" + str(tool_inputs) + "\n", color=self.color)
def on_tool_end(
self,
@@ -62,11 +63,12 @@ class DifyAgentCallbackHandler(BaseModel):
trace_manager: Optional[TraceQueueManager] = None,
) -> None:
"""If not the final action, print out observation."""
- print_text("\n[on_tool_end]\n", color=self.color)
- print_text("Tool: " + tool_name + "\n", color=self.color)
- print_text("Inputs: " + str(tool_inputs) + "\n", color=self.color)
- print_text("Outputs: " + str(tool_outputs)[:1000] + "\n", color=self.color)
- print_text("\n")
+ if dify_config.DEBUG:
+ print_text("\n[on_tool_end]\n", color=self.color)
+ print_text("Tool: " + tool_name + "\n", color=self.color)
+ print_text("Inputs: " + str(tool_inputs) + "\n", color=self.color)
+ print_text("Outputs: " + str(tool_outputs)[:1000] + "\n", color=self.color)
+ print_text("\n")
if trace_manager:
trace_manager.add_trace_task(
@@ -82,30 +84,33 @@ class DifyAgentCallbackHandler(BaseModel):
def on_tool_error(self, error: Union[Exception, KeyboardInterrupt], **kwargs: Any) -> None:
"""Do nothing."""
- print_text("\n[on_tool_error] Error: " + str(error) + "\n", color="red")
+ if dify_config.DEBUG:
+ print_text("\n[on_tool_error] Error: " + str(error) + "\n", color="red")
def on_agent_start(self, thought: str) -> None:
"""Run on agent start."""
- if thought:
- print_text(
- "\n[on_agent_start] \nCurrent Loop: " + str(self.current_loop) + "\nThought: " + thought + "\n",
- color=self.color,
- )
- else:
- print_text("\n[on_agent_start] \nCurrent Loop: " + str(self.current_loop) + "\n", color=self.color)
+ if dify_config.DEBUG:
+ if thought:
+ print_text(
+ "\n[on_agent_start] \nCurrent Loop: " + str(self.current_loop) + "\nThought: " + thought + "\n",
+ color=self.color,
+ )
+ else:
+ print_text("\n[on_agent_start] \nCurrent Loop: " + str(self.current_loop) + "\n", color=self.color)
def on_agent_finish(self, color: Optional[str] = None, **kwargs: Any) -> None:
"""Run on agent end."""
- print_text("\n[on_agent_finish]\n Loop: " + str(self.current_loop) + "\n", color=self.color)
+ if dify_config.DEBUG:
+ print_text("\n[on_agent_finish]\n Loop: " + str(self.current_loop) + "\n", color=self.color)
self.current_loop += 1
@property
def ignore_agent(self) -> bool:
"""Whether to ignore agent callbacks."""
- return not os.environ.get("DEBUG") or os.environ.get("DEBUG").lower() != "true"
+ return not dify_config.DEBUG
@property
def ignore_chat_model(self) -> bool:
"""Whether to ignore chat model callbacks."""
- return not os.environ.get("DEBUG") or os.environ.get("DEBUG").lower() != "true"
+ return not dify_config.DEBUG
From b360feb4c19af52faf64c27fd2183bfabfc917ca Mon Sep 17 00:00:00 2001
From: Bowen Liang
Date: Wed, 9 Oct 2024 14:15:27 +0800
Subject: [PATCH 20/61] refactor: introduce storage factory and speed up api
startup by importing storage client on demand (#9086)
---
api/extensions/ext_storage.py | 80 ++++++++++++-------
...liyun_storage.py => aliyun_oss_storage.py} | 4 +-
.../{s3_storage.py => aws_s3_storage.py} | 4 +-
...azure_storage.py => azure_blob_storage.py} | 4 +-
...{baidu_storage.py => baidu_obs_storage.py} | 4 +-
...gle_storage.py => google_cloud_storage.py} | 4 +-
...uawei_storage.py => huawei_obs_storage.py} | 4 +-
.../{local_storage.py => local_fs_storage.py} | 4 +-
.../{oci_storage.py => oracle_oci_storage.py} | 4 +-
api/extensions/storage/storage_type.py | 14 ++++
...cent_storage.py => tencent_cos_storage.py} | 4 +-
...e_storage.py => volcengine_tos_storage.py} | 2 +-
api/poetry.lock | 2 +-
api/pyproject.toml | 2 +-
14 files changed, 85 insertions(+), 51 deletions(-)
rename api/extensions/storage/{aliyun_storage.py => aliyun_oss_storage.py} (96%)
rename api/extensions/storage/{s3_storage.py => aws_s3_storage.py} (97%)
rename api/extensions/storage/{azure_storage.py => azure_blob_storage.py} (97%)
rename api/extensions/storage/{baidu_storage.py => baidu_obs_storage.py} (96%)
rename api/extensions/storage/{google_storage.py => google_cloud_storage.py} (96%)
rename api/extensions/storage/{huawei_storage.py => huawei_obs_storage.py} (95%)
rename api/extensions/storage/{local_storage.py => local_fs_storage.py} (96%)
rename api/extensions/storage/{oci_storage.py => oracle_oci_storage.py} (96%)
create mode 100644 api/extensions/storage/storage_type.py
rename api/extensions/storage/{tencent_storage.py => tencent_cos_storage.py} (94%)
rename api/extensions/storage/{volcengine_storage.py => volcengine_tos_storage.py} (97%)
diff --git a/api/extensions/ext_storage.py b/api/extensions/ext_storage.py
index 863d7a9227..be57b633be 100644
--- a/api/extensions/ext_storage.py
+++ b/api/extensions/ext_storage.py
@@ -4,16 +4,9 @@ from typing import Union
from flask import Flask
-from extensions.storage.aliyun_storage import AliyunStorage
-from extensions.storage.azure_storage import AzureStorage
-from extensions.storage.baidu_storage import BaiduStorage
-from extensions.storage.google_storage import GoogleStorage
-from extensions.storage.huawei_storage import HuaweiStorage
-from extensions.storage.local_storage import LocalStorage
-from extensions.storage.oci_storage import OCIStorage
-from extensions.storage.s3_storage import S3Storage
-from extensions.storage.tencent_storage import TencentStorage
-from extensions.storage.volcengine_storage import VolcengineStorage
+from configs import dify_config
+from extensions.storage.base_storage import BaseStorage
+from extensions.storage.storage_type import StorageType
class Storage:
@@ -21,27 +14,52 @@ class Storage:
self.storage_runner = None
def init_app(self, app: Flask):
- storage_type = app.config.get("STORAGE_TYPE")
- if storage_type == "s3":
- self.storage_runner = S3Storage(app=app)
- elif storage_type == "azure-blob":
- self.storage_runner = AzureStorage(app=app)
- elif storage_type == "aliyun-oss":
- self.storage_runner = AliyunStorage(app=app)
- elif storage_type == "google-storage":
- self.storage_runner = GoogleStorage(app=app)
- elif storage_type == "tencent-cos":
- self.storage_runner = TencentStorage(app=app)
- elif storage_type == "oci-storage":
- self.storage_runner = OCIStorage(app=app)
- elif storage_type == "huawei-obs":
- self.storage_runner = HuaweiStorage(app=app)
- elif storage_type == "baidu-obs":
- self.storage_runner = BaiduStorage(app=app)
- elif storage_type == "volcengine-tos":
- self.storage_runner = VolcengineStorage(app=app)
- else:
- self.storage_runner = LocalStorage(app=app)
+ storage_factory = self.get_storage_factory(dify_config.STORAGE_TYPE)
+ self.storage_runner = storage_factory(app=app)
+
+ @staticmethod
+ def get_storage_factory(storage_type: str) -> type[BaseStorage]:
+ match storage_type:
+ case StorageType.S3:
+ from extensions.storage.aws_s3_storage import AwsS3Storage
+
+ return AwsS3Storage
+ case StorageType.AZURE_BLOB:
+ from extensions.storage.azure_blob_storage import AzureBlobStorage
+
+ return AzureBlobStorage
+ case StorageType.ALIYUN_OSS:
+ from extensions.storage.aliyun_oss_storage import AliyunOssStorage
+
+ return AliyunOssStorage
+ case StorageType.GOOGLE_STORAGE:
+ from extensions.storage.google_cloud_storage import GoogleCloudStorage
+
+ return GoogleCloudStorage
+ case StorageType.TENCENT_COS:
+ from extensions.storage.tencent_cos_storage import TencentCosStorage
+
+ return TencentCosStorage
+ case StorageType.OCI_STORAGE:
+ from extensions.storage.oracle_oci_storage import OracleOCIStorage
+
+ return OracleOCIStorage
+ case StorageType.HUAWEI_OBS:
+ from extensions.storage.huawei_obs_storage import HuaweiObsStorage
+
+ return HuaweiObsStorage
+ case StorageType.BAIDU_OBS:
+ from extensions.storage.baidu_obs_storage import BaiduObsStorage
+
+ return BaiduObsStorage
+ case StorageType.VOLCENGINE_TOS:
+ from extensions.storage.volcengine_tos_storage import VolcengineTosStorage
+
+ return VolcengineTosStorage
+ case StorageType.LOCAL | _:
+ from extensions.storage.local_fs_storage import LocalFsStorage
+
+ return LocalFsStorage
def save(self, filename, data):
try:
diff --git a/api/extensions/storage/aliyun_storage.py b/api/extensions/storage/aliyun_oss_storage.py
similarity index 96%
rename from api/extensions/storage/aliyun_storage.py
rename to api/extensions/storage/aliyun_oss_storage.py
index 2677912aa9..53bd399d6d 100644
--- a/api/extensions/storage/aliyun_storage.py
+++ b/api/extensions/storage/aliyun_oss_storage.py
@@ -7,8 +7,8 @@ from flask import Flask
from extensions.storage.base_storage import BaseStorage
-class AliyunStorage(BaseStorage):
- """Implementation for aliyun storage."""
+class AliyunOssStorage(BaseStorage):
+ """Implementation for Aliyun OSS storage."""
def __init__(self, app: Flask):
super().__init__(app)
diff --git a/api/extensions/storage/s3_storage.py b/api/extensions/storage/aws_s3_storage.py
similarity index 97%
rename from api/extensions/storage/s3_storage.py
rename to api/extensions/storage/aws_s3_storage.py
index 0858be3af6..fede683aa7 100644
--- a/api/extensions/storage/s3_storage.py
+++ b/api/extensions/storage/aws_s3_storage.py
@@ -9,8 +9,8 @@ from flask import Flask
from extensions.storage.base_storage import BaseStorage
-class S3Storage(BaseStorage):
- """Implementation for s3 storage."""
+class AwsS3Storage(BaseStorage):
+ """Implementation for Amazon Web Services S3 storage."""
def __init__(self, app: Flask):
super().__init__(app)
diff --git a/api/extensions/storage/azure_storage.py b/api/extensions/storage/azure_blob_storage.py
similarity index 97%
rename from api/extensions/storage/azure_storage.py
rename to api/extensions/storage/azure_blob_storage.py
index ca8cbb9188..daea660a49 100644
--- a/api/extensions/storage/azure_storage.py
+++ b/api/extensions/storage/azure_blob_storage.py
@@ -8,8 +8,8 @@ from extensions.ext_redis import redis_client
from extensions.storage.base_storage import BaseStorage
-class AzureStorage(BaseStorage):
- """Implementation for azure storage."""
+class AzureBlobStorage(BaseStorage):
+ """Implementation for Azure Blob storage."""
def __init__(self, app: Flask):
super().__init__(app)
diff --git a/api/extensions/storage/baidu_storage.py b/api/extensions/storage/baidu_obs_storage.py
similarity index 96%
rename from api/extensions/storage/baidu_storage.py
rename to api/extensions/storage/baidu_obs_storage.py
index 691ac7a58b..c5acff4a9d 100644
--- a/api/extensions/storage/baidu_storage.py
+++ b/api/extensions/storage/baidu_obs_storage.py
@@ -10,8 +10,8 @@ from flask import Flask
from extensions.storage.base_storage import BaseStorage
-class BaiduStorage(BaseStorage):
- """Implementation for baidu obs storage."""
+class BaiduObsStorage(BaseStorage):
+ """Implementation for Baidu OBS storage."""
def __init__(self, app: Flask):
super().__init__(app)
diff --git a/api/extensions/storage/google_storage.py b/api/extensions/storage/google_cloud_storage.py
similarity index 96%
rename from api/extensions/storage/google_storage.py
rename to api/extensions/storage/google_cloud_storage.py
index c42f946fa8..d9c74b8d40 100644
--- a/api/extensions/storage/google_storage.py
+++ b/api/extensions/storage/google_cloud_storage.py
@@ -10,8 +10,8 @@ from google.cloud import storage as google_cloud_storage
from extensions.storage.base_storage import BaseStorage
-class GoogleStorage(BaseStorage):
- """Implementation for google storage."""
+class GoogleCloudStorage(BaseStorage):
+ """Implementation for Google Cloud storage."""
def __init__(self, app: Flask):
super().__init__(app)
diff --git a/api/extensions/storage/huawei_storage.py b/api/extensions/storage/huawei_obs_storage.py
similarity index 95%
rename from api/extensions/storage/huawei_storage.py
rename to api/extensions/storage/huawei_obs_storage.py
index b6ce10bd1f..dd243d4001 100644
--- a/api/extensions/storage/huawei_storage.py
+++ b/api/extensions/storage/huawei_obs_storage.py
@@ -6,8 +6,8 @@ from obs import ObsClient
from extensions.storage.base_storage import BaseStorage
-class HuaweiStorage(BaseStorage):
- """Implementation for huawei obs storage."""
+class HuaweiObsStorage(BaseStorage):
+ """Implementation for Huawei OBS storage."""
def __init__(self, app: Flask):
super().__init__(app)
diff --git a/api/extensions/storage/local_storage.py b/api/extensions/storage/local_fs_storage.py
similarity index 96%
rename from api/extensions/storage/local_storage.py
rename to api/extensions/storage/local_fs_storage.py
index f833ae85dc..9308c4d180 100644
--- a/api/extensions/storage/local_storage.py
+++ b/api/extensions/storage/local_fs_storage.py
@@ -8,8 +8,8 @@ from flask import Flask
from extensions.storage.base_storage import BaseStorage
-class LocalStorage(BaseStorage):
- """Implementation for local storage."""
+class LocalFsStorage(BaseStorage):
+ """Implementation for local filesystem storage."""
def __init__(self, app: Flask):
super().__init__(app)
diff --git a/api/extensions/storage/oci_storage.py b/api/extensions/storage/oracle_oci_storage.py
similarity index 96%
rename from api/extensions/storage/oci_storage.py
rename to api/extensions/storage/oracle_oci_storage.py
index e32fa0a0ae..6934583567 100644
--- a/api/extensions/storage/oci_storage.py
+++ b/api/extensions/storage/oracle_oci_storage.py
@@ -8,7 +8,9 @@ from flask import Flask
from extensions.storage.base_storage import BaseStorage
-class OCIStorage(BaseStorage):
+class OracleOCIStorage(BaseStorage):
+ """Implementation for Oracle OCI storage."""
+
def __init__(self, app: Flask):
super().__init__(app)
app_config = self.app.config
diff --git a/api/extensions/storage/storage_type.py b/api/extensions/storage/storage_type.py
new file mode 100644
index 0000000000..e494a520a2
--- /dev/null
+++ b/api/extensions/storage/storage_type.py
@@ -0,0 +1,14 @@
+from enum import Enum
+
+
+class StorageType(str, Enum):
+ ALIYUN_OSS = "aliyun-oss"
+ AZURE_BLOB = "azure-blob"
+ BAIDU_OBS = "baidu-obs"
+ GOOGLE_STORAGE = "google-storage"
+ HUAWEI_OBS = "huawei-obs"
+ LOCAL = "local"
+ OCI_STORAGE = "oci-storage"
+ S3 = "s3"
+ TENCENT_COS = "tencent-cos"
+ VOLCENGINE_TOS = "volcengine-tos"
diff --git a/api/extensions/storage/tencent_storage.py b/api/extensions/storage/tencent_cos_storage.py
similarity index 94%
rename from api/extensions/storage/tencent_storage.py
rename to api/extensions/storage/tencent_cos_storage.py
index 1d499cd3bc..c529dce7ad 100644
--- a/api/extensions/storage/tencent_storage.py
+++ b/api/extensions/storage/tencent_cos_storage.py
@@ -6,8 +6,8 @@ from qcloud_cos import CosConfig, CosS3Client
from extensions.storage.base_storage import BaseStorage
-class TencentStorage(BaseStorage):
- """Implementation for tencent cos storage."""
+class TencentCosStorage(BaseStorage):
+ """Implementation for Tencent Cloud COS storage."""
def __init__(self, app: Flask):
super().__init__(app)
diff --git a/api/extensions/storage/volcengine_storage.py b/api/extensions/storage/volcengine_tos_storage.py
similarity index 97%
rename from api/extensions/storage/volcengine_storage.py
rename to api/extensions/storage/volcengine_tos_storage.py
index f74ad2ee6d..1bedcf24c2 100644
--- a/api/extensions/storage/volcengine_storage.py
+++ b/api/extensions/storage/volcengine_tos_storage.py
@@ -6,7 +6,7 @@ from flask import Flask
from extensions.storage.base_storage import BaseStorage
-class VolcengineStorage(BaseStorage):
+class VolcengineTosStorage(BaseStorage):
"""Implementation for Volcengine TOS storage."""
def __init__(self, app: Flask):
diff --git a/api/poetry.lock b/api/poetry.lock
index cf03f8c0f5..6b96350ffd 100644
--- a/api/poetry.lock
+++ b/api/poetry.lock
@@ -10595,4 +10595,4 @@ cffi = ["cffi (>=1.11)"]
[metadata]
lock-version = "2.0"
python-versions = ">=3.10,<3.13"
-content-hash = "fd183812f910faf4e840267501c571db5d758ad6eb328d106ba6f79a0322a555"
+content-hash = "34ba8efcc67da342036ef075b693f59fdc67d246f40b857c9c1bd6f80c7283bd"
diff --git a/api/pyproject.toml b/api/pyproject.toml
index 839df9ea67..957ae10a64 100644
--- a/api/pyproject.toml
+++ b/api/pyproject.toml
@@ -113,7 +113,6 @@ authlib = "1.3.1"
azure-ai-inference = "~1.0.0b3"
azure-ai-ml = "~1.20.0"
azure-identity = "1.16.1"
-azure-storage-blob = "12.13.0"
beautifulsoup4 = "4.12.2"
boto3 = "1.35.17"
bs4 = "~0.0.1"
@@ -221,6 +220,7 @@ yfinance = "~0.2.40"
# Required for storage clients
############################################################
[tool.poetry.group.storage.dependencies]
+azure-storage-blob = "12.13.0"
bce-python-sdk = "~0.9.23"
cos-python-sdk-v5 = "1.9.30"
esdk-obs-python = "3.24.6.1"
From 240b66d7373f11db378d5b3a67594e5ea1f2fc66 Mon Sep 17 00:00:00 2001
From: Bowen Liang
Date: Wed, 9 Oct 2024 14:36:43 +0800
Subject: [PATCH 21/61] chore: avoid implicit optional in type annotations of
method (#8727)
---
api/core/agent/cot_agent_runner.py | 2 +-
api/core/agent/cot_chat_agent_runner.py | 2 +-
api/core/agent/cot_completion_agent_runner.py | 3 ++-
api/core/agent/fc_agent_runner.py | 6 +++---
api/core/indexing_runner.py | 4 ++--
.../model_providers/anthropic/llm/llm.py | 2 +-
.../model_providers/bedrock/llm/llm.py | 2 +-
.../model_providers/fireworks/llm/llm.py | 2 +-
.../model_providers/openai/llm/llm.py | 2 +-
.../openai_api_compatible/llm/llm.py | 2 +-
.../model_providers/sagemaker/tts/tts.py | 2 +-
.../model_providers/wenxin/llm/llm.py | 2 +-
.../api_resource/assistant/assistant.py | 14 +++++++-------
.../zhipuai/zhipuai_sdk/api_resource/files.py | 10 +++++-----
.../api_resource/knowledge/document/document.py | 8 ++++----
.../zhipuai_sdk/api_resource/videos/videos.py | 8 ++++----
api/core/rag/datasource/vdb/relyt/relyt_vector.py | 2 +-
api/core/rag/datasource/vdb/vector_factory.py | 6 +++---
api/core/rag/extractor/extract_processor.py | 4 ++--
.../unstructured/unstructured_epub_extractor.py | 3 ++-
api/core/tools/entities/tool_entities.py | 2 +-
.../provider/builtin/aws/tools/sagemaker_tts.py | 4 ++--
api/core/tools/tool/builtin_tool.py | 4 +++-
api/core/tools/tool/tool.py | 2 +-
api/core/tools/tool_manager.py | 4 ++--
api/core/tools/utils/feishu_api_utils.py | 9 ++++++++-
api/core/tools/utils/parser.py | 11 ++++++-----
api/core/tools/utils/web_reader_tool.py | 3 ++-
api/libs/helper.py | 2 +-
api/pyproject.toml | 1 +
api/services/account_service.py | 2 +-
api/services/errors/base.py | 5 ++++-
api/services/tag_service.py | 3 ++-
api/services/tools/api_tools_manage_service.py | 3 ++-
api/services/tools/tools_transform_service.py | 10 +++++-----
.../tools/workflow_tools_manage_service.py | 5 +++--
.../integration_tests/vdb/__mock/tcvectordb.py | 6 +++---
37 files changed, 91 insertions(+), 71 deletions(-)
diff --git a/api/core/agent/cot_agent_runner.py b/api/core/agent/cot_agent_runner.py
index ebe04bf260..d98ba5a3fa 100644
--- a/api/core/agent/cot_agent_runner.py
+++ b/api/core/agent/cot_agent_runner.py
@@ -369,7 +369,7 @@ class CotAgentRunner(BaseAgentRunner, ABC):
return message
def _organize_historic_prompt_messages(
- self, current_session_messages: list[PromptMessage] = None
+ self, current_session_messages: Optional[list[PromptMessage]] = None
) -> list[PromptMessage]:
"""
organize historic prompt messages
diff --git a/api/core/agent/cot_chat_agent_runner.py b/api/core/agent/cot_chat_agent_runner.py
index bdec6b7ed1..5e16373fff 100644
--- a/api/core/agent/cot_chat_agent_runner.py
+++ b/api/core/agent/cot_chat_agent_runner.py
@@ -27,7 +27,7 @@ class CotChatAgentRunner(CotAgentRunner):
return SystemPromptMessage(content=system_prompt)
- def _organize_user_query(self, query, prompt_messages: list[PromptMessage] = None) -> list[PromptMessage]:
+ def _organize_user_query(self, query, prompt_messages: list[PromptMessage]) -> list[PromptMessage]:
"""
Organize user query
"""
diff --git a/api/core/agent/cot_completion_agent_runner.py b/api/core/agent/cot_completion_agent_runner.py
index 9dab956f9a..0563090537 100644
--- a/api/core/agent/cot_completion_agent_runner.py
+++ b/api/core/agent/cot_completion_agent_runner.py
@@ -1,4 +1,5 @@
import json
+from typing import Optional
from core.agent.cot_agent_runner import CotAgentRunner
from core.model_runtime.entities.message_entities import AssistantPromptMessage, PromptMessage, UserPromptMessage
@@ -21,7 +22,7 @@ class CotCompletionAgentRunner(CotAgentRunner):
return system_prompt
- def _organize_historic_prompt(self, current_session_messages: list[PromptMessage] = None) -> str:
+ def _organize_historic_prompt(self, current_session_messages: Optional[list[PromptMessage]] = None) -> str:
"""
Organize historic prompt
"""
diff --git a/api/core/agent/fc_agent_runner.py b/api/core/agent/fc_agent_runner.py
index 13164e0bfc..7b22025582 100644
--- a/api/core/agent/fc_agent_runner.py
+++ b/api/core/agent/fc_agent_runner.py
@@ -2,7 +2,7 @@ import json
import logging
from collections.abc import Generator
from copy import deepcopy
-from typing import Any, Union
+from typing import Any, Optional, Union
from core.agent.base_agent_runner import BaseAgentRunner
from core.app.apps.base_app_queue_manager import PublishFrom
@@ -370,7 +370,7 @@ class FunctionCallAgentRunner(BaseAgentRunner):
return tool_calls
def _init_system_message(
- self, prompt_template: str, prompt_messages: list[PromptMessage] = None
+ self, prompt_template: str, prompt_messages: Optional[list[PromptMessage]] = None
) -> list[PromptMessage]:
"""
Initialize system message
@@ -385,7 +385,7 @@ class FunctionCallAgentRunner(BaseAgentRunner):
return prompt_messages
- def _organize_user_query(self, query, prompt_messages: list[PromptMessage] = None) -> list[PromptMessage]:
+ def _organize_user_query(self, query, prompt_messages: list[PromptMessage]) -> list[PromptMessage]:
"""
Organize user query
"""
diff --git a/api/core/indexing_runner.py b/api/core/indexing_runner.py
index af20df41b1..8df26172b7 100644
--- a/api/core/indexing_runner.py
+++ b/api/core/indexing_runner.py
@@ -211,9 +211,9 @@ class IndexingRunner:
tenant_id: str,
extract_settings: list[ExtractSetting],
tmp_processing_rule: dict,
- doc_form: str = None,
+ doc_form: Optional[str] = None,
doc_language: str = "English",
- dataset_id: str = None,
+ dataset_id: Optional[str] = None,
indexing_technique: str = "economy",
) -> dict:
"""
diff --git a/api/core/model_runtime/model_providers/anthropic/llm/llm.py b/api/core/model_runtime/model_providers/anthropic/llm/llm.py
index 46e1b415b8..3a5a42ba05 100644
--- a/api/core/model_runtime/model_providers/anthropic/llm/llm.py
+++ b/api/core/model_runtime/model_providers/anthropic/llm/llm.py
@@ -169,7 +169,7 @@ class AnthropicLargeLanguageModel(LargeLanguageModel):
stop: Optional[list[str]] = None,
stream: bool = True,
user: Optional[str] = None,
- callbacks: list[Callback] = None,
+ callbacks: Optional[list[Callback]] = None,
) -> Union[LLMResult, Generator]:
"""
Code block mode wrapper for invoking large language model
diff --git a/api/core/model_runtime/model_providers/bedrock/llm/llm.py b/api/core/model_runtime/model_providers/bedrock/llm/llm.py
index d1961784f2..ff0403ee47 100644
--- a/api/core/model_runtime/model_providers/bedrock/llm/llm.py
+++ b/api/core/model_runtime/model_providers/bedrock/llm/llm.py
@@ -92,7 +92,7 @@ class BedrockLargeLanguageModel(LargeLanguageModel):
stop: Optional[list[str]] = None,
stream: bool = True,
user: Optional[str] = None,
- callbacks: list[Callback] = None,
+ callbacks: Optional[list[Callback]] = None,
) -> Union[LLMResult, Generator]:
"""
Code block mode wrapper for invoking large language model
diff --git a/api/core/model_runtime/model_providers/fireworks/llm/llm.py b/api/core/model_runtime/model_providers/fireworks/llm/llm.py
index 2dcf1adba6..24aad9c4d3 100644
--- a/api/core/model_runtime/model_providers/fireworks/llm/llm.py
+++ b/api/core/model_runtime/model_providers/fireworks/llm/llm.py
@@ -511,7 +511,7 @@ class FireworksLargeLanguageModel(_CommonFireworks, LargeLanguageModel):
model: str,
messages: list[PromptMessage],
tools: Optional[list[PromptMessageTool]] = None,
- credentials: dict = None,
+ credentials: Optional[dict] = None,
) -> int:
"""
Approximate num tokens with GPT2 tokenizer.
diff --git a/api/core/model_runtime/model_providers/openai/llm/llm.py b/api/core/model_runtime/model_providers/openai/llm/llm.py
index d42fce528a..1ac3837ad3 100644
--- a/api/core/model_runtime/model_providers/openai/llm/llm.py
+++ b/api/core/model_runtime/model_providers/openai/llm/llm.py
@@ -111,7 +111,7 @@ class OpenAILargeLanguageModel(_CommonOpenAI, LargeLanguageModel):
stop: Optional[list[str]] = None,
stream: bool = True,
user: Optional[str] = None,
- callbacks: list[Callback] = None,
+ callbacks: Optional[list[Callback]] = None,
) -> Union[LLMResult, Generator]:
"""
Code block mode wrapper for invoking large language model
diff --git a/api/core/model_runtime/model_providers/openai_api_compatible/llm/llm.py b/api/core/model_runtime/model_providers/openai_api_compatible/llm/llm.py
index c2ffe653c8..356ac56b1e 100644
--- a/api/core/model_runtime/model_providers/openai_api_compatible/llm/llm.py
+++ b/api/core/model_runtime/model_providers/openai_api_compatible/llm/llm.py
@@ -688,7 +688,7 @@ class OAIAPICompatLargeLanguageModel(_CommonOaiApiCompat, LargeLanguageModel):
model: str,
messages: list[PromptMessage],
tools: Optional[list[PromptMessageTool]] = None,
- credentials: dict = None,
+ credentials: Optional[dict] = None,
) -> int:
"""
Approximate num tokens with GPT2 tokenizer.
diff --git a/api/core/model_runtime/model_providers/sagemaker/tts/tts.py b/api/core/model_runtime/model_providers/sagemaker/tts/tts.py
index a22bd6dd6e..9652e1d650 100644
--- a/api/core/model_runtime/model_providers/sagemaker/tts/tts.py
+++ b/api/core/model_runtime/model_providers/sagemaker/tts/tts.py
@@ -77,7 +77,7 @@ class SageMakerText2SpeechModel(TTSModel):
"""
pass
- def _detect_lang_code(self, content: str, map_dict: dict = None):
+ def _detect_lang_code(self, content: str, map_dict: Optional[dict] = None):
map_dict = {"zh": "<|zh|>", "en": "<|en|>", "ja": "<|jp|>", "zh-TW": "<|yue|>", "ko": "<|ko|>"}
response = self.comprehend_client.detect_dominant_language(Text=content)
diff --git a/api/core/model_runtime/model_providers/wenxin/llm/llm.py b/api/core/model_runtime/model_providers/wenxin/llm/llm.py
index f7c160b6b4..952cbb33f4 100644
--- a/api/core/model_runtime/model_providers/wenxin/llm/llm.py
+++ b/api/core/model_runtime/model_providers/wenxin/llm/llm.py
@@ -64,7 +64,7 @@ class ErnieBotLargeLanguageModel(LargeLanguageModel):
stop: Optional[list[str]] = None,
stream: bool = True,
user: Optional[str] = None,
- callbacks: list[Callback] = None,
+ callbacks: Optional[list[Callback]] = None,
) -> Union[LLMResult, Generator]:
"""
Code block mode wrapper for invoking large language model
diff --git a/api/core/model_runtime/model_providers/zhipuai/zhipuai_sdk/api_resource/assistant/assistant.py b/api/core/model_runtime/model_providers/zhipuai/zhipuai_sdk/api_resource/assistant/assistant.py
index f772340a82..c29b057498 100644
--- a/api/core/model_runtime/model_providers/zhipuai/zhipuai_sdk/api_resource/assistant/assistant.py
+++ b/api/core/model_runtime/model_providers/zhipuai/zhipuai_sdk/api_resource/assistant/assistant.py
@@ -41,8 +41,8 @@ class Assistant(BaseAPI):
conversation_id: Optional[str] = None,
attachments: Optional[list[assistant_create_params.AssistantAttachments]] = None,
metadata: dict | None = None,
- request_id: str = None,
- user_id: str = None,
+ request_id: Optional[str] = None,
+ user_id: Optional[str] = None,
extra_headers: Headers | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
@@ -72,9 +72,9 @@ class Assistant(BaseAPI):
def query_support(
self,
*,
- assistant_id_list: list[str] = None,
- request_id: str = None,
- user_id: str = None,
+ assistant_id_list: Optional[list[str]] = None,
+ request_id: Optional[str] = None,
+ user_id: Optional[str] = None,
extra_headers: Headers | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
@@ -99,8 +99,8 @@ class Assistant(BaseAPI):
page: int = 1,
page_size: int = 10,
*,
- request_id: str = None,
- user_id: str = None,
+ request_id: Optional[str] = None,
+ user_id: Optional[str] = None,
extra_headers: Headers | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
diff --git a/api/core/model_runtime/model_providers/zhipuai/zhipuai_sdk/api_resource/files.py b/api/core/model_runtime/model_providers/zhipuai/zhipuai_sdk/api_resource/files.py
index ba9de75b7e..c723f6f66e 100644
--- a/api/core/model_runtime/model_providers/zhipuai/zhipuai_sdk/api_resource/files.py
+++ b/api/core/model_runtime/model_providers/zhipuai/zhipuai_sdk/api_resource/files.py
@@ -1,7 +1,7 @@
from __future__ import annotations
from collections.abc import Mapping
-from typing import TYPE_CHECKING, Literal, cast
+from typing import TYPE_CHECKING, Literal, Optional, cast
import httpx
@@ -34,11 +34,11 @@ class Files(BaseAPI):
def create(
self,
*,
- file: FileTypes = None,
- upload_detail: list[UploadDetail] = None,
+ file: Optional[FileTypes] = None,
+ upload_detail: Optional[list[UploadDetail]] = None,
purpose: Literal["fine-tune", "retrieval", "batch"],
- knowledge_id: str = None,
- sentence_size: int = None,
+ knowledge_id: Optional[str] = None,
+ sentence_size: Optional[int] = None,
extra_headers: Headers | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
diff --git a/api/core/model_runtime/model_providers/zhipuai/zhipuai_sdk/api_resource/knowledge/document/document.py b/api/core/model_runtime/model_providers/zhipuai/zhipuai_sdk/api_resource/knowledge/document/document.py
index 2c4066d893..492c49da66 100644
--- a/api/core/model_runtime/model_providers/zhipuai/zhipuai_sdk/api_resource/knowledge/document/document.py
+++ b/api/core/model_runtime/model_providers/zhipuai/zhipuai_sdk/api_resource/knowledge/document/document.py
@@ -34,12 +34,12 @@ class Document(BaseAPI):
def create(
self,
*,
- file: FileTypes = None,
+ file: Optional[FileTypes] = None,
custom_separator: Optional[list[str]] = None,
- upload_detail: list[UploadDetail] = None,
+ upload_detail: Optional[list[UploadDetail]] = None,
purpose: Literal["retrieval"],
- knowledge_id: str = None,
- sentence_size: int = None,
+ knowledge_id: Optional[str] = None,
+ sentence_size: Optional[int] = None,
extra_headers: Headers | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
diff --git a/api/core/model_runtime/model_providers/zhipuai/zhipuai_sdk/api_resource/videos/videos.py b/api/core/model_runtime/model_providers/zhipuai/zhipuai_sdk/api_resource/videos/videos.py
index f1f1c08036..71c8316602 100644
--- a/api/core/model_runtime/model_providers/zhipuai/zhipuai_sdk/api_resource/videos/videos.py
+++ b/api/core/model_runtime/model_providers/zhipuai/zhipuai_sdk/api_resource/videos/videos.py
@@ -31,11 +31,11 @@ class Videos(BaseAPI):
self,
model: str,
*,
- prompt: str = None,
- image_url: str = None,
+ prompt: Optional[str] = None,
+ image_url: Optional[str] = None,
sensitive_word_check: Optional[SensitiveWordCheckRequest] | NotGiven = NOT_GIVEN,
- request_id: str = None,
- user_id: str = None,
+ request_id: Optional[str] = None,
+ user_id: Optional[str] = None,
extra_headers: Headers | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
diff --git a/api/core/rag/datasource/vdb/relyt/relyt_vector.py b/api/core/rag/datasource/vdb/relyt/relyt_vector.py
index f47f75718a..254956970f 100644
--- a/api/core/rag/datasource/vdb/relyt/relyt_vector.py
+++ b/api/core/rag/datasource/vdb/relyt/relyt_vector.py
@@ -162,7 +162,7 @@ class RelytVector(BaseVector):
else:
return None
- def delete_by_uuids(self, ids: list[str] = None):
+ def delete_by_uuids(self, ids: Optional[list[str]] = None):
"""Delete by vector IDs.
Args:
diff --git a/api/core/rag/datasource/vdb/vector_factory.py b/api/core/rag/datasource/vdb/vector_factory.py
index ca90233b7f..943b23870c 100644
--- a/api/core/rag/datasource/vdb/vector_factory.py
+++ b/api/core/rag/datasource/vdb/vector_factory.py
@@ -1,5 +1,5 @@
from abc import ABC, abstractmethod
-from typing import Any
+from typing import Any, Optional
from configs import dify_config
from core.embedding.cached_embedding import CacheEmbedding
@@ -25,7 +25,7 @@ class AbstractVectorFactory(ABC):
class Vector:
- def __init__(self, dataset: Dataset, attributes: list = None):
+ def __init__(self, dataset: Dataset, attributes: Optional[list] = None):
if attributes is None:
attributes = ["doc_id", "dataset_id", "document_id", "doc_hash"]
self._dataset = dataset
@@ -106,7 +106,7 @@ class Vector:
case _:
raise ValueError(f"Vector store {vector_type} is not supported.")
- def create(self, texts: list = None, **kwargs):
+ def create(self, texts: Optional[list] = None, **kwargs):
if texts:
embeddings = self._embeddings.embed_documents([document.page_content for document in texts])
self._vector_processor.create(texts=texts, embeddings=embeddings, **kwargs)
diff --git a/api/core/rag/extractor/extract_processor.py b/api/core/rag/extractor/extract_processor.py
index 9048138511..706a42b735 100644
--- a/api/core/rag/extractor/extract_processor.py
+++ b/api/core/rag/extractor/extract_processor.py
@@ -1,7 +1,7 @@
import re
import tempfile
from pathlib import Path
-from typing import Union
+from typing import Optional, Union
from urllib.parse import unquote
from configs import dify_config
@@ -84,7 +84,7 @@ class ExtractProcessor:
@classmethod
def extract(
- cls, extract_setting: ExtractSetting, is_automatic: bool = False, file_path: str = None
+ cls, extract_setting: ExtractSetting, is_automatic: bool = False, file_path: Optional[str] = None
) -> list[Document]:
if extract_setting.datasource_type == DatasourceType.FILE.value:
with tempfile.TemporaryDirectory() as temp_dir:
diff --git a/api/core/rag/extractor/unstructured/unstructured_epub_extractor.py b/api/core/rag/extractor/unstructured/unstructured_epub_extractor.py
index fa50fa76b2..a41ed3a558 100644
--- a/api/core/rag/extractor/unstructured/unstructured_epub_extractor.py
+++ b/api/core/rag/extractor/unstructured/unstructured_epub_extractor.py
@@ -1,4 +1,5 @@
import logging
+from typing import Optional
from core.rag.extractor.extractor_base import BaseExtractor
from core.rag.models.document import Document
@@ -17,7 +18,7 @@ class UnstructuredEpubExtractor(BaseExtractor):
def __init__(
self,
file_path: str,
- api_url: str = None,
+ api_url: Optional[str] = None,
):
"""Initialize with file path."""
self._file_path = file_path
diff --git a/api/core/tools/entities/tool_entities.py b/api/core/tools/entities/tool_entities.py
index 02b8b35be7..9962b559fa 100644
--- a/api/core/tools/entities/tool_entities.py
+++ b/api/core/tools/entities/tool_entities.py
@@ -341,7 +341,7 @@ class ToolRuntimeVariablePool(BaseModel):
self.pool.append(variable)
- def set_file(self, tool_name: str, value: str, name: str = None) -> None:
+ def set_file(self, tool_name: str, value: str, name: Optional[str] = None) -> None:
"""
set an image variable
diff --git a/api/core/tools/provider/builtin/aws/tools/sagemaker_tts.py b/api/core/tools/provider/builtin/aws/tools/sagemaker_tts.py
index bceeaab745..1fafe09b4d 100644
--- a/api/core/tools/provider/builtin/aws/tools/sagemaker_tts.py
+++ b/api/core/tools/provider/builtin/aws/tools/sagemaker_tts.py
@@ -1,6 +1,6 @@
import json
from enum import Enum
-from typing import Any, Union
+from typing import Any, Optional, Union
import boto3
@@ -21,7 +21,7 @@ class SageMakerTTSTool(BuiltinTool):
s3_client: Any = None
comprehend_client: Any = None
- def _detect_lang_code(self, content: str, map_dict: dict = None):
+ def _detect_lang_code(self, content: str, map_dict: Optional[dict] = None):
map_dict = {"zh": "<|zh|>", "en": "<|en|>", "ja": "<|jp|>", "zh-TW": "<|yue|>", "ko": "<|ko|>"}
response = self.comprehend_client.detect_dominant_language(Text=content)
diff --git a/api/core/tools/tool/builtin_tool.py b/api/core/tools/tool/builtin_tool.py
index 8edaf7c0e6..e2a81ed0a3 100644
--- a/api/core/tools/tool/builtin_tool.py
+++ b/api/core/tools/tool/builtin_tool.py
@@ -1,3 +1,5 @@
+from typing import Optional
+
from core.model_runtime.entities.llm_entities import LLMResult
from core.model_runtime.entities.message_entities import PromptMessage, SystemPromptMessage, UserPromptMessage
from core.tools.entities.tool_entities import ToolProviderType
@@ -124,7 +126,7 @@ class BuiltinTool(Tool):
return result
- def get_url(self, url: str, user_agent: str = None) -> str:
+ def get_url(self, url: str, user_agent: Optional[str] = None) -> str:
"""
get url
"""
diff --git a/api/core/tools/tool/tool.py b/api/core/tools/tool/tool.py
index d9e9a0faad..cb4ab51ceb 100644
--- a/api/core/tools/tool/tool.py
+++ b/api/core/tools/tool/tool.py
@@ -318,7 +318,7 @@ class Tool(BaseModel, ABC):
"""
return ToolInvokeMessage(type=ToolInvokeMessage.MessageType.TEXT, message=text, save_as=save_as)
- def create_blob_message(self, blob: bytes, meta: dict = None, save_as: str = "") -> ToolInvokeMessage:
+ def create_blob_message(self, blob: bytes, meta: Optional[dict] = None, save_as: str = "") -> ToolInvokeMessage:
"""
create a blob message
diff --git a/api/core/tools/tool_manager.py b/api/core/tools/tool_manager.py
index a3303797e1..ed66dd1357 100644
--- a/api/core/tools/tool_manager.py
+++ b/api/core/tools/tool_manager.py
@@ -4,7 +4,7 @@ import mimetypes
from collections.abc import Generator
from os import listdir, path
from threading import Lock
-from typing import Any, Union
+from typing import Any, Optional, Union
from configs import dify_config
from core.agent.entities import AgentToolEntity
@@ -72,7 +72,7 @@ class ToolManager:
@classmethod
def get_tool(
- cls, provider_type: str, provider_id: str, tool_name: str, tenant_id: str = None
+ cls, provider_type: str, provider_id: str, tool_name: str, tenant_id: Optional[str] = None
) -> Union[BuiltinTool, ApiTool]:
"""
get the tool
diff --git a/api/core/tools/utils/feishu_api_utils.py b/api/core/tools/utils/feishu_api_utils.py
index ce1fd7dc19..245b296d18 100644
--- a/api/core/tools/utils/feishu_api_utils.py
+++ b/api/core/tools/utils/feishu_api_utils.py
@@ -1,3 +1,5 @@
+from typing import Optional
+
import httpx
from core.tools.errors import ToolProviderCredentialValidationError
@@ -32,7 +34,12 @@ class FeishuRequest:
return res.get("tenant_access_token")
def _send_request(
- self, url: str, method: str = "post", require_token: bool = True, payload: dict = None, params: dict = None
+ self,
+ url: str,
+ method: str = "post",
+ require_token: bool = True,
+ payload: Optional[dict] = None,
+ params: Optional[dict] = None,
):
headers = {
"Content-Type": "application/json",
diff --git a/api/core/tools/utils/parser.py b/api/core/tools/utils/parser.py
index 9ead4f8e5c..0d801d36c4 100644
--- a/api/core/tools/utils/parser.py
+++ b/api/core/tools/utils/parser.py
@@ -3,6 +3,7 @@ import uuid
from json import dumps as json_dumps
from json import loads as json_loads
from json.decoder import JSONDecodeError
+from typing import Optional
from requests import get
from yaml import YAMLError, safe_load
@@ -16,7 +17,7 @@ from core.tools.errors import ToolApiSchemaError, ToolNotSupportedError, ToolPro
class ApiBasedToolSchemaParser:
@staticmethod
def parse_openapi_to_tool_bundle(
- openapi: dict, extra_info: dict = None, warning: dict = None
+ openapi: dict, extra_info: Optional[dict], warning: Optional[dict]
) -> list[ApiToolBundle]:
warning = warning if warning is not None else {}
extra_info = extra_info if extra_info is not None else {}
@@ -174,7 +175,7 @@ class ApiBasedToolSchemaParser:
@staticmethod
def parse_openapi_yaml_to_tool_bundle(
- yaml: str, extra_info: dict = None, warning: dict = None
+ yaml: str, extra_info: Optional[dict], warning: Optional[dict]
) -> list[ApiToolBundle]:
"""
parse openapi yaml to tool bundle
@@ -191,7 +192,7 @@ class ApiBasedToolSchemaParser:
return ApiBasedToolSchemaParser.parse_openapi_to_tool_bundle(openapi, extra_info=extra_info, warning=warning)
@staticmethod
- def parse_swagger_to_openapi(swagger: dict, extra_info: dict = None, warning: dict = None) -> dict:
+ def parse_swagger_to_openapi(swagger: dict, extra_info: Optional[dict], warning: Optional[dict]) -> dict:
"""
parse swagger to openapi
@@ -253,7 +254,7 @@ class ApiBasedToolSchemaParser:
@staticmethod
def parse_openai_plugin_json_to_tool_bundle(
- json: str, extra_info: dict = None, warning: dict = None
+ json: str, extra_info: Optional[dict], warning: Optional[dict]
) -> list[ApiToolBundle]:
"""
parse openapi plugin yaml to tool bundle
@@ -287,7 +288,7 @@ class ApiBasedToolSchemaParser:
@staticmethod
def auto_parse_to_tool_bundle(
- content: str, extra_info: dict = None, warning: dict = None
+ content: str, extra_info: Optional[dict], warning: Optional[dict]
) -> tuple[list[ApiToolBundle], str]:
"""
auto parse to tool bundle
diff --git a/api/core/tools/utils/web_reader_tool.py b/api/core/tools/utils/web_reader_tool.py
index 1ced7d0488..5807d61b94 100644
--- a/api/core/tools/utils/web_reader_tool.py
+++ b/api/core/tools/utils/web_reader_tool.py
@@ -9,6 +9,7 @@ import tempfile
import unicodedata
from contextlib import contextmanager
from pathlib import Path
+from typing import Optional
from urllib.parse import unquote
import chardet
@@ -36,7 +37,7 @@ def page_result(text: str, cursor: int, max_length: int) -> str:
return text[cursor : cursor + max_length]
-def get_url(url: str, user_agent: str = None) -> str:
+def get_url(url: str, user_agent: Optional[str] = None) -> str:
"""Fetch URL and return the contents as a string."""
headers = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko)"
diff --git a/api/libs/helper.py b/api/libs/helper.py
index d664ef1ae7..9c3a1ff04d 100644
--- a/api/libs/helper.py
+++ b/api/libs/helper.py
@@ -189,7 +189,7 @@ def compact_generate_response(response: Union[dict, RateLimitGenerator]) -> Resp
class TokenManager:
@classmethod
- def generate_token(cls, account: Account, token_type: str, additional_data: dict = None) -> str:
+ def generate_token(cls, account: Account, token_type: str, additional_data: Optional[dict] = None) -> str:
old_token = cls._get_current_token_for_account(account.id, token_type)
if old_token:
if isinstance(old_token, bytes):
diff --git a/api/pyproject.toml b/api/pyproject.toml
index 957ae10a64..48418974d4 100644
--- a/api/pyproject.toml
+++ b/api/pyproject.toml
@@ -28,6 +28,7 @@ select = [
"PLR0402", # manual-from-import
"PLR1711", # useless-return
"PLR1714", # repeated-equality-comparison
+ "RUF013", # implicit-optional
"RUF019", # unnecessary-key-check
"RUF100", # unused-noqa
"RUF101", # redirected-noqa
diff --git a/api/services/account_service.py b/api/services/account_service.py
index 66ff5d2b7c..c3d3354a1d 100644
--- a/api/services/account_service.py
+++ b/api/services/account_service.py
@@ -321,7 +321,7 @@ class TenantService:
return tenant
@staticmethod
- def switch_tenant(account: Account, tenant_id: int = None) -> None:
+ def switch_tenant(account: Account, tenant_id: Optional[int] = None) -> None:
"""Switch the current workspace for the account"""
# Ensure tenant_id is provided
diff --git a/api/services/errors/base.py b/api/services/errors/base.py
index 1fed71cf9e..4d39f956b8 100644
--- a/api/services/errors/base.py
+++ b/api/services/errors/base.py
@@ -1,3 +1,6 @@
+from typing import Optional
+
+
class BaseServiceError(Exception):
- def __init__(self, description: str = None):
+ def __init__(self, description: Optional[str] = None):
self.description = description
diff --git a/api/services/tag_service.py b/api/services/tag_service.py
index 5e2851cd8f..a374bdcf00 100644
--- a/api/services/tag_service.py
+++ b/api/services/tag_service.py
@@ -1,4 +1,5 @@
import uuid
+from typing import Optional
from flask_login import current_user
from sqlalchemy import func
@@ -11,7 +12,7 @@ from models.model import App, Tag, TagBinding
class TagService:
@staticmethod
- def get_tags(tag_type: str, current_tenant_id: str, keyword: str = None) -> list:
+ def get_tags(tag_type: str, current_tenant_id: str, keyword: Optional[str] = None) -> list:
query = (
db.session.query(Tag.id, Tag.type, Tag.name, func.count(TagBinding.id).label("binding_count"))
.outerjoin(TagBinding, Tag.id == TagBinding.tag_id)
diff --git a/api/services/tools/api_tools_manage_service.py b/api/services/tools/api_tools_manage_service.py
index 6f6074f596..9f5298a506 100644
--- a/api/services/tools/api_tools_manage_service.py
+++ b/api/services/tools/api_tools_manage_service.py
@@ -1,5 +1,6 @@
import json
import logging
+from typing import Optional
from httpx import get
@@ -79,7 +80,7 @@ class ApiToolManageService:
raise ValueError(f"invalid schema: {str(e)}")
@staticmethod
- def convert_schema_to_tool_bundles(schema: str, extra_info: dict = None) -> list[ApiToolBundle]:
+ def convert_schema_to_tool_bundles(schema: str, extra_info: Optional[dict] = None) -> list[ApiToolBundle]:
"""
convert schema to tool bundles
diff --git a/api/services/tools/tools_transform_service.py b/api/services/tools/tools_transform_service.py
index 2bc48c4185..4af73d5063 100644
--- a/api/services/tools/tools_transform_service.py
+++ b/api/services/tools/tools_transform_service.py
@@ -144,7 +144,7 @@ class ToolTransformService:
@staticmethod
def workflow_provider_to_user_provider(
- provider_controller: WorkflowToolProviderController, labels: list[str] = None
+ provider_controller: WorkflowToolProviderController, labels: Optional[list[str]] = None
):
"""
convert provider controller to user provider
@@ -174,7 +174,7 @@ class ToolTransformService:
provider_controller: ApiToolProviderController,
db_provider: ApiToolProvider,
decrypt_credentials: bool = True,
- labels: list[str] = None,
+ labels: Optional[list[str]] = None,
) -> UserToolProvider:
"""
convert provider controller to user provider
@@ -223,9 +223,9 @@ class ToolTransformService:
@staticmethod
def tool_to_user_tool(
tool: Union[ApiToolBundle, WorkflowTool, Tool],
- credentials: dict = None,
- tenant_id: str = None,
- labels: list[str] = None,
+ credentials: Optional[dict] = None,
+ tenant_id: Optional[str] = None,
+ labels: Optional[list[str]] = None,
) -> UserTool:
"""
convert tool to user tool
diff --git a/api/services/tools/workflow_tools_manage_service.py b/api/services/tools/workflow_tools_manage_service.py
index 3830e75339..5868ef3755 100644
--- a/api/services/tools/workflow_tools_manage_service.py
+++ b/api/services/tools/workflow_tools_manage_service.py
@@ -1,5 +1,6 @@
import json
from datetime import datetime
+from typing import Optional
from sqlalchemy import or_
@@ -32,7 +33,7 @@ class WorkflowToolManageService:
description: str,
parameters: list[dict],
privacy_policy: str = "",
- labels: list[str] = None,
+ labels: Optional[list[str]] = None,
) -> dict:
"""
Create a workflow tool.
@@ -106,7 +107,7 @@ class WorkflowToolManageService:
description: str,
parameters: list[dict],
privacy_policy: str = "",
- labels: list[str] = None,
+ labels: Optional[list[str]] = None,
) -> dict:
"""
Update a workflow tool.
diff --git a/api/tests/integration_tests/vdb/__mock/tcvectordb.py b/api/tests/integration_tests/vdb/__mock/tcvectordb.py
index 53c9b3cae3..61d6ed1656 100644
--- a/api/tests/integration_tests/vdb/__mock/tcvectordb.py
+++ b/api/tests/integration_tests/vdb/__mock/tcvectordb.py
@@ -48,7 +48,7 @@ class MockTcvectordbClass:
description: str,
index: Index,
embedding: Embedding = None,
- timeout: float = None,
+ timeout: Optional[float] = None,
) -> Collection:
return Collection(
self,
@@ -97,9 +97,9 @@ class MockTcvectordbClass:
def collection_delete(
self,
- document_ids: list[str] = None,
+ document_ids: Optional[list[str]] = None,
filter: Filter = None,
- timeout: float = None,
+ timeout: Optional[float] = None,
):
return {"code": 0, "msg": "operation success"}
From c0b71f8286e90f575b1c1eb8d0cbd081595cab26 Mon Sep 17 00:00:00 2001
From: kurokobo
Date: Wed, 9 Oct 2024 15:42:30 +0900
Subject: [PATCH 22/61] feat: respect x-* headers for redirections (#9054)
---
api/.env.example | 3 +++
api/app.py | 2 ++
api/configs/feature/__init__.py | 6 ++++++
api/extensions/ext_proxy_fix.py | 10 ++++++++++
4 files changed, 21 insertions(+)
create mode 100644 api/extensions/ext_proxy_fix.py
diff --git a/api/.env.example b/api/.env.example
index fb0fc045b0..71f0e5db8f 100644
--- a/api/.env.example
+++ b/api/.env.example
@@ -271,6 +271,9 @@ HTTP_REQUEST_MAX_WRITE_TIMEOUT=600
HTTP_REQUEST_NODE_MAX_BINARY_SIZE=10485760
HTTP_REQUEST_NODE_MAX_TEXT_SIZE=1048576
+# Respect X-* headers to redirect clients
+RESPECT_XFORWARD_HEADERS_ENABLED=false
+
# Log file path
LOG_FILE=
diff --git a/api/app.py b/api/app.py
index 0662d94e1b..a251ef5f0f 100644
--- a/api/app.py
+++ b/api/app.py
@@ -36,6 +36,7 @@ from extensions import (
ext_login,
ext_mail,
ext_migrate,
+ ext_proxy_fix,
ext_redis,
ext_sentry,
ext_storage,
@@ -156,6 +157,7 @@ def initialize_extensions(app):
ext_mail.init_app(app)
ext_hosting_provider.init_app(app)
ext_sentry.init_app(app)
+ ext_proxy_fix.init_app(app)
# Flask-Login configuration
diff --git a/api/configs/feature/__init__.py b/api/configs/feature/__init__.py
index 9218d529cc..93dbc1367f 100644
--- a/api/configs/feature/__init__.py
+++ b/api/configs/feature/__init__.py
@@ -247,6 +247,12 @@ class HttpConfig(BaseSettings):
default=None,
)
+ RESPECT_XFORWARD_HEADERS_ENABLED: bool = Field(
+ description="Enable or disable the X-Forwarded-For Proxy Fix middleware from Werkzeug"
+ " to respect X-* headers to redirect clients",
+ default=False,
+ )
+
class InnerAPIConfig(BaseSettings):
"""
diff --git a/api/extensions/ext_proxy_fix.py b/api/extensions/ext_proxy_fix.py
new file mode 100644
index 0000000000..c106a4384a
--- /dev/null
+++ b/api/extensions/ext_proxy_fix.py
@@ -0,0 +1,10 @@
+from flask import Flask
+
+from configs import dify_config
+
+
+def init_app(app: Flask):
+ if dify_config.RESPECT_XFORWARD_HEADERS_ENABLED:
+ from werkzeug.middleware.proxy_fix import ProxyFix
+
+ app.wsgi_app = ProxyFix(app.wsgi_app)
From 55679b43898d2eb3f71a2fd5fea08c3c0a3e5926 Mon Sep 17 00:00:00 2001
From: "Charlie.Wei"
Date: Wed, 9 Oct 2024 16:15:03 +0800
Subject: [PATCH 23/61] =?UTF-8?q?azure=20add=20o1-mini=E3=80=81o1-preview?=
=?UTF-8?q?=20models=20(#9088)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: crazywoola <100913391+crazywoola@users.noreply.github.com>
---
.../model_providers/azure_openai/_constant.py | 75 ++++++++++-
.../azure_openai/azure_openai.yaml | 12 ++
.../model_providers/azure_openai/llm/llm.py | 122 ++++++++++++++++--
3 files changed, 196 insertions(+), 13 deletions(-)
diff --git a/api/core/model_runtime/model_providers/azure_openai/_constant.py b/api/core/model_runtime/model_providers/azure_openai/_constant.py
index 0dada70cc5..baa5421396 100644
--- a/api/core/model_runtime/model_providers/azure_openai/_constant.py
+++ b/api/core/model_runtime/model_providers/azure_openai/_constant.py
@@ -1081,8 +1081,81 @@ LLM_BASE_MODELS = [
),
),
),
+ AzureBaseModel(
+ base_model_name="o1-preview",
+ entity=AIModelEntity(
+ model="fake-deployment-name",
+ label=I18nObject(
+ en_US="fake-deployment-name-label",
+ ),
+ model_type=ModelType.LLM,
+ features=[
+ ModelFeature.AGENT_THOUGHT,
+ ],
+ fetch_from=FetchFrom.CUSTOMIZABLE_MODEL,
+ model_properties={
+ ModelPropertyKey.MODE: LLMMode.CHAT.value,
+ ModelPropertyKey.CONTEXT_SIZE: 128000,
+ },
+ parameter_rules=[
+ ParameterRule(
+ name="response_format",
+ label=I18nObject(zh_Hans="回复格式", en_US="response_format"),
+ type="string",
+ help=I18nObject(
+ zh_Hans="指定模型必须输出的格式", en_US="specifying the format that the model must output"
+ ),
+ required=False,
+ options=["text", "json_object"],
+ ),
+ _get_max_tokens(default=512, min_val=1, max_val=32768),
+ ],
+ pricing=PriceConfig(
+ input=15.00,
+ output=60.00,
+ unit=0.000001,
+ currency="USD",
+ ),
+ ),
+ ),
+ AzureBaseModel(
+ base_model_name="o1-mini",
+ entity=AIModelEntity(
+ model="fake-deployment-name",
+ label=I18nObject(
+ en_US="fake-deployment-name-label",
+ ),
+ model_type=ModelType.LLM,
+ features=[
+ ModelFeature.AGENT_THOUGHT,
+ ],
+ fetch_from=FetchFrom.CUSTOMIZABLE_MODEL,
+ model_properties={
+ ModelPropertyKey.MODE: LLMMode.CHAT.value,
+ ModelPropertyKey.CONTEXT_SIZE: 128000,
+ },
+ parameter_rules=[
+ ParameterRule(
+ name="response_format",
+ label=I18nObject(zh_Hans="回复格式", en_US="response_format"),
+ type="string",
+ help=I18nObject(
+ zh_Hans="指定模型必须输出的格式", en_US="specifying the format that the model must output"
+ ),
+ required=False,
+ options=["text", "json_object"],
+ ),
+ _get_max_tokens(default=512, min_val=1, max_val=65536),
+ ],
+ pricing=PriceConfig(
+ input=3.00,
+ output=12.00,
+ unit=0.000001,
+ currency="USD",
+ ),
+ ),
+ ),
]
-
EMBEDDING_BASE_MODELS = [
AzureBaseModel(
base_model_name="text-embedding-ada-002",
diff --git a/api/core/model_runtime/model_providers/azure_openai/azure_openai.yaml b/api/core/model_runtime/model_providers/azure_openai/azure_openai.yaml
index 867f9fec42..cb87bfdf6b 100644
--- a/api/core/model_runtime/model_providers/azure_openai/azure_openai.yaml
+++ b/api/core/model_runtime/model_providers/azure_openai/azure_openai.yaml
@@ -120,6 +120,18 @@ model_credential_schema:
show_on:
- variable: __model_type
value: llm
+ - label:
+ en_US: o1-mini
+ value: o1-mini
+ show_on:
+ - variable: __model_type
+ value: llm
+ - label:
+ en_US: o1-preview
+ value: o1-preview
+ show_on:
+ - variable: __model_type
+ value: llm
- label:
en_US: gpt-4o-mini
value: gpt-4o-mini
diff --git a/api/core/model_runtime/model_providers/azure_openai/llm/llm.py b/api/core/model_runtime/model_providers/azure_openai/llm/llm.py
index f0033ea051..f63c80e58e 100644
--- a/api/core/model_runtime/model_providers/azure_openai/llm/llm.py
+++ b/api/core/model_runtime/model_providers/azure_openai/llm/llm.py
@@ -312,20 +312,118 @@ class AzureOpenAILargeLanguageModel(_CommonAzureOpenAI, LargeLanguageModel):
if user:
extra_model_kwargs["user"] = user
- # chat model
- messages = [self._convert_prompt_message_to_dict(m) for m in prompt_messages]
- response = client.chat.completions.create(
- messages=messages,
- model=model,
- stream=stream,
- **model_parameters,
- **extra_model_kwargs,
+ # clear illegal prompt messages
+ prompt_messages = self._clear_illegal_prompt_messages(model, prompt_messages)
+
+ block_as_stream = False
+ if model.startswith("o1"):
+ if stream:
+ block_as_stream = True
+ stream = False
+
+ if "stream_options" in extra_model_kwargs:
+ del extra_model_kwargs["stream_options"]
+
+ if "stop" in extra_model_kwargs:
+ del extra_model_kwargs["stop"]
+
+ # chat model
+ response = client.chat.completions.create(
+ messages=[self._convert_prompt_message_to_dict(m) for m in prompt_messages],
+ model=model,
+ stream=stream,
+ **model_parameters,
+ **extra_model_kwargs,
+ )
+
+ if stream:
+ return self._handle_chat_generate_stream_response(model, credentials, response, prompt_messages, tools)
+
+ block_result = self._handle_chat_generate_response(model, credentials, response, prompt_messages, tools)
+
+ if block_as_stream:
+ return self._handle_chat_block_as_stream_response(block_result, prompt_messages, stop)
+
+ return block_result
+
+ def _handle_chat_block_as_stream_response(
+ self,
+ block_result: LLMResult,
+ prompt_messages: list[PromptMessage],
+ stop: Optional[list[str]] = None,
+ ) -> Generator[LLMResultChunk, None, None]:
+ """
+ Handle llm chat response
+
+ :param model: model name
+ :param credentials: credentials
+ :param response: response
+ :param prompt_messages: prompt messages
+ :param tools: tools for tool calling
+ :param stop: stop words
+ :return: llm response chunk generator
+ """
+ text = block_result.message.content
+ text = cast(str, text)
+
+ if stop:
+ text = self.enforce_stop_tokens(text, stop)
+
+ yield LLMResultChunk(
+ model=block_result.model,
+ prompt_messages=prompt_messages,
+ system_fingerprint=block_result.system_fingerprint,
+ delta=LLMResultChunkDelta(
+ index=0,
+ message=AssistantPromptMessage(content=text),
+ finish_reason="stop",
+ usage=block_result.usage,
+ ),
)
- if stream:
- return self._handle_chat_generate_stream_response(model, credentials, response, prompt_messages, tools)
+ def _clear_illegal_prompt_messages(self, model: str, prompt_messages: list[PromptMessage]) -> list[PromptMessage]:
+ """
+ Clear illegal prompt messages for OpenAI API
+
+ :param model: model name
+ :param prompt_messages: prompt messages
+ :return: cleaned prompt messages
+ """
+ checklist = ["gpt-4-turbo", "gpt-4-turbo-2024-04-09"]
+
+ if model in checklist:
+ # count how many user messages are there
+ user_message_count = len([m for m in prompt_messages if isinstance(m, UserPromptMessage)])
+ if user_message_count > 1:
+ for prompt_message in prompt_messages:
+ if isinstance(prompt_message, UserPromptMessage):
+ if isinstance(prompt_message.content, list):
+ prompt_message.content = "\n".join(
+ [
+ item.data
+ if item.type == PromptMessageContentType.TEXT
+ else "[IMAGE]"
+ if item.type == PromptMessageContentType.IMAGE
+ else ""
+ for item in prompt_message.content
+ ]
+ )
+
+ if model.startswith("o1"):
+ system_message_count = len([m for m in prompt_messages if isinstance(m, SystemPromptMessage)])
+ if system_message_count > 0:
+ new_prompt_messages = []
+ for prompt_message in prompt_messages:
+ if isinstance(prompt_message, SystemPromptMessage):
+ prompt_message = UserPromptMessage(
+ content=prompt_message.content,
+ name=prompt_message.name,
+ )
+
+ new_prompt_messages.append(prompt_message)
+ prompt_messages = new_prompt_messages
- return self._handle_chat_generate_response(model, credentials, response, prompt_messages, tools)
+ return prompt_messages
def _handle_chat_generate_response(
self,
@@ -560,7 +658,7 @@ class AzureOpenAILargeLanguageModel(_CommonAzureOpenAI, LargeLanguageModel):
tokens_per_message = 4
# if there's a name, the role is omitted
tokens_per_name = -1
- elif model.startswith("gpt-35-turbo") or model.startswith("gpt-4"):
+ elif model.startswith("gpt-35-turbo") or model.startswith("gpt-4") or model.startswith("o1"):
tokens_per_message = 3
tokens_per_name = 1
else:
From ec0aa32cd4e39568c95d056aeafea9218975f128 Mon Sep 17 00:00:00 2001
From: Alter-xyz <88554920+alterxyz@users.noreply.github.com>
Date: Wed, 9 Oct 2024 04:56:09 -0400
Subject: [PATCH 24/61] Add customizable size for chatbot embed with default
values (#9115)
---
web/app/components/app/overview/embedded/index.tsx | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/web/app/components/app/overview/embedded/index.tsx b/web/app/components/app/overview/embedded/index.tsx
index fa023192c9..b71a3c3fdf 100644
--- a/web/app/components/app/overview/embedded/index.tsx
+++ b/web/app/components/app/overview/embedded/index.tsx
@@ -52,6 +52,10 @@ const OPTION_MAP = {
#dify-chatbot-bubble-button {
background-color: ${primaryColor} !important;
}
+ #dify-chatbot-bubble-window {
+ width: 24rem !important;
+ height: 40rem !important;
+ }
`,
},
chromePlugin: {
From cbd3ffe0562bc8f2ce819a0e253ac7c9d1c69b54 Mon Sep 17 00:00:00 2001
From: Yi Xiao <54782454+YIXIAO0@users.noreply.github.com>
Date: Wed, 9 Oct 2024 18:26:38 +0800
Subject: [PATCH 25/61] Fix the margin for the rerank switch in retrieval
setting (#9124)
---
.../dataset-config/params-config/config-content.tsx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/web/app/components/app/configuration/dataset-config/params-config/config-content.tsx b/web/app/components/app/configuration/dataset-config/params-config/config-content.tsx
index f99496b14f..7f83a14d58 100644
--- a/web/app/components/app/configuration/dataset-config/params-config/config-content.tsx
+++ b/web/app/components/app/configuration/dataset-config/params-config/config-content.tsx
@@ -243,7 +243,7 @@ const ConfigContent: FC = ({
/>
)
}
- {t('common.modelProvider.rerankModel.key')}
+ {t('common.modelProvider.rerankModel.key')}
From 7a1da2409d222257912adf16277dc34112819e46 Mon Sep 17 00:00:00 2001
From: pinsily <13160724868@163.com>
Date: Wed, 9 Oct 2024 21:09:36 +0800
Subject: [PATCH 26/61] add generate conversation name error log (#9117)
---
api/core/app/task_pipeline/message_cycle_manage.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/api/core/app/task_pipeline/message_cycle_manage.py b/api/core/app/task_pipeline/message_cycle_manage.py
index 5872e00740..3a1d1b227f 100644
--- a/api/core/app/task_pipeline/message_cycle_manage.py
+++ b/api/core/app/task_pipeline/message_cycle_manage.py
@@ -82,8 +82,8 @@ class MessageCycleManage:
try:
name = LLMGenerator.generate_conversation_name(app_model.tenant_id, query)
conversation.name = name
- except:
- pass
+ except Exception as e:
+ logging.exception(f"generate conversation name failed: {e}")
db.session.merge(conversation)
db.session.commit()
From 511ffa46989399c3211d4564df5be1b2dd69d1d7 Mon Sep 17 00:00:00 2001
From: Hash Brown
Date: Wed, 9 Oct 2024 21:10:55 +0800
Subject: [PATCH 27/61] =?UTF-8?q?fix:=20follow-up=20(suggested=20questions?=
=?UTF-8?q?)=20does=20not=20refer=20to=20the=20most=20recen=E2=80=A6=20(#9?=
=?UTF-8?q?122)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
api/core/memory/token_buffer_memory.py | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/api/core/memory/token_buffer_memory.py b/api/core/memory/token_buffer_memory.py
index 60b36c50f0..72da3b0c6f 100644
--- a/api/core/memory/token_buffer_memory.py
+++ b/api/core/memory/token_buffer_memory.py
@@ -58,7 +58,11 @@ class TokenBufferMemory:
# instead of all messages from the conversation, we only need to extract messages
# that belong to the thread of last message
thread_messages = extract_thread_messages(messages)
- thread_messages.pop(0)
+
+ # for newly created message, its answer is temporarily empty, we don't need to add it to memory
+ if thread_messages and not thread_messages[-1].answer:
+ thread_messages.pop()
+
messages = list(reversed(thread_messages))
message_file_parser = MessageFileParser(tenant_id=app_record.tenant_id, app_id=app_record.id)
From cb35e84f512eb9ce1c23417d718130ce2223c4ef Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E9=9D=9E=E6=B3=95=E6=93=8D=E4=BD=9C?=
Date: Wed, 9 Oct 2024 21:11:13 +0800
Subject: [PATCH 28/61] fix: docker env typo (#9119)
---
docker/docker-compose.yaml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docker/docker-compose.yaml b/docker/docker-compose.yaml
index ddb6ded206..c1a76d7f88 100644
--- a/docker/docker-compose.yaml
+++ b/docker/docker-compose.yaml
@@ -204,7 +204,7 @@ x-shared-env: &shared-api-worker-env
CODE_MAX_NUMBER_ARRAY_LENGTH: ${CODE_MAX_NUMBER_ARRAY_LENGTH:-1000}
WORKFLOW_MAX_EXECUTION_STEPS: ${WORKFLOW_MAX_EXECUTION_STEPS:-500}
WORKFLOW_MAX_EXECUTION_TIME: ${WORKFLOW_MAX_EXECUTION_TIME:-1200}
- WORKFLOW_CALL_MAX_DEPTH: ${WORKFLOW_MAX_EXECUTION_TIME:-5}
+ WORKFLOW_CALL_MAX_DEPTH: ${WORKFLOW_CALL_MAX_DEPTH:-5}
SSRF_PROXY_HTTP_URL: ${SSRF_PROXY_HTTP_URL:-http://ssrf_proxy:3128}
SSRF_PROXY_HTTPS_URL: ${SSRF_PROXY_HTTPS_URL:-http://ssrf_proxy:3128}
HTTP_REQUEST_NODE_MAX_BINARY_SIZE: ${HTTP_REQUEST_NODE_MAX_BINARY_SIZE:-10485760}
From b279d1904085d0265c4b0a0ef5843bc11b22c837 Mon Sep 17 00:00:00 2001
From: Bowen Liang
Date: Wed, 9 Oct 2024 21:12:50 +0800
Subject: [PATCH 29/61] chore: avoid star imports usage (#9123)
---
api/pyproject.toml | 2 --
api/services/account_service.py | 13 ++++++++++++-
2 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/api/pyproject.toml b/api/pyproject.toml
index 48418974d4..956d4dbd11 100644
--- a/api/pyproject.toml
+++ b/api/pyproject.toml
@@ -45,8 +45,6 @@ ignore = [
"E721", # type-comparison
"E722", # bare-except
"E731", # lambda-assignment
- "F403", # undefined-local-with-import-star
- "F405", # undefined-local-with-import-star-usage
"F821", # undefined-name
"F841", # unused-variable
"FURB113", # repeated-append
diff --git a/api/services/account_service.py b/api/services/account_service.py
index c3d3354a1d..05b505f8a6 100644
--- a/api/services/account_service.py
+++ b/api/services/account_service.py
@@ -1,4 +1,5 @@
import base64
+import json
import logging
import secrets
import uuid
@@ -12,12 +13,22 @@ from werkzeug.exceptions import Unauthorized
from configs import dify_config
from constants.languages import language_timezone_mapping, languages
from events.tenant_event import tenant_was_created
+from extensions.ext_database import db
from extensions.ext_redis import redis_client
from libs.helper import RateLimiter, TokenManager
from libs.passport import PassportService
from libs.password import compare_password, hash_password, valid_password
from libs.rsa import generate_key_pair
-from models.account import *
+from models.account import (
+ Account,
+ AccountIntegrate,
+ AccountStatus,
+ Tenant,
+ TenantAccountJoin,
+ TenantAccountJoinRole,
+ TenantAccountRole,
+ TenantStatus,
+)
from models.model import DifySetup
from services.errors.account import (
AccountAlreadyInTenantError,
From 499cc570821dafd26facbae1cab5192a5c6c4a3d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E9=9D=9E=E6=B3=95=E6=93=8D=E4=BD=9C?=
Date: Thu, 10 Oct 2024 10:07:21 +0800
Subject: [PATCH 30/61] fix: response_format of model_parameters will not be
removed (#9148)
---
.../model_providers/__base/large_language_model.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/api/core/model_runtime/model_providers/__base/large_language_model.py b/api/core/model_runtime/model_providers/__base/large_language_model.py
index ba88cc1f38..0027411a6e 100644
--- a/api/core/model_runtime/model_providers/__base/large_language_model.py
+++ b/api/core/model_runtime/model_providers/__base/large_language_model.py
@@ -94,7 +94,7 @@ class LargeLanguageModel(AIModel):
)
try:
- if "response_format" in model_parameters:
+ if "response_format" in model_parameters and model_parameters["response_format"] in {"JSON", "XML"}:
result = self._code_block_mode_wrapper(
model=model,
credentials=credentials,
From 060897b25ba93db90499d42fd5b0fbdc36b96687 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=91=86=E8=90=8C=E9=97=B7=E6=B2=B9=E7=93=B6?=
<253605712@qq.com>
Date: Thu, 10 Oct 2024 10:07:49 +0800
Subject: [PATCH 31/61] chore:add azure openai api version 2024-09-01-preview
(#9141)
---
.../model_providers/azure_openai/azure_openai.yaml | 3 +++
1 file changed, 3 insertions(+)
diff --git a/api/core/model_runtime/model_providers/azure_openai/azure_openai.yaml b/api/core/model_runtime/model_providers/azure_openai/azure_openai.yaml
index cb87bfdf6b..093f57c51e 100644
--- a/api/core/model_runtime/model_providers/azure_openai/azure_openai.yaml
+++ b/api/core/model_runtime/model_providers/azure_openai/azure_openai.yaml
@@ -53,6 +53,9 @@ model_credential_schema:
type: select
required: true
options:
+ - label:
+ en_US: 2024-09-01-preview
+ value: 2024-09-01-preview
- label:
en_US: 2024-08-01-preview
value: 2024-08-01-preview
From 37d5c166ca1a43a2270fe41e1acbc2d1609c6215 Mon Sep 17 00:00:00 2001
From: -LAN-
Date: Thu, 10 Oct 2024 10:16:24 +0800
Subject: [PATCH 32/61] fix(migrations): correct parent_message_id for
service-api records (#9132)
---
...744d88ed6_fix_wrong_service_api_history.py | 48 +++++++++++++++++++
1 file changed, 48 insertions(+)
create mode 100644 api/migrations/versions/2024_10_09_1329-d8e744d88ed6_fix_wrong_service_api_history.py
diff --git a/api/migrations/versions/2024_10_09_1329-d8e744d88ed6_fix_wrong_service_api_history.py b/api/migrations/versions/2024_10_09_1329-d8e744d88ed6_fix_wrong_service_api_history.py
new file mode 100644
index 0000000000..b3b8dfa7d4
--- /dev/null
+++ b/api/migrations/versions/2024_10_09_1329-d8e744d88ed6_fix_wrong_service_api_history.py
@@ -0,0 +1,48 @@
+"""fix wrong service-api history
+
+Revision ID: d8e744d88ed6
+Revises: 33f5fac87f29
+Create Date: 2024-10-09 13:29:23.548498
+
+"""
+from alembic import op
+from constants import UUID_NIL
+import models as models
+import sqlalchemy as sa
+
+
+# revision identifiers, used by Alembic.
+revision = 'd8e744d88ed6'
+down_revision = '33f5fac87f29'
+branch_labels = None
+depends_on = None
+
+# (UTC) release date of v0.9.0
+v0_9_0_release_date= '2024-09-29 12:00:00'
+
+def upgrade():
+ # ### commands auto generated by Alembic - please adjust! ###
+ sql = f"""UPDATE
+ public.messages
+SET
+ parent_message_id = '{UUID_NIL}'
+WHERE
+ invoke_from = 'service-api'
+ AND parent_message_id IS NULL
+ AND created_at >= '{v0_9_0_release_date}';"""
+ op.execute(sql)
+ # ### end Alembic commands ###
+
+
+def downgrade():
+ # ### commands auto generated by Alembic - please adjust! ###
+ sql = f"""UPDATE
+ public.messages
+SET
+ parent_message_id = NULL
+WHERE
+ invoke_from = 'service-api'
+ AND parent_message_id = '{UUID_NIL}'
+ AND created_at >= '{v0_9_0_release_date}';"""
+ op.execute(sql)
+ # ### end Alembic commands ###
From 2024a6c941fd618fa53349d09e2d69adb7acf2d9 Mon Sep 17 00:00:00 2001
From: luckylhb90
Date: Thu, 10 Oct 2024 05:16:42 +0300
Subject: [PATCH 33/61] fix: vertex ai remote url error(Error: not enough
values to unpack) (#9134)
Co-authored-by: hobo.l
---
.../model_providers/vertex_ai/llm/llm.py | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/api/core/model_runtime/model_providers/vertex_ai/llm/llm.py b/api/core/model_runtime/model_providers/vertex_ai/llm/llm.py
index 1dd785d545..1469de6055 100644
--- a/api/core/model_runtime/model_providers/vertex_ai/llm/llm.py
+++ b/api/core/model_runtime/model_providers/vertex_ai/llm/llm.py
@@ -7,6 +7,7 @@ from collections.abc import Generator
from typing import Optional, Union, cast
import google.auth.transport.requests
+import requests
import vertexai.generative_models as glm
from anthropic import AnthropicVertex, Stream
from anthropic.types import (
@@ -653,9 +654,15 @@ class VertexAiLargeLanguageModel(LargeLanguageModel):
if c.type == PromptMessageContentType.TEXT:
parts.append(glm.Part.from_text(c.data))
else:
- metadata, data = c.data.split(",", 1)
- mime_type = metadata.split(";", 1)[0].split(":")[1]
- parts.append(glm.Part.from_data(mime_type=mime_type, data=data))
+ message_content = cast(ImagePromptMessageContent, c)
+ if not message_content.data.startswith("data:"):
+ url_arr = message_content.data.split(".")
+ mime_type = f"image/{url_arr[-1]}"
+ parts.append(glm.Part.from_uri(mime_type=mime_type, uri=message_content.data))
+ else:
+ metadata, data = c.data.split(",", 1)
+ mime_type = metadata.split(";", 1)[0].split(":")[1]
+ parts.append(glm.Part.from_data(mime_type=mime_type, data=data))
glm_content = glm.Content(role="user", parts=parts)
return glm_content
elif isinstance(message, AssistantPromptMessage):
From 783a6b866bfaed59721389ed4c92245270a65507 Mon Sep 17 00:00:00 2001
From: crazywoola <100913391+crazywoola@users.noreply.github.com>
Date: Thu, 10 Oct 2024 10:25:45 +0800
Subject: [PATCH 34/61] fix: #9076 (#9150)
---
.../base/chat/embedded-chatbot/theme/theme-context.ts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/web/app/components/base/chat/embedded-chatbot/theme/theme-context.ts b/web/app/components/base/chat/embedded-chatbot/theme/theme-context.ts
index 7a814e2521..49994d93e2 100644
--- a/web/app/components/base/chat/embedded-chatbot/theme/theme-context.ts
+++ b/web/app/components/base/chat/embedded-chatbot/theme/theme-context.ts
@@ -26,7 +26,7 @@ export class Theme {
if (this.chatColorTheme !== null && this.chatColorTheme !== '') {
this.primaryColor = this.chatColorTheme ?? '#1C64F2'
this.backgroundHeaderColorStyle = `backgroundColor: ${this.primaryColor}`
- this.backgroundButtonDefaultColorStyle = `backgroundColor: ${this.primaryColor}; color: ${colorFontOnHeaderStyle};`
+ this.backgroundButtonDefaultColorStyle = `backgroundColor: ${this.primaryColor}; color: ${this.colorFontOnHeaderStyle};`
this.roundedBackgroundColorStyle = `backgroundColor: ${hexToRGBA(this.primaryColor, 0.05)}`
this.chatBubbleColorStyle = `backgroundColor: ${hexToRGBA(this.primaryColor, 0.15)}`
this.chatBubbleColor = `${hexToRGBA(this.primaryColor, 0.15)}`
From 62051d51716d7249ee9eb8ee7c1f1f9b9f2ecf35 Mon Sep 17 00:00:00 2001
From: ronaksingh27 <102898752+ronaksingh27@users.noreply.github.com>
Date: Thu, 10 Oct 2024 08:04:25 +0530
Subject: [PATCH 35/61] Corrected type annotation to "Any" from "any" all files
in "model_providers" folder (#9135)
---
.../model_runtime/model_providers/__base/tts_model.py | 4 ++--
.../model_runtime/model_providers/azure_openai/tts/tts.py | 6 +++---
.../model_runtime/model_providers/fishaudio/tts/tts.py | 8 ++++----
api/core/model_runtime/model_providers/openai/tts/tts.py | 6 +++---
.../model_runtime/model_providers/sagemaker/tts/tts.py | 4 ++--
api/core/model_runtime/model_providers/tongyi/tts/tts.py | 6 +++---
.../model_runtime/model_providers/xinference/tts/tts.py | 6 +++---
7 files changed, 20 insertions(+), 20 deletions(-)
diff --git a/api/core/model_runtime/model_providers/__base/tts_model.py b/api/core/model_runtime/model_providers/__base/tts_model.py
index 70be9322a7..862ec29daf 100644
--- a/api/core/model_runtime/model_providers/__base/tts_model.py
+++ b/api/core/model_runtime/model_providers/__base/tts_model.py
@@ -1,7 +1,7 @@
import logging
import re
from abc import abstractmethod
-from typing import Optional
+from typing import Any, Optional
from pydantic import ConfigDict
@@ -88,7 +88,7 @@ class TTSModel(AIModel):
else:
return [{"name": d["name"], "value": d["mode"]} for d in voices]
- def _get_model_default_voice(self, model: str, credentials: dict) -> any:
+ def _get_model_default_voice(self, model: str, credentials: dict) -> Any:
"""
Get voice for given tts model
diff --git a/api/core/model_runtime/model_providers/azure_openai/tts/tts.py b/api/core/model_runtime/model_providers/azure_openai/tts/tts.py
index af178703a0..133cc9f76e 100644
--- a/api/core/model_runtime/model_providers/azure_openai/tts/tts.py
+++ b/api/core/model_runtime/model_providers/azure_openai/tts/tts.py
@@ -1,6 +1,6 @@
import concurrent.futures
import copy
-from typing import Optional
+from typing import Any, Optional
from openai import AzureOpenAI
@@ -19,7 +19,7 @@ class AzureOpenAIText2SpeechModel(_CommonAzureOpenAI, TTSModel):
def _invoke(
self, model: str, tenant_id: str, credentials: dict, content_text: str, voice: str, user: Optional[str] = None
- ) -> any:
+ ) -> Any:
"""
_invoke text2speech model
@@ -56,7 +56,7 @@ class AzureOpenAIText2SpeechModel(_CommonAzureOpenAI, TTSModel):
except Exception as ex:
raise CredentialsValidateFailedError(str(ex))
- def _tts_invoke_streaming(self, model: str, credentials: dict, content_text: str, voice: str) -> any:
+ def _tts_invoke_streaming(self, model: str, credentials: dict, content_text: str, voice: str) -> Any:
"""
_tts_invoke_streaming text2speech model
:param model: model name
diff --git a/api/core/model_runtime/model_providers/fishaudio/tts/tts.py b/api/core/model_runtime/model_providers/fishaudio/tts/tts.py
index 895a7a914c..e518d7b95b 100644
--- a/api/core/model_runtime/model_providers/fishaudio/tts/tts.py
+++ b/api/core/model_runtime/model_providers/fishaudio/tts/tts.py
@@ -1,4 +1,4 @@
-from typing import Optional
+from typing import Any, Optional
import httpx
@@ -46,7 +46,7 @@ class FishAudioText2SpeechModel(TTSModel):
content_text: str,
voice: str,
user: Optional[str] = None,
- ) -> any:
+ ) -> Any:
"""
Invoke text2speech model
@@ -87,7 +87,7 @@ class FishAudioText2SpeechModel(TTSModel):
except Exception as ex:
raise CredentialsValidateFailedError(str(ex))
- def _tts_invoke_streaming(self, model: str, credentials: dict, content_text: str, voice: str) -> any:
+ def _tts_invoke_streaming(self, model: str, credentials: dict, content_text: str, voice: str) -> Any:
"""
Invoke streaming text2speech model
:param model: model name
@@ -112,7 +112,7 @@ class FishAudioText2SpeechModel(TTSModel):
except Exception as ex:
raise InvokeBadRequestError(str(ex))
- def _tts_invoke_streaming_sentence(self, credentials: dict, content_text: str, voice: Optional[str] = None) -> any:
+ def _tts_invoke_streaming_sentence(self, credentials: dict, content_text: str, voice: Optional[str] = None) -> Any:
"""
Invoke streaming text2speech model
diff --git a/api/core/model_runtime/model_providers/openai/tts/tts.py b/api/core/model_runtime/model_providers/openai/tts/tts.py
index a14c91639b..2e57b95944 100644
--- a/api/core/model_runtime/model_providers/openai/tts/tts.py
+++ b/api/core/model_runtime/model_providers/openai/tts/tts.py
@@ -1,5 +1,5 @@
import concurrent.futures
-from typing import Optional
+from typing import Any, Optional
from openai import OpenAI
@@ -16,7 +16,7 @@ class OpenAIText2SpeechModel(_CommonOpenAI, TTSModel):
def _invoke(
self, model: str, tenant_id: str, credentials: dict, content_text: str, voice: str, user: Optional[str] = None
- ) -> any:
+ ) -> Any:
"""
_invoke text2speech model
@@ -55,7 +55,7 @@ class OpenAIText2SpeechModel(_CommonOpenAI, TTSModel):
except Exception as ex:
raise CredentialsValidateFailedError(str(ex))
- def _tts_invoke_streaming(self, model: str, credentials: dict, content_text: str, voice: str) -> any:
+ def _tts_invoke_streaming(self, model: str, credentials: dict, content_text: str, voice: str) -> Any:
"""
_tts_invoke_streaming text2speech model
diff --git a/api/core/model_runtime/model_providers/sagemaker/tts/tts.py b/api/core/model_runtime/model_providers/sagemaker/tts/tts.py
index 9652e1d650..1a5afd18f9 100644
--- a/api/core/model_runtime/model_providers/sagemaker/tts/tts.py
+++ b/api/core/model_runtime/model_providers/sagemaker/tts/tts.py
@@ -192,7 +192,7 @@ class SageMakerText2SpeechModel(TTSModel):
InvokeBadRequestError: [InvokeBadRequestError, KeyError, ValueError],
}
- def _get_model_default_voice(self, model: str, credentials: dict) -> any:
+ def _get_model_default_voice(self, model: str, credentials: dict) -> Any:
return ""
def _get_model_word_limit(self, model: str, credentials: dict) -> int:
@@ -225,7 +225,7 @@ class SageMakerText2SpeechModel(TTSModel):
json_obj = json.loads(json_str)
return json_obj
- def _tts_invoke_streaming(self, model_type: str, payload: dict, sagemaker_endpoint: str) -> any:
+ def _tts_invoke_streaming(self, model_type: str, payload: dict, sagemaker_endpoint: str) -> Any:
"""
_tts_invoke_streaming text2speech model
diff --git a/api/core/model_runtime/model_providers/tongyi/tts/tts.py b/api/core/model_runtime/model_providers/tongyi/tts/tts.py
index 48a38897a8..ca3b9fbc1c 100644
--- a/api/core/model_runtime/model_providers/tongyi/tts/tts.py
+++ b/api/core/model_runtime/model_providers/tongyi/tts/tts.py
@@ -1,6 +1,6 @@
import threading
from queue import Queue
-from typing import Optional
+from typing import Any, Optional
import dashscope
from dashscope import SpeechSynthesizer
@@ -20,7 +20,7 @@ class TongyiText2SpeechModel(_CommonTongyi, TTSModel):
def _invoke(
self, model: str, tenant_id: str, credentials: dict, content_text: str, voice: str, user: Optional[str] = None
- ) -> any:
+ ) -> Any:
"""
_invoke text2speech model
@@ -58,7 +58,7 @@ class TongyiText2SpeechModel(_CommonTongyi, TTSModel):
except Exception as ex:
raise CredentialsValidateFailedError(str(ex))
- def _tts_invoke_streaming(self, model: str, credentials: dict, content_text: str, voice: str) -> any:
+ def _tts_invoke_streaming(self, model: str, credentials: dict, content_text: str, voice: str) -> Any:
"""
_tts_invoke_streaming text2speech model
diff --git a/api/core/model_runtime/model_providers/xinference/tts/tts.py b/api/core/model_runtime/model_providers/xinference/tts/tts.py
index 6290e8551d..3f46b50c33 100644
--- a/api/core/model_runtime/model_providers/xinference/tts/tts.py
+++ b/api/core/model_runtime/model_providers/xinference/tts/tts.py
@@ -1,5 +1,5 @@
import concurrent.futures
-from typing import Optional
+from typing import Any, Optional
from xinference_client.client.restful.restful_client import RESTfulAudioModelHandle
@@ -166,7 +166,7 @@ class XinferenceText2SpeechModel(TTSModel):
return self.model_voices["__default"]["all"]
- def _get_model_default_voice(self, model: str, credentials: dict) -> any:
+ def _get_model_default_voice(self, model: str, credentials: dict) -> Any:
return ""
def _get_model_word_limit(self, model: str, credentials: dict) -> int:
@@ -178,7 +178,7 @@ class XinferenceText2SpeechModel(TTSModel):
def _get_model_workers_limit(self, model: str, credentials: dict) -> int:
return 5
- def _tts_invoke_streaming(self, model: str, credentials: dict, content_text: str, voice: str) -> any:
+ def _tts_invoke_streaming(self, model: str, credentials: dict, content_text: str, voice: str) -> Any:
"""
_tts_invoke_streaming text2speech model
From e947103b6d67ffb074532ea96c12a13928a7d82b Mon Sep 17 00:00:00 2001
From: Joe <79627742+ZhouhaoJiang@users.noreply.github.com>
Date: Thu, 10 Oct 2024 11:15:52 +0800
Subject: [PATCH 36/61] Feat/add workflow sys params (#9108)
Co-authored-by: Joel
---
.../app/apps/advanced_chat/app_generator.py | 2 ++
api/core/app/apps/advanced_chat/app_runner.py | 3 ++
.../advanced_chat/generate_task_pipeline.py | 4 +++
api/core/app/apps/workflow/app_generator.py | 2 ++
api/core/app/apps/workflow/app_runner.py | 3 ++
.../apps/workflow/generate_task_pipeline.py | 3 ++
api/core/app/entities/app_invoke_entities.py | 2 ++
.../task_pipeline/workflow_cycle_manage.py | 3 ++
api/core/workflow/enums.py | 3 ++
web/app/components/workflow/index.tsx | 6 ++--
.../nodes/_base/components/variable/utils.ts | 13 ++++++++
.../components/workflow/nodes/start/panel.tsx | 33 +++++++++++++++++++
12 files changed, 74 insertions(+), 3 deletions(-)
diff --git a/api/core/app/apps/advanced_chat/app_generator.py b/api/core/app/apps/advanced_chat/app_generator.py
index 445ef6d0ab..0d183596f3 100644
--- a/api/core/app/apps/advanced_chat/app_generator.py
+++ b/api/core/app/apps/advanced_chat/app_generator.py
@@ -113,6 +113,7 @@ class AdvancedChatAppGenerator(MessageBasedAppGenerator):
# always enable retriever resource in debugger mode
app_config.additional_features.show_retrieve_source = True
+ workflow_run_id = str(uuid.uuid4())
# init application generate entity
application_generate_entity = AdvancedChatAppGenerateEntity(
task_id=str(uuid.uuid4()),
@@ -127,6 +128,7 @@ class AdvancedChatAppGenerator(MessageBasedAppGenerator):
invoke_from=invoke_from,
extras=extras,
trace_manager=trace_manager,
+ workflow_run_id=workflow_run_id,
)
contexts.tenant_id.set(application_generate_entity.app_config.tenant_id)
diff --git a/api/core/app/apps/advanced_chat/app_runner.py b/api/core/app/apps/advanced_chat/app_runner.py
index 1bca1e1b71..1dcd051d15 100644
--- a/api/core/app/apps/advanced_chat/app_runner.py
+++ b/api/core/app/apps/advanced_chat/app_runner.py
@@ -149,6 +149,9 @@ class AdvancedChatAppRunner(WorkflowBasedAppRunner):
SystemVariableKey.CONVERSATION_ID: self.conversation.id,
SystemVariableKey.USER_ID: user_id,
SystemVariableKey.DIALOGUE_COUNT: conversation_dialogue_count,
+ SystemVariableKey.APP_ID: app_config.app_id,
+ SystemVariableKey.WORKFLOW_ID: app_config.workflow_id,
+ SystemVariableKey.WORKFLOW_RUN_ID: self.application_generate_entity.workflow_run_id,
}
# init variable pool
diff --git a/api/core/app/apps/advanced_chat/generate_task_pipeline.py b/api/core/app/apps/advanced_chat/generate_task_pipeline.py
index 897b6fd063..5ce25ebf28 100644
--- a/api/core/app/apps/advanced_chat/generate_task_pipeline.py
+++ b/api/core/app/apps/advanced_chat/generate_task_pipeline.py
@@ -107,6 +107,10 @@ class AdvancedChatAppGenerateTaskPipeline(BasedGenerateTaskPipeline, WorkflowCyc
SystemVariableKey.FILES: application_generate_entity.files,
SystemVariableKey.CONVERSATION_ID: conversation.id,
SystemVariableKey.USER_ID: user_id,
+ SystemVariableKey.DIALOGUE_COUNT: conversation.dialogue_count,
+ SystemVariableKey.APP_ID: application_generate_entity.app_config.app_id,
+ SystemVariableKey.WORKFLOW_ID: workflow.id,
+ SystemVariableKey.WORKFLOW_RUN_ID: application_generate_entity.workflow_run_id,
}
self._task_state = WorkflowTaskState()
diff --git a/api/core/app/apps/workflow/app_generator.py b/api/core/app/apps/workflow/app_generator.py
index 57a77591a0..bd0ab53278 100644
--- a/api/core/app/apps/workflow/app_generator.py
+++ b/api/core/app/apps/workflow/app_generator.py
@@ -99,6 +99,7 @@ class WorkflowAppGenerator(BaseAppGenerator):
user_id = user.id if isinstance(user, Account) else user.session_id
trace_manager = TraceQueueManager(app_model.id, user_id)
+ workflow_run_id = str(uuid.uuid4())
# init application generate entity
application_generate_entity = WorkflowAppGenerateEntity(
task_id=str(uuid.uuid4()),
@@ -110,6 +111,7 @@ class WorkflowAppGenerator(BaseAppGenerator):
invoke_from=invoke_from,
call_depth=call_depth,
trace_manager=trace_manager,
+ workflow_run_id=workflow_run_id,
)
contexts.tenant_id.set(application_generate_entity.app_config.tenant_id)
diff --git a/api/core/app/apps/workflow/app_runner.py b/api/core/app/apps/workflow/app_runner.py
index 22ec228fa7..378a4bb8bc 100644
--- a/api/core/app/apps/workflow/app_runner.py
+++ b/api/core/app/apps/workflow/app_runner.py
@@ -90,6 +90,9 @@ class WorkflowAppRunner(WorkflowBasedAppRunner):
system_inputs = {
SystemVariableKey.FILES: files,
SystemVariableKey.USER_ID: user_id,
+ SystemVariableKey.APP_ID: app_config.app_id,
+ SystemVariableKey.WORKFLOW_ID: app_config.workflow_id,
+ SystemVariableKey.WORKFLOW_RUN_ID: self.application_generate_entity.workflow_run_id,
}
variable_pool = VariablePool(
diff --git a/api/core/app/apps/workflow/generate_task_pipeline.py b/api/core/app/apps/workflow/generate_task_pipeline.py
index 798847a507..3afc505367 100644
--- a/api/core/app/apps/workflow/generate_task_pipeline.py
+++ b/api/core/app/apps/workflow/generate_task_pipeline.py
@@ -97,6 +97,9 @@ class WorkflowAppGenerateTaskPipeline(BasedGenerateTaskPipeline, WorkflowCycleMa
self._workflow_system_variables = {
SystemVariableKey.FILES: application_generate_entity.files,
SystemVariableKey.USER_ID: user_id,
+ SystemVariableKey.APP_ID: application_generate_entity.app_config.app_id,
+ SystemVariableKey.WORKFLOW_ID: workflow.id,
+ SystemVariableKey.WORKFLOW_RUN_ID: application_generate_entity.workflow_run_id,
}
self._task_state = WorkflowTaskState()
diff --git a/api/core/app/entities/app_invoke_entities.py b/api/core/app/entities/app_invoke_entities.py
index 87ca51ef1b..e757c8db75 100644
--- a/api/core/app/entities/app_invoke_entities.py
+++ b/api/core/app/entities/app_invoke_entities.py
@@ -152,6 +152,7 @@ class AdvancedChatAppGenerateEntity(AppGenerateEntity):
conversation_id: Optional[str] = None
parent_message_id: Optional[str] = None
+ workflow_run_id: Optional[str] = None
query: str
class SingleIterationRunEntity(BaseModel):
@@ -172,6 +173,7 @@ class WorkflowAppGenerateEntity(AppGenerateEntity):
# app config
app_config: WorkflowUIBasedAppConfig
+ workflow_run_id: Optional[str] = None
class SingleIterationRunEntity(BaseModel):
"""
diff --git a/api/core/app/task_pipeline/workflow_cycle_manage.py b/api/core/app/task_pipeline/workflow_cycle_manage.py
index f10189798f..4fc587db77 100644
--- a/api/core/app/task_pipeline/workflow_cycle_manage.py
+++ b/api/core/app/task_pipeline/workflow_cycle_manage.py
@@ -85,6 +85,9 @@ class WorkflowCycleManage:
# init workflow run
workflow_run = WorkflowRun()
+ workflow_run_id = self._workflow_system_variables[SystemVariableKey.WORKFLOW_RUN_ID]
+ if workflow_run_id:
+ workflow_run.id = workflow_run_id
workflow_run.tenant_id = self._workflow.tenant_id
workflow_run.app_id = self._workflow.app_id
workflow_run.sequence_number = new_sequence_number
diff --git a/api/core/workflow/enums.py b/api/core/workflow/enums.py
index da65f6b1fb..213ed57f57 100644
--- a/api/core/workflow/enums.py
+++ b/api/core/workflow/enums.py
@@ -11,3 +11,6 @@ class SystemVariableKey(str, Enum):
CONVERSATION_ID = "conversation_id"
USER_ID = "user_id"
DIALOGUE_COUNT = "dialogue_count"
+ APP_ID = "app_id"
+ WORKFLOW_ID = "workflow_id"
+ WORKFLOW_RUN_ID = "workflow_run_id"
diff --git a/web/app/components/workflow/index.tsx b/web/app/components/workflow/index.tsx
index cdccd60a3b..938ae679c3 100644
--- a/web/app/components/workflow/index.tsx
+++ b/web/app/components/workflow/index.tsx
@@ -405,9 +405,9 @@ const WorkflowWrap = memo(() => {
const initialFeatures: FeaturesData = {
file: {
image: {
- enabled: !!features.file_upload?.image.enabled,
- number_limits: features.file_upload?.image.number_limits || 3,
- transfer_methods: features.file_upload?.image.transfer_methods || ['local_file', 'remote_url'],
+ enabled: !!features.file_upload?.image?.enabled,
+ number_limits: features.file_upload?.image?.number_limits || 3,
+ transfer_methods: features.file_upload?.image?.transfer_methods || ['local_file', 'remote_url'],
},
},
opening: {
diff --git a/web/app/components/workflow/nodes/_base/components/variable/utils.ts b/web/app/components/workflow/nodes/_base/components/variable/utils.ts
index 3deec09dc2..89ba4e5cf9 100644
--- a/web/app/components/workflow/nodes/_base/components/variable/utils.ts
+++ b/web/app/components/workflow/nodes/_base/components/variable/utils.ts
@@ -116,6 +116,19 @@ const formatItem = (
variable: 'sys.files',
type: VarType.arrayFile,
})
+ res.vars.push({
+ variable: 'sys.app_id',
+ type: VarType.string,
+ })
+ res.vars.push({
+ variable: 'sys.workflow_id',
+ type: VarType.string,
+ })
+ res.vars.push({
+ variable: 'sys.workflow_run_id',
+ type: VarType.string,
+ })
+
break
}
diff --git a/web/app/components/workflow/nodes/start/panel.tsx b/web/app/components/workflow/nodes/start/panel.tsx
index ce86a34265..3a1eed5ff4 100644
--- a/web/app/components/workflow/nodes/start/panel.tsx
+++ b/web/app/components/workflow/nodes/start/panel.tsx
@@ -121,6 +121,39 @@ const Panel: FC> = ({
}
/>
+
+ String
+
+ }
+ />
+
+ String
+
+ }
+ />
+
+ String
+
+ }
+ />
>
From bffb0919ccd8ef6390049b5801ec2122d9ea02b7 Mon Sep 17 00:00:00 2001
From: dai <90462400+daisuke0926dev@users.noreply.github.com>
Date: Thu, 10 Oct 2024 15:13:20 +0900
Subject: [PATCH 37/61] fix: Twitter to X(Twitter) (#9157)
---
README.md | 4 ++--
README_AR.md | 2 +-
README_CN.md | 4 ++--
README_ES.md | 4 ++--
README_FR.md | 4 ++--
README_JA.md | 4 ++--
README_KL.md | 4 ++--
README_KR.md | 2 +-
README_TR.md | 4 ++--
README_VI.md | 4 ++--
10 files changed, 18 insertions(+), 18 deletions(-)
diff --git a/README.md b/README.md
index ac4a4e5839..75094d39db 100644
--- a/README.md
+++ b/README.md
@@ -17,7 +17,7 @@
alt="chat on Discord">
+ alt="follow on X(Twitter)">
@@ -223,7 +223,7 @@ At the same time, please consider supporting Dify by sharing it on social media
* [Github Discussion](https://github.com/langgenius/dify/discussions). Best for: sharing feedback and asking questions.
* [GitHub Issues](https://github.com/langgenius/dify/issues). Best for: bugs you encounter using Dify.AI, and feature proposals. See our [Contribution Guide](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md).
* [Discord](https://discord.gg/FngNHpbcY7). Best for: sharing your applications and hanging out with the community.
-* [Twitter](https://twitter.com/dify_ai). Best for: sharing your applications and hanging out with the community.
+* [X(Twitter)](https://twitter.com/dify_ai). Best for: sharing your applications and hanging out with the community.
## Star history
diff --git a/README_AR.md b/README_AR.md
index 42dbd9edff..e46ba73738 100644
--- a/README_AR.md
+++ b/README_AR.md
@@ -17,7 +17,7 @@
alt="chat on Discord">
+ alt="follow on X(Twitter)">
diff --git a/README_CN.md b/README_CN.md
index afeca3147b..4553524ce5 100644
--- a/README_CN.md
+++ b/README_CN.md
@@ -17,7 +17,7 @@
alt="chat on Discord">
+ alt="follow on X(Twitter)">
@@ -236,7 +236,7 @@ docker compose up -d
- [GitHub Issues](https://github.com/langgenius/dify/issues)。👉:使用 Dify.AI 时遇到的错误和问题,请参阅[贡献指南](CONTRIBUTING.md)。
- [电子邮件支持](mailto:hello@dify.ai?subject=[GitHub]Questions%20About%20Dify)。👉:关于使用 Dify.AI 的问题。
- [Discord](https://discord.gg/FngNHpbcY7)。👉:分享您的应用程序并与社区交流。
-- [Twitter](https://twitter.com/dify_ai)。👉:分享您的应用程序并与社区交流。
+- [X(Twitter)](https://twitter.com/dify_ai)。👉:分享您的应用程序并与社区交流。
- [商业许可](mailto:business@dify.ai?subject=[GitHub]Business%20License%20Inquiry)。👉:有关商业用途许可 Dify.AI 的商业咨询。
- [微信]() 👉:扫描下方二维码,添加微信好友,备注 Dify,我们将邀请您加入 Dify 社区。
diff --git a/README_ES.md b/README_ES.md
index a6296aa93d..7da5ac7b61 100644
--- a/README_ES.md
+++ b/README_ES.md
@@ -17,7 +17,7 @@
alt="chat en Discord">
+ alt="seguir en X(Twitter)">
@@ -231,7 +231,7 @@ Al mismo tiempo, considera apoyar a Dify compartiéndolo en redes sociales y en
* [Discusión en GitHub](https://github.com/langgenius/dify/discussions). Lo mejor para: compartir comentarios y hacer preguntas.
* [Reporte de problemas en GitHub](https://github.com/langgenius/dify/issues). Lo mejor para: errores que encuentres usando Dify.AI y propuestas de características. Consulta nuestra [Guía de contribución](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md).
* [Discord](https://discord.gg/FngNHpbcY7). Lo mejor para: compartir tus aplicaciones y pasar el rato con la comunidad.
-* [Twitter](https://twitter.com/dify_ai). Lo mejor para: compartir tus aplicaciones y pasar el rato con la comunidad.
+* [X(Twitter)](https://twitter.com/dify_ai). Lo mejor para: compartir tus aplicaciones y pasar el rato con la comunidad.
## Historial de Estrellas
diff --git a/README_FR.md b/README_FR.md
index da8b7baa3e..15f6f2650f 100644
--- a/README_FR.md
+++ b/README_FR.md
@@ -17,7 +17,7 @@
alt="chat sur Discord">
+ alt="suivre sur X(Twitter)">
@@ -229,7 +229,7 @@ Dans le même temps, veuillez envisager de soutenir Dify en le partageant sur le
* [Discussion GitHub](https://github.com/langgenius/dify/discussions). Meilleur pour: partager des commentaires et poser des questions.
* [Problèmes GitHub](https://github.com/langgenius/dify/issues). Meilleur pour: les bogues que vous rencontrez en utilisant Dify.AI et les propositions de fonctionnalités. Consultez notre [Guide de contribution](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md).
* [Discord](https://discord.gg/FngNHpbcY7). Meilleur pour: partager vos applications et passer du temps avec la communauté.
-* [Twitter](https://twitter.com/dify_ai). Meilleur pour: partager vos applications et passer du temps avec la communauté.
+* [X(Twitter)](https://twitter.com/dify_ai). Meilleur pour: partager vos applications et passer du temps avec la communauté.
## Historique des étoiles
diff --git a/README_JA.md b/README_JA.md
index 8c6076362b..a2e6b173f5 100644
--- a/README_JA.md
+++ b/README_JA.md
@@ -17,7 +17,7 @@
alt="Discordでチャット">
+ alt="X(Twitter)でフォロー">
@@ -228,7 +228,7 @@ docker compose up -d
* [Github Discussion](https://github.com/langgenius/dify/discussions). 主に: フィードバックの共有や質問。
* [GitHub Issues](https://github.com/langgenius/dify/issues). 主に: Dify.AIを使用する際に発生するエラーや問題については、[貢献ガイド](CONTRIBUTING_JA.md)を参照してください
* [Discord](https://discord.gg/FngNHpbcY7). 主に: アプリケーションの共有やコミュニティとの交流。
-* [Twitter](https://twitter.com/dify_ai). 主に: アプリケーションの共有やコミュニティとの交流。
+* [X(Twitter)](https://twitter.com/dify_ai). 主に: アプリケーションの共有やコミュニティとの交流。
diff --git a/README_KL.md b/README_KL.md
index ce2f78570b..8f2affdce5 100644
--- a/README_KL.md
+++ b/README_KL.md
@@ -17,7 +17,7 @@
alt="chat on Discord">
+ alt="follow on X(Twitter)">
@@ -231,7 +231,7 @@ At the same time, please consider supporting Dify by sharing it on social media
). Best for: sharing feedback and asking questions.
* [GitHub Issues](https://github.com/langgenius/dify/issues). Best for: bugs you encounter using Dify.AI, and feature proposals. See our [Contribution Guide](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md).
* [Discord](https://discord.gg/FngNHpbcY7). Best for: sharing your applications and hanging out with the community.
-* [Twitter](https://twitter.com/dify_ai). Best for: sharing your applications and hanging out with the community.
+* [X(Twitter)](https://twitter.com/dify_ai). Best for: sharing your applications and hanging out with the community.
## Star History
diff --git a/README_KR.md b/README_KR.md
index 87409bfb8c..6c3a9ed7f6 100644
--- a/README_KR.md
+++ b/README_KR.md
@@ -17,7 +17,7 @@
alt="chat on Discord">
+ alt="follow on X(Twitter)">
diff --git a/README_TR.md b/README_TR.md
index 08080a8c7b..a75889e576 100644
--- a/README_TR.md
+++ b/README_TR.md
@@ -17,7 +17,7 @@
alt="Discord'da sohbet et">
+ alt="X(Twitter)'da takip et">
@@ -226,7 +226,7 @@ Aynı zamanda, lütfen Dify'ı sosyal medyada, etkinliklerde ve konferanslarda p
* [Github Tartışmaları](https://github.com/langgenius/dify/discussions). En uygun: geri bildirim paylaşmak ve soru sormak için.
* [GitHub Sorunları](https://github.com/langgenius/dify/issues). En uygun: Dify.AI kullanırken karşılaştığınız hatalar ve özellik önerileri için. [Katkı Kılavuzumuza](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md) bakın.
* [Discord](https://discord.gg/FngNHpbcY7). En uygun: uygulamalarınızı paylaşmak ve toplulukla vakit geçirmek için.
-* [Twitter](https://twitter.com/dify_ai). En uygun: uygulamalarınızı paylaşmak ve toplulukla vakit geçirmek için.
+* [X(Twitter)](https://twitter.com/dify_ai). En uygun: uygulamalarınızı paylaşmak ve toplulukla vakit geçirmek için.
## Star history
diff --git a/README_VI.md b/README_VI.md
index d67f024c79..8d49e49766 100644
--- a/README_VI.md
+++ b/README_VI.md
@@ -17,7 +17,7 @@
alt="chat trên Discord">
+ alt="theo dõi trên X(Twitter)">
@@ -223,7 +223,7 @@ Triển khai Dify lên nền tảng đám mây với một cú nhấp chuột b
* [Thảo luận GitHub](https://github.com/langgenius/dify/discussions). Tốt nhất cho: chia sẻ phản hồi và đặt câu hỏi.
* [Vấn đề GitHub](https://github.com/langgenius/dify/issues). Tốt nhất cho: lỗi bạn gặp phải khi sử dụng Dify.AI và đề xuất tính năng. Xem [Hướng dẫn Đóng góp](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md) của chúng tôi.
* [Discord](https://discord.gg/FngNHpbcY7). Tốt nhất cho: chia sẻ ứng dụng của bạn và giao lưu với cộng đồng.
-* [Twitter](https://twitter.com/dify_ai). Tốt nhất cho: chia sẻ ứng dụng của bạn và giao lưu với cộng đồng.
+* [X(Twitter)](https://twitter.com/dify_ai). Tốt nhất cho: chia sẻ ứng dụng của bạn và giao lưu với cộng đồng.
## Lịch sử Yêu thích
From fc60b554a1c3d1767608bb7d54a61b769ac49fa6 Mon Sep 17 00:00:00 2001
From: Ziyu Huang
Date: Thu, 10 Oct 2024 15:18:07 +0800
Subject: [PATCH 38/61] Fixes #9159: Modify to make it works to llama.cpp
rerank API (#9160)
---
.../model_providers/jina/rerank/rerank.py | 12 ++++++++++--
.../model_providers/localai/rerank/rerank.py | 12 ++++++++++--
2 files changed, 20 insertions(+), 4 deletions(-)
diff --git a/api/core/model_runtime/model_providers/jina/rerank/rerank.py b/api/core/model_runtime/model_providers/jina/rerank/rerank.py
index 79ca68914f..0350207651 100644
--- a/api/core/model_runtime/model_providers/jina/rerank/rerank.py
+++ b/api/core/model_runtime/model_providers/jina/rerank/rerank.py
@@ -61,11 +61,19 @@ class JinaRerankModel(RerankModel):
rerank_documents = []
for result in results["results"]:
+ index = result["index"]
+ if "document" in result:
+ text = result["document"]["text"]
+ else:
+ # llama.cpp rerank maynot return original documents
+ text = docs[index]
+
rerank_document = RerankDocument(
- index=result["index"],
- text=result["document"]["text"],
+ index=index,
+ text=text,
score=result["relevance_score"],
)
+
if score_threshold is None or result["relevance_score"] >= score_threshold:
rerank_documents.append(rerank_document)
diff --git a/api/core/model_runtime/model_providers/localai/rerank/rerank.py b/api/core/model_runtime/model_providers/localai/rerank/rerank.py
index 2b0f53bc19..075b44658d 100644
--- a/api/core/model_runtime/model_providers/localai/rerank/rerank.py
+++ b/api/core/model_runtime/model_providers/localai/rerank/rerank.py
@@ -70,11 +70,19 @@ class LocalaiRerankModel(RerankModel):
rerank_documents = []
for result in results["results"]:
+ index = result["index"]
+ if "document" in result:
+ text = result["document"]["text"]
+ else:
+ # llama.cpp rerank maynot return original documents
+ text = docs[index]
+
rerank_document = RerankDocument(
- index=result["index"],
- text=result["document"]["text"],
+ index=index,
+ text=text,
score=result["relevance_score"],
)
+
if score_threshold is None or result["relevance_score"] >= score_threshold:
rerank_documents.append(rerank_document)
From 6b6e94da0822f8aebc4d95bffd0b536ac2152579 Mon Sep 17 00:00:00 2001
From: "Charlie.Wei"
Date: Thu, 10 Oct 2024 15:26:38 +0800
Subject: [PATCH 39/61] Fix code indentation errors (#9164)
---
.../model_providers/azure_openai/llm/llm.py | 56 +++++++++----------
1 file changed, 28 insertions(+), 28 deletions(-)
diff --git a/api/core/model_runtime/model_providers/azure_openai/llm/llm.py b/api/core/model_runtime/model_providers/azure_openai/llm/llm.py
index f63c80e58e..b9cc3bb672 100644
--- a/api/core/model_runtime/model_providers/azure_openai/llm/llm.py
+++ b/api/core/model_runtime/model_providers/azure_openai/llm/llm.py
@@ -312,39 +312,39 @@ class AzureOpenAILargeLanguageModel(_CommonAzureOpenAI, LargeLanguageModel):
if user:
extra_model_kwargs["user"] = user
- # clear illegal prompt messages
- prompt_messages = self._clear_illegal_prompt_messages(model, prompt_messages)
-
- block_as_stream = False
- if model.startswith("o1"):
- if stream:
- block_as_stream = True
- stream = False
-
- if "stream_options" in extra_model_kwargs:
- del extra_model_kwargs["stream_options"]
-
- if "stop" in extra_model_kwargs:
- del extra_model_kwargs["stop"]
-
- # chat model
- response = client.chat.completions.create(
- messages=[self._convert_prompt_message_to_dict(m) for m in prompt_messages],
- model=model,
- stream=stream,
- **model_parameters,
- **extra_model_kwargs,
- )
+ # clear illegal prompt messages
+ prompt_messages = self._clear_illegal_prompt_messages(model, prompt_messages)
+ block_as_stream = False
+ if model.startswith("o1"):
if stream:
- return self._handle_chat_generate_stream_response(model, credentials, response, prompt_messages, tools)
+ block_as_stream = True
+ stream = False
+
+ if "stream_options" in extra_model_kwargs:
+ del extra_model_kwargs["stream_options"]
+
+ if "stop" in extra_model_kwargs:
+ del extra_model_kwargs["stop"]
+
+ # chat model
+ response = client.chat.completions.create(
+ messages=[self._convert_prompt_message_to_dict(m) for m in prompt_messages],
+ model=model,
+ stream=stream,
+ **model_parameters,
+ **extra_model_kwargs,
+ )
+
+ if stream:
+ return self._handle_chat_generate_stream_response(model, credentials, response, prompt_messages, tools)
- block_result = self._handle_chat_generate_response(model, credentials, response, prompt_messages, tools)
+ block_result = self._handle_chat_generate_response(model, credentials, response, prompt_messages, tools)
- if block_as_stream:
- return self._handle_chat_block_as_stream_response(block_result, prompt_messages, stop)
+ if block_as_stream:
+ return self._handle_chat_block_as_stream_response(block_result, prompt_messages, stop)
- return block_result
+ return block_result
def _handle_chat_block_as_stream_response(
self,
From 6689b592ff404bad10e2ca27a288b43b707b0208 Mon Sep 17 00:00:00 2001
From: Yi Xiao <54782454+YIXIAO0@users.noreply.github.com>
Date: Thu, 10 Oct 2024 15:48:26 +0800
Subject: [PATCH 40/61] fix: delete offline "how to write a good knowledge
description" helper (#9165)
---
.../create/KnowledgeBaseInfo.tsx | 12 ------------
web/app/components/datasets/rename-modal/index.tsx | 5 -----
web/app/components/datasets/settings/form/index.tsx | 5 -----
3 files changed, 22 deletions(-)
diff --git a/web/app/components/datasets/external-knowledge-base/create/KnowledgeBaseInfo.tsx b/web/app/components/datasets/external-knowledge-base/create/KnowledgeBaseInfo.tsx
index 1a2e83d2d6..fec526b881 100644
--- a/web/app/components/datasets/external-knowledge-base/create/KnowledgeBaseInfo.tsx
+++ b/web/app/components/datasets/external-knowledge-base/create/KnowledgeBaseInfo.tsx
@@ -1,5 +1,4 @@
import React from 'react'
-import { RiBookOpenLine } from '@remixicon/react'
import { useTranslation } from 'react-i18next'
import Input from '@/app/components/base/input'
@@ -44,17 +43,6 @@ const KnowledgeBaseInfo: React.FC = ({ name, description
placeholder={t('dataset.externalKnowledgeDescriptionPlaceholder') ?? ''}
className={`flex h-20 py-2 p-3 self-stretch items-start rounded-lg bg-components-input-bg-normal ${description ? 'text-components-input-text-filled' : 'text-components-input-text-placeholder'} system-sm-regular`}
/>
-
-
-
-
- {t('dataset.learnHowToWriteGoodKnowledgeDescription')}
-
diff --git a/web/app/components/datasets/rename-modal/index.tsx b/web/app/components/datasets/rename-modal/index.tsx
index 7e5fb228f7..7d6008c087 100644
--- a/web/app/components/datasets/rename-modal/index.tsx
+++ b/web/app/components/datasets/rename-modal/index.tsx
@@ -3,7 +3,6 @@
import type { MouseEventHandler } from 'react'
import { useState } from 'react'
import { RiCloseLine } from '@remixicon/react'
-import { BookOpenIcon } from '@heroicons/react/24/outline'
import { useContext } from 'use-context-selector'
import { useTranslation } from 'react-i18next'
import cn from '@/utils/classnames'
@@ -94,10 +93,6 @@ const RenameDatasetModal = ({ show, dataset, onSuccess, onClose }: RenameDataset
className='block px-3 py-2 w-full h-[88px] rounded-lg bg-gray-100 text-sm outline-none appearance-none resize-none'
placeholder={t('datasetSettings.form.descPlaceholder') || ''}
/>
-
-
- {t('datasetSettings.form.descWrite')}
-
diff --git a/web/app/components/datasets/settings/form/index.tsx b/web/app/components/datasets/settings/form/index.tsx
index a3b6e79c3b..0bdfa3c5c8 100644
--- a/web/app/components/datasets/settings/form/index.tsx
+++ b/web/app/components/datasets/settings/form/index.tsx
@@ -2,7 +2,6 @@
import { useState } from 'react'
import { useMount } from 'ahooks'
import { useContext } from 'use-context-selector'
-import { BookOpenIcon } from '@heroicons/react/24/outline'
import { useTranslation } from 'react-i18next'
import { useSWRConfig } from 'swr'
import { unstable_serialize } from 'swr/infinite'
@@ -208,10 +207,6 @@ const Form = () => {
value={description}
onChange={e => setDescription(e.target.value)}
/>
-
-
- {t('datasetSettings.form.descWrite')}
-
From 477beae3bb0c288574e85705f6e06699cc7f3bc4 Mon Sep 17 00:00:00 2001
From: takatost
Date: Thu, 10 Oct 2024 16:34:06 +0800
Subject: [PATCH 41/61] fix: missing usage of metadata in the chatflow app
(#9167)
---
api/core/app/apps/advanced_chat/generate_task_pipeline.py | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/api/core/app/apps/advanced_chat/generate_task_pipeline.py b/api/core/app/apps/advanced_chat/generate_task_pipeline.py
index 5ce25ebf28..6bf684f8e4 100644
--- a/api/core/app/apps/advanced_chat/generate_task_pipeline.py
+++ b/api/core/app/apps/advanced_chat/generate_task_pipeline.py
@@ -45,6 +45,7 @@ from core.app.entities.task_entities import (
from core.app.task_pipeline.based_generate_task_pipeline import BasedGenerateTaskPipeline
from core.app.task_pipeline.message_cycle_manage import MessageCycleManage
from core.app.task_pipeline.workflow_cycle_manage import WorkflowCycleManage
+from core.model_runtime.entities.llm_entities import LLMUsage
from core.model_runtime.utils.encoders import jsonable_encoder
from core.ops.ops_trace_manager import TraceQueueManager
from core.workflow.enums import SystemVariableKey
@@ -509,6 +510,10 @@ class AdvancedChatAppGenerateTaskPipeline(BasedGenerateTaskPipeline, WorkflowCyc
self._message.total_price = usage.total_price
self._message.currency = usage.currency
+ self._task_state.metadata["usage"] = jsonable_encoder(usage)
+ else:
+ self._task_state.metadata["usage"] = jsonable_encoder(LLMUsage.empty_usage())
+
db.session.commit()
message_was_created.send(
From 68107fe3554a7af28622fc379eaf7016a78115bb Mon Sep 17 00:00:00 2001
From: Jyong <76649700+JohnJyong@users.noreply.github.com>
Date: Thu, 10 Oct 2024 16:43:11 +0800
Subject: [PATCH 42/61] downgrade elastic to 8.14 (#9171)
---
api/poetry.lock | 530 ++++++++++++++++++-------------------
api/pyproject.toml | 2 +-
docker/docker-compose.yaml | 4 +-
3 files changed, 264 insertions(+), 272 deletions(-)
diff --git a/api/poetry.lock b/api/poetry.lock
index 6b96350ffd..a63200caca 100644
--- a/api/poetry.lock
+++ b/api/poetry.lock
@@ -293,13 +293,13 @@ alibabacloud-tea = "*"
[[package]]
name = "alibabacloud-tea"
-version = "0.3.10"
+version = "0.4.0"
description = "The tea module of alibabaCloud Python SDK."
optional = false
-python-versions = ">=3.6"
+python-versions = ">=3.7"
files = [
- {file = "alibabacloud-tea-0.3.10.tar.gz", hash = "sha256:bcf972416af5d8b5e671078c2ec20296dbc792e85e68acd685730a0a016afd2a"},
- {file = "alibabacloud_tea-0.3.10-py3-none-any.whl", hash = "sha256:9136f302a3baea8a1528f500bf5d47c3727b827a09b5c14b283ca53578e30082"},
+ {file = "alibabacloud-tea-0.4.0.tar.gz", hash = "sha256:bdf72d747723bab190331b3c8593109fe2807504469bc0147f78c8c4945ed396"},
+ {file = "alibabacloud_tea-0.4.0-py3-none-any.whl", hash = "sha256:59fae5765e6654f884e130233df6fb61ca0fbe01a29ed0755a1cf099a3d4d863"},
]
[package.dependencies]
@@ -364,12 +364,12 @@ alibabacloud-tea = ">=0.0.1"
[[package]]
name = "aliyun-python-sdk-core"
-version = "2.15.2"
+version = "2.16.0"
description = "The core module of Aliyun Python SDK."
optional = false
-python-versions = "*"
+python-versions = ">=3.7"
files = [
- {file = "aliyun-python-sdk-core-2.15.2.tar.gz", hash = "sha256:54f66a53e193c61c5e16ea4505a0cab43543f8ad2ef22833f69c4d5e5151c17d"},
+ {file = "aliyun-python-sdk-core-2.16.0.tar.gz", hash = "sha256:651caad597eb39d4fad6cf85133dffe92837d53bdf62db9d8f37dab6508bb8f9"},
]
[package.dependencies]
@@ -698,13 +698,13 @@ msrest = ">=0.6.21"
[[package]]
name = "azure-storage-file-share"
-version = "12.18.0"
+version = "12.19.0"
description = "Microsoft Azure Azure File Share Storage Client Library for Python"
optional = false
python-versions = ">=3.8"
files = [
- {file = "azure_storage_file_share-12.18.0-py3-none-any.whl", hash = "sha256:23ca35206a0cb8af0decd9d1363d0ad8ab31584a5e55cfc64528d7192ff748a9"},
- {file = "azure_storage_file_share-12.18.0.tar.gz", hash = "sha256:0a81daee5e13598accde3c73b1aeccc6edfdcec5e957bf40150c0622fb95dc76"},
+ {file = "azure_storage_file_share-12.19.0-py3-none-any.whl", hash = "sha256:eac6cf1a454aba58af4e6ba450b36d16aa1d0c49679fb64ea8756bb896698c5b"},
+ {file = "azure_storage_file_share-12.19.0.tar.gz", hash = "sha256:ea7a4174dc6c52f50ac8c30f228159fcc3675d1f8ba771b8d0efcbc310740278"},
]
[package.dependencies]
@@ -844,13 +844,13 @@ crt = ["botocore[crt] (>=1.21.0,<2.0a0)"]
[[package]]
name = "botocore"
-version = "1.35.34"
+version = "1.35.37"
description = "Low-level, data-driven core of boto 3."
optional = false
python-versions = ">=3.8"
files = [
- {file = "botocore-1.35.34-py3-none-any.whl", hash = "sha256:ccb0fe397b11b81c9abc0c87029d17298e17bf658d8db5c0c5a551a12a207e7a"},
- {file = "botocore-1.35.34.tar.gz", hash = "sha256:789b6501a3bb4a9591c1fe10da200cc315c1fa5df5ada19c720d8ef06439b3e3"},
+ {file = "botocore-1.35.37-py3-none-any.whl", hash = "sha256:64f965d4ba7adb8d79ce044c3aef7356e05dd74753cf7e9115b80f477845d920"},
+ {file = "botocore-1.35.37.tar.gz", hash = "sha256:b2b4d29bafd95b698344f2f0577bb67064adbf1735d8a0e3c7473daa59c23ba6"},
]
[package.dependencies]
@@ -1257,101 +1257,116 @@ files = [
[[package]]
name = "charset-normalizer"
-version = "3.3.2"
+version = "3.4.0"
description = "The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet."
optional = false
python-versions = ">=3.7.0"
files = [
- {file = "charset-normalizer-3.3.2.tar.gz", hash = "sha256:f30c3cb33b24454a82faecaf01b19c18562b1e89558fb6c56de4d9118a032fd5"},
- {file = "charset_normalizer-3.3.2-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:25baf083bf6f6b341f4121c2f3c548875ee6f5339300e08be3f2b2ba1721cdd3"},
- {file = "charset_normalizer-3.3.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:06435b539f889b1f6f4ac1758871aae42dc3a8c0e24ac9e60c2384973ad73027"},
- {file = "charset_normalizer-3.3.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:9063e24fdb1e498ab71cb7419e24622516c4a04476b17a2dab57e8baa30d6e03"},
- {file = "charset_normalizer-3.3.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6897af51655e3691ff853668779c7bad41579facacf5fd7253b0133308cf000d"},
- {file = "charset_normalizer-3.3.2-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1d3193f4a680c64b4b6a9115943538edb896edc190f0b222e73761716519268e"},
- {file = "charset_normalizer-3.3.2-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:cd70574b12bb8a4d2aaa0094515df2463cb429d8536cfb6c7ce983246983e5a6"},
- {file = "charset_normalizer-3.3.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8465322196c8b4d7ab6d1e049e4c5cb460d0394da4a27d23cc242fbf0034b6b5"},
- {file = "charset_normalizer-3.3.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a9a8e9031d613fd2009c182b69c7b2c1ef8239a0efb1df3f7c8da66d5dd3d537"},
- {file = "charset_normalizer-3.3.2-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:beb58fe5cdb101e3a055192ac291b7a21e3b7ef4f67fa1d74e331a7f2124341c"},
- {file = "charset_normalizer-3.3.2-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:e06ed3eb3218bc64786f7db41917d4e686cc4856944f53d5bdf83a6884432e12"},
- {file = "charset_normalizer-3.3.2-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:2e81c7b9c8979ce92ed306c249d46894776a909505d8f5a4ba55b14206e3222f"},
- {file = "charset_normalizer-3.3.2-cp310-cp310-musllinux_1_1_s390x.whl", hash = "sha256:572c3763a264ba47b3cf708a44ce965d98555f618ca42c926a9c1616d8f34269"},
- {file = "charset_normalizer-3.3.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:fd1abc0d89e30cc4e02e4064dc67fcc51bd941eb395c502aac3ec19fab46b519"},
- {file = "charset_normalizer-3.3.2-cp310-cp310-win32.whl", hash = "sha256:3d47fa203a7bd9c5b6cee4736ee84ca03b8ef23193c0d1ca99b5089f72645c73"},
- {file = "charset_normalizer-3.3.2-cp310-cp310-win_amd64.whl", hash = "sha256:10955842570876604d404661fbccbc9c7e684caf432c09c715ec38fbae45ae09"},
- {file = "charset_normalizer-3.3.2-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:802fe99cca7457642125a8a88a084cef28ff0cf9407060f7b93dca5aa25480db"},
- {file = "charset_normalizer-3.3.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:573f6eac48f4769d667c4442081b1794f52919e7edada77495aaed9236d13a96"},
- {file = "charset_normalizer-3.3.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:549a3a73da901d5bc3ce8d24e0600d1fa85524c10287f6004fbab87672bf3e1e"},
- {file = "charset_normalizer-3.3.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f27273b60488abe721a075bcca6d7f3964f9f6f067c8c4c605743023d7d3944f"},
- {file = "charset_normalizer-3.3.2-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1ceae2f17a9c33cb48e3263960dc5fc8005351ee19db217e9b1bb15d28c02574"},
- {file = "charset_normalizer-3.3.2-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:65f6f63034100ead094b8744b3b97965785388f308a64cf8d7c34f2f2e5be0c4"},
- {file = "charset_normalizer-3.3.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:753f10e867343b4511128c6ed8c82f7bec3bd026875576dfd88483c5c73b2fd8"},
- {file = "charset_normalizer-3.3.2-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4a78b2b446bd7c934f5dcedc588903fb2f5eec172f3d29e52a9096a43722adfc"},
- {file = "charset_normalizer-3.3.2-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:e537484df0d8f426ce2afb2d0f8e1c3d0b114b83f8850e5f2fbea0e797bd82ae"},
- {file = "charset_normalizer-3.3.2-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:eb6904c354526e758fda7167b33005998fb68c46fbc10e013ca97f21ca5c8887"},
- {file = "charset_normalizer-3.3.2-cp311-cp311-musllinux_1_1_ppc64le.whl", hash = "sha256:deb6be0ac38ece9ba87dea880e438f25ca3eddfac8b002a2ec3d9183a454e8ae"},
- {file = "charset_normalizer-3.3.2-cp311-cp311-musllinux_1_1_s390x.whl", hash = "sha256:4ab2fe47fae9e0f9dee8c04187ce5d09f48eabe611be8259444906793ab7cbce"},
- {file = "charset_normalizer-3.3.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:80402cd6ee291dcb72644d6eac93785fe2c8b9cb30893c1af5b8fdd753b9d40f"},
- {file = "charset_normalizer-3.3.2-cp311-cp311-win32.whl", hash = "sha256:7cd13a2e3ddeed6913a65e66e94b51d80a041145a026c27e6bb76c31a853c6ab"},
- {file = "charset_normalizer-3.3.2-cp311-cp311-win_amd64.whl", hash = "sha256:663946639d296df6a2bb2aa51b60a2454ca1cb29835324c640dafb5ff2131a77"},
- {file = "charset_normalizer-3.3.2-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:0b2b64d2bb6d3fb9112bafa732def486049e63de9618b5843bcdd081d8144cd8"},
- {file = "charset_normalizer-3.3.2-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:ddbb2551d7e0102e7252db79ba445cdab71b26640817ab1e3e3648dad515003b"},
- {file = "charset_normalizer-3.3.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:55086ee1064215781fff39a1af09518bc9255b50d6333f2e4c74ca09fac6a8f6"},
- {file = "charset_normalizer-3.3.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8f4a014bc36d3c57402e2977dada34f9c12300af536839dc38c0beab8878f38a"},
- {file = "charset_normalizer-3.3.2-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a10af20b82360ab00827f916a6058451b723b4e65030c5a18577c8b2de5b3389"},
- {file = "charset_normalizer-3.3.2-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:8d756e44e94489e49571086ef83b2bb8ce311e730092d2c34ca8f7d925cb20aa"},
- {file = "charset_normalizer-3.3.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:90d558489962fd4918143277a773316e56c72da56ec7aa3dc3dbbe20fdfed15b"},
- {file = "charset_normalizer-3.3.2-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6ac7ffc7ad6d040517be39eb591cac5ff87416c2537df6ba3cba3bae290c0fed"},
- {file = "charset_normalizer-3.3.2-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:7ed9e526742851e8d5cc9e6cf41427dfc6068d4f5a3bb03659444b4cabf6bc26"},
- {file = "charset_normalizer-3.3.2-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:8bdb58ff7ba23002a4c5808d608e4e6c687175724f54a5dade5fa8c67b604e4d"},
- {file = "charset_normalizer-3.3.2-cp312-cp312-musllinux_1_1_ppc64le.whl", hash = "sha256:6b3251890fff30ee142c44144871185dbe13b11bab478a88887a639655be1068"},
- {file = "charset_normalizer-3.3.2-cp312-cp312-musllinux_1_1_s390x.whl", hash = "sha256:b4a23f61ce87adf89be746c8a8974fe1c823c891d8f86eb218bb957c924bb143"},
- {file = "charset_normalizer-3.3.2-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:efcb3f6676480691518c177e3b465bcddf57cea040302f9f4e6e191af91174d4"},
- {file = "charset_normalizer-3.3.2-cp312-cp312-win32.whl", hash = "sha256:d965bba47ddeec8cd560687584e88cf699fd28f192ceb452d1d7ee807c5597b7"},
- {file = "charset_normalizer-3.3.2-cp312-cp312-win_amd64.whl", hash = "sha256:96b02a3dc4381e5494fad39be677abcb5e6634bf7b4fa83a6dd3112607547001"},
- {file = "charset_normalizer-3.3.2-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:95f2a5796329323b8f0512e09dbb7a1860c46a39da62ecb2324f116fa8fdc85c"},
- {file = "charset_normalizer-3.3.2-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c002b4ffc0be611f0d9da932eb0f704fe2602a9a949d1f738e4c34c75b0863d5"},
- {file = "charset_normalizer-3.3.2-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a981a536974bbc7a512cf44ed14938cf01030a99e9b3a06dd59578882f06f985"},
- {file = "charset_normalizer-3.3.2-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:3287761bc4ee9e33561a7e058c72ac0938c4f57fe49a09eae428fd88aafe7bb6"},
- {file = "charset_normalizer-3.3.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:42cb296636fcc8b0644486d15c12376cb9fa75443e00fb25de0b8602e64c1714"},
- {file = "charset_normalizer-3.3.2-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0a55554a2fa0d408816b3b5cedf0045f4b8e1a6065aec45849de2d6f3f8e9786"},
- {file = "charset_normalizer-3.3.2-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:c083af607d2515612056a31f0a8d9e0fcb5876b7bfc0abad3ecd275bc4ebc2d5"},
- {file = "charset_normalizer-3.3.2-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:87d1351268731db79e0f8e745d92493ee2841c974128ef629dc518b937d9194c"},
- {file = "charset_normalizer-3.3.2-cp37-cp37m-musllinux_1_1_ppc64le.whl", hash = "sha256:bd8f7df7d12c2db9fab40bdd87a7c09b1530128315d047a086fa3ae3435cb3a8"},
- {file = "charset_normalizer-3.3.2-cp37-cp37m-musllinux_1_1_s390x.whl", hash = "sha256:c180f51afb394e165eafe4ac2936a14bee3eb10debc9d9e4db8958fe36afe711"},
- {file = "charset_normalizer-3.3.2-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:8c622a5fe39a48f78944a87d4fb8a53ee07344641b0562c540d840748571b811"},
- {file = "charset_normalizer-3.3.2-cp37-cp37m-win32.whl", hash = "sha256:db364eca23f876da6f9e16c9da0df51aa4f104a972735574842618b8c6d999d4"},
- {file = "charset_normalizer-3.3.2-cp37-cp37m-win_amd64.whl", hash = "sha256:86216b5cee4b06df986d214f664305142d9c76df9b6512be2738aa72a2048f99"},
- {file = "charset_normalizer-3.3.2-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:6463effa3186ea09411d50efc7d85360b38d5f09b870c48e4600f63af490e56a"},
- {file = "charset_normalizer-3.3.2-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:6c4caeef8fa63d06bd437cd4bdcf3ffefe6738fb1b25951440d80dc7df8c03ac"},
- {file = "charset_normalizer-3.3.2-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:37e55c8e51c236f95b033f6fb391d7d7970ba5fe7ff453dad675e88cf303377a"},
- {file = "charset_normalizer-3.3.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:fb69256e180cb6c8a894fee62b3afebae785babc1ee98b81cdf68bbca1987f33"},
- {file = "charset_normalizer-3.3.2-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ae5f4161f18c61806f411a13b0310bea87f987c7d2ecdbdaad0e94eb2e404238"},
- {file = "charset_normalizer-3.3.2-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b2b0a0c0517616b6869869f8c581d4eb2dd83a4d79e0ebcb7d373ef9956aeb0a"},
- {file = "charset_normalizer-3.3.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:45485e01ff4d3630ec0d9617310448a8702f70e9c01906b0d0118bdf9d124cf2"},
- {file = "charset_normalizer-3.3.2-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:eb00ed941194665c332bf8e078baf037d6c35d7c4f3102ea2d4f16ca94a26dc8"},
- {file = "charset_normalizer-3.3.2-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:2127566c664442652f024c837091890cb1942c30937add288223dc895793f898"},
- {file = "charset_normalizer-3.3.2-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:a50aebfa173e157099939b17f18600f72f84eed3049e743b68ad15bd69b6bf99"},
- {file = "charset_normalizer-3.3.2-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:4d0d1650369165a14e14e1e47b372cfcb31d6ab44e6e33cb2d4e57265290044d"},
- {file = "charset_normalizer-3.3.2-cp38-cp38-musllinux_1_1_s390x.whl", hash = "sha256:923c0c831b7cfcb071580d3f46c4baf50f174be571576556269530f4bbd79d04"},
- {file = "charset_normalizer-3.3.2-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:06a81e93cd441c56a9b65d8e1d043daeb97a3d0856d177d5c90ba85acb3db087"},
- {file = "charset_normalizer-3.3.2-cp38-cp38-win32.whl", hash = "sha256:6ef1d82a3af9d3eecdba2321dc1b3c238245d890843e040e41e470ffa64c3e25"},
- {file = "charset_normalizer-3.3.2-cp38-cp38-win_amd64.whl", hash = "sha256:eb8821e09e916165e160797a6c17edda0679379a4be5c716c260e836e122f54b"},
- {file = "charset_normalizer-3.3.2-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:c235ebd9baae02f1b77bcea61bce332cb4331dc3617d254df3323aa01ab47bd4"},
- {file = "charset_normalizer-3.3.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:5b4c145409bef602a690e7cfad0a15a55c13320ff7a3ad7ca59c13bb8ba4d45d"},
- {file = "charset_normalizer-3.3.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:68d1f8a9e9e37c1223b656399be5d6b448dea850bed7d0f87a8311f1ff3dabb0"},
- {file = "charset_normalizer-3.3.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:22afcb9f253dac0696b5a4be4a1c0f8762f8239e21b99680099abd9b2b1b2269"},
- {file = "charset_normalizer-3.3.2-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e27ad930a842b4c5eb8ac0016b0a54f5aebbe679340c26101df33424142c143c"},
- {file = "charset_normalizer-3.3.2-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:1f79682fbe303db92bc2b1136016a38a42e835d932bab5b3b1bfcfbf0640e519"},
- {file = "charset_normalizer-3.3.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b261ccdec7821281dade748d088bb6e9b69e6d15b30652b74cbbac25e280b796"},
- {file = "charset_normalizer-3.3.2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:122c7fa62b130ed55f8f285bfd56d5f4b4a5b503609d181f9ad85e55c89f4185"},
- {file = "charset_normalizer-3.3.2-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:d0eccceffcb53201b5bfebb52600a5fb483a20b61da9dbc885f8b103cbe7598c"},
- {file = "charset_normalizer-3.3.2-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:9f96df6923e21816da7e0ad3fd47dd8f94b2a5ce594e00677c0013018b813458"},
- {file = "charset_normalizer-3.3.2-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:7f04c839ed0b6b98b1a7501a002144b76c18fb1c1850c8b98d458ac269e26ed2"},
- {file = "charset_normalizer-3.3.2-cp39-cp39-musllinux_1_1_s390x.whl", hash = "sha256:34d1c8da1e78d2e001f363791c98a272bb734000fcef47a491c1e3b0505657a8"},
- {file = "charset_normalizer-3.3.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:ff8fa367d09b717b2a17a052544193ad76cd49979c805768879cb63d9ca50561"},
- {file = "charset_normalizer-3.3.2-cp39-cp39-win32.whl", hash = "sha256:aed38f6e4fb3f5d6bf81bfa990a07806be9d83cf7bacef998ab1a9bd660a581f"},
- {file = "charset_normalizer-3.3.2-cp39-cp39-win_amd64.whl", hash = "sha256:b01b88d45a6fcb69667cd6d2f7a9aeb4bf53760d7fc536bf679ec94fe9f3ff3d"},
- {file = "charset_normalizer-3.3.2-py3-none-any.whl", hash = "sha256:3e4d1f6587322d2788836a99c69062fbb091331ec940e02d12d179c1d53e25fc"},
+ {file = "charset_normalizer-3.4.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:4f9fc98dad6c2eaa32fc3af1417d95b5e3d08aff968df0cd320066def971f9a6"},
+ {file = "charset_normalizer-3.4.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:0de7b687289d3c1b3e8660d0741874abe7888100efe14bd0f9fd7141bcbda92b"},
+ {file = "charset_normalizer-3.4.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:5ed2e36c3e9b4f21dd9422f6893dec0abf2cca553af509b10cd630f878d3eb99"},
+ {file = "charset_normalizer-3.4.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:40d3ff7fc90b98c637bda91c89d51264a3dcf210cade3a2c6f838c7268d7a4ca"},
+ {file = "charset_normalizer-3.4.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1110e22af8ca26b90bd6364fe4c763329b0ebf1ee213ba32b68c73de5752323d"},
+ {file = "charset_normalizer-3.4.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:86f4e8cca779080f66ff4f191a685ced73d2f72d50216f7112185dc02b90b9b7"},
+ {file = "charset_normalizer-3.4.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7f683ddc7eedd742e2889d2bfb96d69573fde1d92fcb811979cdb7165bb9c7d3"},
+ {file = "charset_normalizer-3.4.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:27623ba66c183eca01bf9ff833875b459cad267aeeb044477fedac35e19ba907"},
+ {file = "charset_normalizer-3.4.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:f606a1881d2663630ea5b8ce2efe2111740df4b687bd78b34a8131baa007f79b"},
+ {file = "charset_normalizer-3.4.0-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:0b309d1747110feb25d7ed6b01afdec269c647d382c857ef4663bbe6ad95a912"},
+ {file = "charset_normalizer-3.4.0-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:136815f06a3ae311fae551c3df1f998a1ebd01ddd424aa5603a4336997629e95"},
+ {file = "charset_normalizer-3.4.0-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:14215b71a762336254351b00ec720a8e85cada43b987da5a042e4ce3e82bd68e"},
+ {file = "charset_normalizer-3.4.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:79983512b108e4a164b9c8d34de3992f76d48cadc9554c9e60b43f308988aabe"},
+ {file = "charset_normalizer-3.4.0-cp310-cp310-win32.whl", hash = "sha256:c94057af19bc953643a33581844649a7fdab902624d2eb739738a30e2b3e60fc"},
+ {file = "charset_normalizer-3.4.0-cp310-cp310-win_amd64.whl", hash = "sha256:55f56e2ebd4e3bc50442fbc0888c9d8c94e4e06a933804e2af3e89e2f9c1c749"},
+ {file = "charset_normalizer-3.4.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:0d99dd8ff461990f12d6e42c7347fd9ab2532fb70e9621ba520f9e8637161d7c"},
+ {file = "charset_normalizer-3.4.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:c57516e58fd17d03ebe67e181a4e4e2ccab1168f8c2976c6a334d4f819fe5944"},
+ {file = "charset_normalizer-3.4.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:6dba5d19c4dfab08e58d5b36304b3f92f3bd5d42c1a3fa37b5ba5cdf6dfcbcee"},
+ {file = "charset_normalizer-3.4.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bf4475b82be41b07cc5e5ff94810e6a01f276e37c2d55571e3fe175e467a1a1c"},
+ {file = "charset_normalizer-3.4.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ce031db0408e487fd2775d745ce30a7cd2923667cf3b69d48d219f1d8f5ddeb6"},
+ {file = "charset_normalizer-3.4.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:8ff4e7cdfdb1ab5698e675ca622e72d58a6fa2a8aa58195de0c0061288e6e3ea"},
+ {file = "charset_normalizer-3.4.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3710a9751938947e6327ea9f3ea6332a09bf0ba0c09cae9cb1f250bd1f1549bc"},
+ {file = "charset_normalizer-3.4.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:82357d85de703176b5587dbe6ade8ff67f9f69a41c0733cf2425378b49954de5"},
+ {file = "charset_normalizer-3.4.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:47334db71978b23ebcf3c0f9f5ee98b8d65992b65c9c4f2d34c2eaf5bcaf0594"},
+ {file = "charset_normalizer-3.4.0-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:8ce7fd6767a1cc5a92a639b391891bf1c268b03ec7e021c7d6d902285259685c"},
+ {file = "charset_normalizer-3.4.0-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:f1a2f519ae173b5b6a2c9d5fa3116ce16e48b3462c8b96dfdded11055e3d6365"},
+ {file = "charset_normalizer-3.4.0-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:63bc5c4ae26e4bc6be6469943b8253c0fd4e4186c43ad46e713ea61a0ba49129"},
+ {file = "charset_normalizer-3.4.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:bcb4f8ea87d03bc51ad04add8ceaf9b0f085ac045ab4d74e73bbc2dc033f0236"},
+ {file = "charset_normalizer-3.4.0-cp311-cp311-win32.whl", hash = "sha256:9ae4ef0b3f6b41bad6366fb0ea4fc1d7ed051528e113a60fa2a65a9abb5b1d99"},
+ {file = "charset_normalizer-3.4.0-cp311-cp311-win_amd64.whl", hash = "sha256:cee4373f4d3ad28f1ab6290684d8e2ebdb9e7a1b74fdc39e4c211995f77bec27"},
+ {file = "charset_normalizer-3.4.0-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:0713f3adb9d03d49d365b70b84775d0a0d18e4ab08d12bc46baa6132ba78aaf6"},
+ {file = "charset_normalizer-3.4.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:de7376c29d95d6719048c194a9cf1a1b0393fbe8488a22008610b0361d834ecf"},
+ {file = "charset_normalizer-3.4.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:4a51b48f42d9358460b78725283f04bddaf44a9358197b889657deba38f329db"},
+ {file = "charset_normalizer-3.4.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b295729485b06c1a0683af02a9e42d2caa9db04a373dc38a6a58cdd1e8abddf1"},
+ {file = "charset_normalizer-3.4.0-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ee803480535c44e7f5ad00788526da7d85525cfefaf8acf8ab9a310000be4b03"},
+ {file = "charset_normalizer-3.4.0-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:3d59d125ffbd6d552765510e3f31ed75ebac2c7470c7274195b9161a32350284"},
+ {file = "charset_normalizer-3.4.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8cda06946eac330cbe6598f77bb54e690b4ca93f593dee1568ad22b04f347c15"},
+ {file = "charset_normalizer-3.4.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:07afec21bbbbf8a5cc3651aa96b980afe2526e7f048fdfb7f1014d84acc8b6d8"},
+ {file = "charset_normalizer-3.4.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:6b40e8d38afe634559e398cc32b1472f376a4099c75fe6299ae607e404c033b2"},
+ {file = "charset_normalizer-3.4.0-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:b8dcd239c743aa2f9c22ce674a145e0a25cb1566c495928440a181ca1ccf6719"},
+ {file = "charset_normalizer-3.4.0-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:84450ba661fb96e9fd67629b93d2941c871ca86fc38d835d19d4225ff946a631"},
+ {file = "charset_normalizer-3.4.0-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:44aeb140295a2f0659e113b31cfe92c9061622cadbc9e2a2f7b8ef6b1e29ef4b"},
+ {file = "charset_normalizer-3.4.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:1db4e7fefefd0f548d73e2e2e041f9df5c59e178b4c72fbac4cc6f535cfb1565"},
+ {file = "charset_normalizer-3.4.0-cp312-cp312-win32.whl", hash = "sha256:5726cf76c982532c1863fb64d8c6dd0e4c90b6ece9feb06c9f202417a31f7dd7"},
+ {file = "charset_normalizer-3.4.0-cp312-cp312-win_amd64.whl", hash = "sha256:b197e7094f232959f8f20541ead1d9862ac5ebea1d58e9849c1bf979255dfac9"},
+ {file = "charset_normalizer-3.4.0-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:dd4eda173a9fcccb5f2e2bd2a9f423d180194b1bf17cf59e3269899235b2a114"},
+ {file = "charset_normalizer-3.4.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:e9e3c4c9e1ed40ea53acf11e2a386383c3304212c965773704e4603d589343ed"},
+ {file = "charset_normalizer-3.4.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:92a7e36b000bf022ef3dbb9c46bfe2d52c047d5e3f3343f43204263c5addc250"},
+ {file = "charset_normalizer-3.4.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:54b6a92d009cbe2fb11054ba694bc9e284dad30a26757b1e372a1fdddaf21920"},
+ {file = "charset_normalizer-3.4.0-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1ffd9493de4c922f2a38c2bf62b831dcec90ac673ed1ca182fe11b4d8e9f2a64"},
+ {file = "charset_normalizer-3.4.0-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:35c404d74c2926d0287fbd63ed5d27eb911eb9e4a3bb2c6d294f3cfd4a9e0c23"},
+ {file = "charset_normalizer-3.4.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4796efc4faf6b53a18e3d46343535caed491776a22af773f366534056c4e1fbc"},
+ {file = "charset_normalizer-3.4.0-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e7fdd52961feb4c96507aa649550ec2a0d527c086d284749b2f582f2d40a2e0d"},
+ {file = "charset_normalizer-3.4.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:92db3c28b5b2a273346bebb24857fda45601aef6ae1c011c0a997106581e8a88"},
+ {file = "charset_normalizer-3.4.0-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:ab973df98fc99ab39080bfb0eb3a925181454d7c3ac8a1e695fddfae696d9e90"},
+ {file = "charset_normalizer-3.4.0-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:4b67fdab07fdd3c10bb21edab3cbfe8cf5696f453afce75d815d9d7223fbe88b"},
+ {file = "charset_normalizer-3.4.0-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:aa41e526a5d4a9dfcfbab0716c7e8a1b215abd3f3df5a45cf18a12721d31cb5d"},
+ {file = "charset_normalizer-3.4.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:ffc519621dce0c767e96b9c53f09c5d215578e10b02c285809f76509a3931482"},
+ {file = "charset_normalizer-3.4.0-cp313-cp313-win32.whl", hash = "sha256:f19c1585933c82098c2a520f8ec1227f20e339e33aca8fa6f956f6691b784e67"},
+ {file = "charset_normalizer-3.4.0-cp313-cp313-win_amd64.whl", hash = "sha256:707b82d19e65c9bd28b81dde95249b07bf9f5b90ebe1ef17d9b57473f8a64b7b"},
+ {file = "charset_normalizer-3.4.0-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:dbe03226baf438ac4fda9e2d0715022fd579cb641c4cf639fa40d53b2fe6f3e2"},
+ {file = "charset_normalizer-3.4.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:dd9a8bd8900e65504a305bf8ae6fa9fbc66de94178c420791d0293702fce2df7"},
+ {file = "charset_normalizer-3.4.0-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b8831399554b92b72af5932cdbbd4ddc55c55f631bb13ff8fe4e6536a06c5c51"},
+ {file = "charset_normalizer-3.4.0-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a14969b8691f7998e74663b77b4c36c0337cb1df552da83d5c9004a93afdb574"},
+ {file = "charset_normalizer-3.4.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dcaf7c1524c0542ee2fc82cc8ec337f7a9f7edee2532421ab200d2b920fc97cf"},
+ {file = "charset_normalizer-3.4.0-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:425c5f215d0eecee9a56cdb703203dda90423247421bf0d67125add85d0c4455"},
+ {file = "charset_normalizer-3.4.0-cp37-cp37m-musllinux_1_2_aarch64.whl", hash = "sha256:d5b054862739d276e09928de37c79ddeec42a6e1bfc55863be96a36ba22926f6"},
+ {file = "charset_normalizer-3.4.0-cp37-cp37m-musllinux_1_2_i686.whl", hash = "sha256:f3e73a4255342d4eb26ef6df01e3962e73aa29baa3124a8e824c5d3364a65748"},
+ {file = "charset_normalizer-3.4.0-cp37-cp37m-musllinux_1_2_ppc64le.whl", hash = "sha256:2f6c34da58ea9c1a9515621f4d9ac379871a8f21168ba1b5e09d74250de5ad62"},
+ {file = "charset_normalizer-3.4.0-cp37-cp37m-musllinux_1_2_s390x.whl", hash = "sha256:f09cb5a7bbe1ecae6e87901a2eb23e0256bb524a79ccc53eb0b7629fbe7677c4"},
+ {file = "charset_normalizer-3.4.0-cp37-cp37m-musllinux_1_2_x86_64.whl", hash = "sha256:0099d79bdfcf5c1f0c2c72f91516702ebf8b0b8ddd8905f97a8aecf49712c621"},
+ {file = "charset_normalizer-3.4.0-cp37-cp37m-win32.whl", hash = "sha256:9c98230f5042f4945f957d006edccc2af1e03ed5e37ce7c373f00a5a4daa6149"},
+ {file = "charset_normalizer-3.4.0-cp37-cp37m-win_amd64.whl", hash = "sha256:62f60aebecfc7f4b82e3f639a7d1433a20ec32824db2199a11ad4f5e146ef5ee"},
+ {file = "charset_normalizer-3.4.0-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:af73657b7a68211996527dbfeffbb0864e043d270580c5aef06dc4b659a4b578"},
+ {file = "charset_normalizer-3.4.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:cab5d0b79d987c67f3b9e9c53f54a61360422a5a0bc075f43cab5621d530c3b6"},
+ {file = "charset_normalizer-3.4.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:9289fd5dddcf57bab41d044f1756550f9e7cf0c8e373b8cdf0ce8773dc4bd417"},
+ {file = "charset_normalizer-3.4.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6b493a043635eb376e50eedf7818f2f322eabbaa974e948bd8bdd29eb7ef2a51"},
+ {file = "charset_normalizer-3.4.0-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:9fa2566ca27d67c86569e8c85297aaf413ffab85a8960500f12ea34ff98e4c41"},
+ {file = "charset_normalizer-3.4.0-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a8e538f46104c815be19c975572d74afb53f29650ea2025bbfaef359d2de2f7f"},
+ {file = "charset_normalizer-3.4.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6fd30dc99682dc2c603c2b315bded2799019cea829f8bf57dc6b61efde6611c8"},
+ {file = "charset_normalizer-3.4.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:2006769bd1640bdf4d5641c69a3d63b71b81445473cac5ded39740a226fa88ab"},
+ {file = "charset_normalizer-3.4.0-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:dc15e99b2d8a656f8e666854404f1ba54765871104e50c8e9813af8a7db07f12"},
+ {file = "charset_normalizer-3.4.0-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:ab2e5bef076f5a235c3774b4f4028a680432cded7cad37bba0fd90d64b187d19"},
+ {file = "charset_normalizer-3.4.0-cp38-cp38-musllinux_1_2_ppc64le.whl", hash = "sha256:4ec9dd88a5b71abfc74e9df5ebe7921c35cbb3b641181a531ca65cdb5e8e4dea"},
+ {file = "charset_normalizer-3.4.0-cp38-cp38-musllinux_1_2_s390x.whl", hash = "sha256:43193c5cda5d612f247172016c4bb71251c784d7a4d9314677186a838ad34858"},
+ {file = "charset_normalizer-3.4.0-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:aa693779a8b50cd97570e5a0f343538a8dbd3e496fa5dcb87e29406ad0299654"},
+ {file = "charset_normalizer-3.4.0-cp38-cp38-win32.whl", hash = "sha256:7706f5850360ac01d80c89bcef1640683cc12ed87f42579dab6c5d3ed6888613"},
+ {file = "charset_normalizer-3.4.0-cp38-cp38-win_amd64.whl", hash = "sha256:c3e446d253bd88f6377260d07c895816ebf33ffffd56c1c792b13bff9c3e1ade"},
+ {file = "charset_normalizer-3.4.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:980b4f289d1d90ca5efcf07958d3eb38ed9c0b7676bf2831a54d4f66f9c27dfa"},
+ {file = "charset_normalizer-3.4.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:f28f891ccd15c514a0981f3b9db9aa23d62fe1a99997512b0491d2ed323d229a"},
+ {file = "charset_normalizer-3.4.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:a8aacce6e2e1edcb6ac625fb0f8c3a9570ccc7bfba1f63419b3769ccf6a00ed0"},
+ {file = "charset_normalizer-3.4.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bd7af3717683bea4c87acd8c0d3d5b44d56120b26fd3f8a692bdd2d5260c620a"},
+ {file = "charset_normalizer-3.4.0-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:5ff2ed8194587faf56555927b3aa10e6fb69d931e33953943bc4f837dfee2242"},
+ {file = "charset_normalizer-3.4.0-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:e91f541a85298cf35433bf66f3fab2a4a2cff05c127eeca4af174f6d497f0d4b"},
+ {file = "charset_normalizer-3.4.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:309a7de0a0ff3040acaebb35ec45d18db4b28232f21998851cfa709eeff49d62"},
+ {file = "charset_normalizer-3.4.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:285e96d9d53422efc0d7a17c60e59f37fbf3dfa942073f666db4ac71e8d726d0"},
+ {file = "charset_normalizer-3.4.0-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:5d447056e2ca60382d460a604b6302d8db69476fd2015c81e7c35417cfabe4cd"},
+ {file = "charset_normalizer-3.4.0-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:20587d20f557fe189b7947d8e7ec5afa110ccf72a3128d61a2a387c3313f46be"},
+ {file = "charset_normalizer-3.4.0-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:130272c698667a982a5d0e626851ceff662565379baf0ff2cc58067b81d4f11d"},
+ {file = "charset_normalizer-3.4.0-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:ab22fbd9765e6954bc0bcff24c25ff71dcbfdb185fcdaca49e81bac68fe724d3"},
+ {file = "charset_normalizer-3.4.0-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:7782afc9b6b42200f7362858f9e73b1f8316afb276d316336c0ec3bd73312742"},
+ {file = "charset_normalizer-3.4.0-cp39-cp39-win32.whl", hash = "sha256:2de62e8801ddfff069cd5c504ce3bc9672b23266597d4e4f50eda28846c322f2"},
+ {file = "charset_normalizer-3.4.0-cp39-cp39-win_amd64.whl", hash = "sha256:95c3c157765b031331dd4db3c775e58deaee050a3042fcad72cbc4189d7c8dca"},
+ {file = "charset_normalizer-3.4.0-py3-none-any.whl", hash = "sha256:fe9f97feb71aa9896b81973a7bbada8c49501dc73e58a10fcef6663af95e5079"},
+ {file = "charset_normalizer-3.4.0.tar.gz", hash = "sha256:223217c3d4f82c3ac5e29032b3f1c2eb0fb591b72161f86d93f5719079dae93e"},
]
[[package]]
@@ -1995,43 +2010,38 @@ files = [
[[package]]
name = "cryptography"
-version = "42.0.8"
+version = "43.0.1"
description = "cryptography is a package which provides cryptographic recipes and primitives to Python developers."
optional = false
python-versions = ">=3.7"
files = [
- {file = "cryptography-42.0.8-cp37-abi3-macosx_10_12_universal2.whl", hash = "sha256:81d8a521705787afe7a18d5bfb47ea9d9cc068206270aad0b96a725022e18d2e"},
- {file = "cryptography-42.0.8-cp37-abi3-macosx_10_12_x86_64.whl", hash = "sha256:961e61cefdcb06e0c6d7e3a1b22ebe8b996eb2bf50614e89384be54c48c6b63d"},
- {file = "cryptography-42.0.8-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e3ec3672626e1b9e55afd0df6d774ff0e953452886e06e0f1eb7eb0c832e8902"},
- {file = "cryptography-42.0.8-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e599b53fd95357d92304510fb7bda8523ed1f79ca98dce2f43c115950aa78801"},
- {file = "cryptography-42.0.8-cp37-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:5226d5d21ab681f432a9c1cf8b658c0cb02533eece706b155e5fbd8a0cdd3949"},
- {file = "cryptography-42.0.8-cp37-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:6b7c4f03ce01afd3b76cf69a5455caa9cfa3de8c8f493e0d3ab7d20611c8dae9"},
- {file = "cryptography-42.0.8-cp37-abi3-musllinux_1_1_aarch64.whl", hash = "sha256:2346b911eb349ab547076f47f2e035fc8ff2c02380a7cbbf8d87114fa0f1c583"},
- {file = "cryptography-42.0.8-cp37-abi3-musllinux_1_1_x86_64.whl", hash = "sha256:ad803773e9df0b92e0a817d22fd8a3675493f690b96130a5e24f1b8fabbea9c7"},
- {file = "cryptography-42.0.8-cp37-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:2f66d9cd9147ee495a8374a45ca445819f8929a3efcd2e3df6428e46c3cbb10b"},
- {file = "cryptography-42.0.8-cp37-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:d45b940883a03e19e944456a558b67a41160e367a719833c53de6911cabba2b7"},
- {file = "cryptography-42.0.8-cp37-abi3-win32.whl", hash = "sha256:a0c5b2b0585b6af82d7e385f55a8bc568abff8923af147ee3c07bd8b42cda8b2"},
- {file = "cryptography-42.0.8-cp37-abi3-win_amd64.whl", hash = "sha256:57080dee41209e556a9a4ce60d229244f7a66ef52750f813bfbe18959770cfba"},
- {file = "cryptography-42.0.8-cp39-abi3-macosx_10_12_universal2.whl", hash = "sha256:dea567d1b0e8bc5764b9443858b673b734100c2871dc93163f58c46a97a83d28"},
- {file = "cryptography-42.0.8-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c4783183f7cb757b73b2ae9aed6599b96338eb957233c58ca8f49a49cc32fd5e"},
- {file = "cryptography-42.0.8-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a0608251135d0e03111152e41f0cc2392d1e74e35703960d4190b2e0f4ca9c70"},
- {file = "cryptography-42.0.8-cp39-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:dc0fdf6787f37b1c6b08e6dfc892d9d068b5bdb671198c72072828b80bd5fe4c"},
- {file = "cryptography-42.0.8-cp39-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:9c0c1716c8447ee7dbf08d6db2e5c41c688544c61074b54fc4564196f55c25a7"},
- {file = "cryptography-42.0.8-cp39-abi3-musllinux_1_1_aarch64.whl", hash = "sha256:fff12c88a672ab9c9c1cf7b0c80e3ad9e2ebd9d828d955c126be4fd3e5578c9e"},
- {file = "cryptography-42.0.8-cp39-abi3-musllinux_1_1_x86_64.whl", hash = "sha256:cafb92b2bc622cd1aa6a1dce4b93307792633f4c5fe1f46c6b97cf67073ec961"},
- {file = "cryptography-42.0.8-cp39-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:31f721658a29331f895a5a54e7e82075554ccfb8b163a18719d342f5ffe5ecb1"},
- {file = "cryptography-42.0.8-cp39-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:b297f90c5723d04bcc8265fc2a0f86d4ea2e0f7ab4b6994459548d3a6b992a14"},
- {file = "cryptography-42.0.8-cp39-abi3-win32.whl", hash = "sha256:2f88d197e66c65be5e42cd72e5c18afbfae3f741742070e3019ac8f4ac57262c"},
- {file = "cryptography-42.0.8-cp39-abi3-win_amd64.whl", hash = "sha256:fa76fbb7596cc5839320000cdd5d0955313696d9511debab7ee7278fc8b5c84a"},
- {file = "cryptography-42.0.8-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:ba4f0a211697362e89ad822e667d8d340b4d8d55fae72cdd619389fb5912eefe"},
- {file = "cryptography-42.0.8-pp310-pypy310_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:81884c4d096c272f00aeb1f11cf62ccd39763581645b0812e99a91505fa48e0c"},
- {file = "cryptography-42.0.8-pp310-pypy310_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:c9bb2ae11bfbab395bdd072985abde58ea9860ed84e59dbc0463a5d0159f5b71"},
- {file = "cryptography-42.0.8-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:7016f837e15b0a1c119d27ecd89b3515f01f90a8615ed5e9427e30d9cdbfed3d"},
- {file = "cryptography-42.0.8-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:5a94eccb2a81a309806027e1670a358b99b8fe8bfe9f8d329f27d72c094dde8c"},
- {file = "cryptography-42.0.8-pp39-pypy39_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:dec9b018df185f08483f294cae6ccac29e7a6e0678996587363dc352dc65c842"},
- {file = "cryptography-42.0.8-pp39-pypy39_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:343728aac38decfdeecf55ecab3264b015be68fc2816ca800db649607aeee648"},
- {file = "cryptography-42.0.8-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:013629ae70b40af70c9a7a5db40abe5d9054e6f4380e50ce769947b73bf3caad"},
- {file = "cryptography-42.0.8.tar.gz", hash = "sha256:8d09d05439ce7baa8e9e95b07ec5b6c886f548deb7e0f69ef25f64b3bce842f2"},
+ {file = "cryptography-43.0.1-cp37-abi3-macosx_10_9_universal2.whl", hash = "sha256:8385d98f6a3bf8bb2d65a73e17ed87a3ba84f6991c155691c51112075f9ffc5d"},
+ {file = "cryptography-43.0.1-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:27e613d7077ac613e399270253259d9d53872aaf657471473ebfc9a52935c062"},
+ {file = "cryptography-43.0.1-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:68aaecc4178e90719e95298515979814bda0cbada1256a4485414860bd7ab962"},
+ {file = "cryptography-43.0.1-cp37-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:de41fd81a41e53267cb020bb3a7212861da53a7d39f863585d13ea11049cf277"},
+ {file = "cryptography-43.0.1-cp37-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:f98bf604c82c416bc829e490c700ca1553eafdf2912a91e23a79d97d9801372a"},
+ {file = "cryptography-43.0.1-cp37-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:61ec41068b7b74268fa86e3e9e12b9f0c21fcf65434571dbb13d954bceb08042"},
+ {file = "cryptography-43.0.1-cp37-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:014f58110f53237ace6a408b5beb6c427b64e084eb451ef25a28308270086494"},
+ {file = "cryptography-43.0.1-cp37-abi3-win32.whl", hash = "sha256:2bd51274dcd59f09dd952afb696bf9c61a7a49dfc764c04dd33ef7a6b502a1e2"},
+ {file = "cryptography-43.0.1-cp37-abi3-win_amd64.whl", hash = "sha256:666ae11966643886c2987b3b721899d250855718d6d9ce41b521252a17985f4d"},
+ {file = "cryptography-43.0.1-cp39-abi3-macosx_10_9_universal2.whl", hash = "sha256:ac119bb76b9faa00f48128b7f5679e1d8d437365c5d26f1c2c3f0da4ce1b553d"},
+ {file = "cryptography-43.0.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1bbcce1a551e262dfbafb6e6252f1ae36a248e615ca44ba302df077a846a8806"},
+ {file = "cryptography-43.0.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:58d4e9129985185a06d849aa6df265bdd5a74ca6e1b736a77959b498e0505b85"},
+ {file = "cryptography-43.0.1-cp39-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:d03a475165f3134f773d1388aeb19c2d25ba88b6a9733c5c590b9ff7bbfa2e0c"},
+ {file = "cryptography-43.0.1-cp39-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:511f4273808ab590912a93ddb4e3914dfd8a388fed883361b02dea3791f292e1"},
+ {file = "cryptography-43.0.1-cp39-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:80eda8b3e173f0f247f711eef62be51b599b5d425c429b5d4ca6a05e9e856baa"},
+ {file = "cryptography-43.0.1-cp39-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:38926c50cff6f533f8a2dae3d7f19541432610d114a70808f0926d5aaa7121e4"},
+ {file = "cryptography-43.0.1-cp39-abi3-win32.whl", hash = "sha256:a575913fb06e05e6b4b814d7f7468c2c660e8bb16d8d5a1faf9b33ccc569dd47"},
+ {file = "cryptography-43.0.1-cp39-abi3-win_amd64.whl", hash = "sha256:d75601ad10b059ec832e78823b348bfa1a59f6b8d545db3a24fd44362a1564cb"},
+ {file = "cryptography-43.0.1-pp310-pypy310_pp73-macosx_10_9_x86_64.whl", hash = "sha256:ea25acb556320250756e53f9e20a4177515f012c9eaea17eb7587a8c4d8ae034"},
+ {file = "cryptography-43.0.1-pp310-pypy310_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:c1332724be35d23a854994ff0b66530119500b6053d0bd3363265f7e5e77288d"},
+ {file = "cryptography-43.0.1-pp310-pypy310_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:fba1007b3ef89946dbbb515aeeb41e30203b004f0b4b00e5e16078b518563289"},
+ {file = "cryptography-43.0.1-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:5b43d1ea6b378b54a1dc99dd8a2b5be47658fe9a7ce0a58ff0b55f4b43ef2b84"},
+ {file = "cryptography-43.0.1-pp39-pypy39_pp73-macosx_10_9_x86_64.whl", hash = "sha256:88cce104c36870d70c49c7c8fd22885875d950d9ee6ab54df2745f83ba0dc365"},
+ {file = "cryptography-43.0.1-pp39-pypy39_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:9d3cdb25fa98afdd3d0892d132b8d7139e2c087da1712041f6b762e4f807cc96"},
+ {file = "cryptography-43.0.1-pp39-pypy39_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:e710bf40870f4db63c3d7d929aa9e09e4e7ee219e703f949ec4073b4294f6172"},
+ {file = "cryptography-43.0.1-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:7c05650fe8023c5ed0d46793d4b7d7e6cd9c04e68eabe5b0aeea836e37bdcec2"},
+ {file = "cryptography-43.0.1.tar.gz", hash = "sha256:203e92a75716d8cfb491dc47c79e17d0d9207ccffcbcb35f598fbe463ae3444d"},
]
[package.dependencies]
@@ -2044,7 +2054,7 @@ nox = ["nox"]
pep8test = ["check-sdist", "click", "mypy", "ruff"]
sdist = ["build"]
ssh = ["bcrypt (>=3.1.5)"]
-test = ["certifi", "pretend", "pytest (>=6.2.0)", "pytest-benchmark", "pytest-cov", "pytest-xdist"]
+test = ["certifi", "cryptography-vectors (==43.0.1)", "pretend", "pytest (>=6.2.0)", "pytest-benchmark", "pytest-cov", "pytest-xdist"]
test-randomorder = ["pytest-randomly"]
[[package]]
@@ -2348,13 +2358,13 @@ files = [
[[package]]
name = "elastic-transport"
-version = "8.15.0"
+version = "8.15.1"
description = "Transport classes and utilities shared among Python Elastic client libraries"
optional = false
python-versions = ">=3.8"
files = [
- {file = "elastic_transport-8.15.0-py3-none-any.whl", hash = "sha256:d7080d1dada2b4eee69e7574f9c17a76b42f2895eff428e562f94b0360e158c0"},
- {file = "elastic_transport-8.15.0.tar.gz", hash = "sha256:85d62558f9baafb0868c801233a59b235e61d7b4804c28c2fadaa866b6766233"},
+ {file = "elastic_transport-8.15.1-py3-none-any.whl", hash = "sha256:b5e82ff1679d8c7705a03fd85c7f6ef85d6689721762d41228dd312e34f331fc"},
+ {file = "elastic_transport-8.15.1.tar.gz", hash = "sha256:9cac4ab5cf9402668cf305ae0b7d93ddc0c7b61461d6d1027850db6da9cc5742"},
]
[package.dependencies]
@@ -2362,17 +2372,17 @@ certifi = "*"
urllib3 = ">=1.26.2,<3"
[package.extras]
-develop = ["aiohttp", "furo", "httpx", "opentelemetry-api", "opentelemetry-sdk", "orjson", "pytest", "pytest-asyncio", "pytest-cov", "pytest-httpserver", "pytest-mock", "requests", "respx", "sphinx (>2)", "sphinx-autodoc-typehints", "trustme"]
+develop = ["aiohttp", "furo", "httpcore (<1.0.6)", "httpx", "opentelemetry-api", "opentelemetry-sdk", "orjson", "pytest", "pytest-asyncio", "pytest-cov", "pytest-httpserver", "pytest-mock", "requests", "respx", "sphinx (>2)", "sphinx-autodoc-typehints", "trustme"]
[[package]]
name = "elasticsearch"
-version = "8.15.1"
+version = "8.14.0"
description = "Python client for Elasticsearch"
optional = false
-python-versions = ">=3.8"
+python-versions = ">=3.7"
files = [
- {file = "elasticsearch-8.15.1-py3-none-any.whl", hash = "sha256:02a0476e98768a30d7926335fc0d305c04fdb928eea1354c6e6040d8c2814569"},
- {file = "elasticsearch-8.15.1.tar.gz", hash = "sha256:40c0d312f8adf8bdc81795bc16a0b546ddf544cb1f90e829a244e4780c4dbfd8"},
+ {file = "elasticsearch-8.14.0-py3-none-any.whl", hash = "sha256:cef8ef70a81af027f3da74a4f7d9296b390c636903088439087b8262a468c130"},
+ {file = "elasticsearch-8.14.0.tar.gz", hash = "sha256:aa2490029dd96f4015b333c1827aa21fd6c0a4d223b00dfb0fe933b8d09a511b"},
]
[package.dependencies]
@@ -2380,10 +2390,7 @@ elastic-transport = ">=8.13,<9"
[package.extras]
async = ["aiohttp (>=3,<4)"]
-dev = ["aiohttp", "black", "build", "coverage", "isort", "jinja2", "mapbox-vector-tile", "nox", "numpy", "orjson", "pandas", "pyarrow", "pytest", "pytest-asyncio", "pytest-cov", "python-dateutil", "pyyaml (>=5.4)", "requests (>=2,<3)", "simsimd", "twine", "unasync"]
-docs = ["sphinx", "sphinx-autodoc-typehints", "sphinx-rtd-theme (>=2.0)"]
orjson = ["orjson (>=3)"]
-pyarrow = ["pyarrow (>=1)"]
requests = ["requests (>=2.4.0,!=2.32.2,<3.0.0)"]
vectorstore-mmr = ["numpy (>=1)", "simsimd (>=3)"]
@@ -4124,18 +4131,15 @@ files = [
[[package]]
name = "isodate"
-version = "0.6.1"
+version = "0.7.2"
description = "An ISO 8601 date/time/duration parser and formatter"
optional = false
-python-versions = "*"
+python-versions = ">=3.7"
files = [
- {file = "isodate-0.6.1-py2.py3-none-any.whl", hash = "sha256:0751eece944162659049d35f4f549ed815792b38793f07cf73381c1c87cbed96"},
- {file = "isodate-0.6.1.tar.gz", hash = "sha256:48c5881de7e8b0a0d648cb024c8062dc84e7b840ed81e864c7614fd3c127bde9"},
+ {file = "isodate-0.7.2-py3-none-any.whl", hash = "sha256:28009937d8031054830160fce6d409ed342816b543597cece116d966c6d99e15"},
+ {file = "isodate-0.7.2.tar.gz", hash = "sha256:4cd1aa0f43ca76f4a6c6c0292a85f40b35ec2e43e315b59f06e6d32171a953e6"},
]
-[package.dependencies]
-six = "*"
-
[[package]]
name = "itsdangerous"
version = "2.2.0"
@@ -4257,13 +4261,13 @@ format-nongpl = ["fqdn", "idna", "isoduration", "jsonpointer (>1.13)", "rfc3339-
[[package]]
name = "jsonschema-specifications"
-version = "2023.12.1"
+version = "2024.10.1"
description = "The JSON Schema meta-schemas and vocabularies, exposed as a Registry"
optional = false
-python-versions = ">=3.8"
+python-versions = ">=3.9"
files = [
- {file = "jsonschema_specifications-2023.12.1-py3-none-any.whl", hash = "sha256:87e4fdf3a94858b8a2ba2778d9ba57d8a9cafca7c7489c46ba0d30a8bc6a9c3c"},
- {file = "jsonschema_specifications-2023.12.1.tar.gz", hash = "sha256:48a76787b3e70f5ed53f1160d2b81f586e4ca6d1548c5de7085d1682674764cc"},
+ {file = "jsonschema_specifications-2024.10.1-py3-none-any.whl", hash = "sha256:a09a0680616357d9a0ecf05c12ad234479f549239d0f5b55f3deea67475da9bf"},
+ {file = "jsonschema_specifications-2024.10.1.tar.gz", hash = "sha256:0f38b83639958ce1152d02a7f062902c41c8fd20d558b0c34344292d417ae272"},
]
[package.dependencies]
@@ -4483,13 +4487,13 @@ six = "*"
[[package]]
name = "langfuse"
-version = "2.51.3"
+version = "2.51.5"
description = "A client library for accessing langfuse"
optional = false
python-versions = "<4.0,>=3.8.1"
files = [
- {file = "langfuse-2.51.3-py3-none-any.whl", hash = "sha256:32aba050123656ec0c165583e1d33243cc7a14e7b8498ed3c9de808aa90306f1"},
- {file = "langfuse-2.51.3.tar.gz", hash = "sha256:ccd2109556ee232db717abfb751ee8a3139f074db7d3e06a4f1a756c349fc5ba"},
+ {file = "langfuse-2.51.5-py3-none-any.whl", hash = "sha256:b95401ca710ef94b521afa6541933b6f93d7cfd4a97523c8fc75bca4d6d219fb"},
+ {file = "langfuse-2.51.5.tar.gz", hash = "sha256:55bc37b5c5d3ae133c1a95db09117cfb3117add110ba02ebbf2ce45ac4395c5b"},
]
[package.dependencies]
@@ -4508,13 +4512,13 @@ openai = ["openai (>=0.27.8)"]
[[package]]
name = "langsmith"
-version = "0.1.131"
+version = "0.1.133"
description = "Client library to connect to the LangSmith LLM Tracing and Evaluation Platform."
optional = false
python-versions = "<4.0,>=3.8.1"
files = [
- {file = "langsmith-0.1.131-py3-none-any.whl", hash = "sha256:80c106b1c42307195cc0bb3a596472c41ef91b79d15bcee9938307800336c563"},
- {file = "langsmith-0.1.131.tar.gz", hash = "sha256:626101a3bf3ca481e5110d5155ace8aa066e4e9cc2fa7d96c8290ade0fbff797"},
+ {file = "langsmith-0.1.133-py3-none-any.whl", hash = "sha256:82e837a6039c483beadbe19c2ba7ebafbd402d3e8105234f5ef334425cff7b45"},
+ {file = "langsmith-0.1.133.tar.gz", hash = "sha256:7bfd8bef166b9a64ee540a11bee4aa7bf43b1d9229f95b0fc19086454955185d"},
]
[package.dependencies]
@@ -4856,71 +4860,72 @@ testing = ["coverage", "pytest", "pytest-cov", "pytest-regressions"]
[[package]]
name = "markupsafe"
-version = "2.1.5"
+version = "3.0.1"
description = "Safely add untrusted strings to HTML/XML markup."
optional = false
-python-versions = ">=3.7"
+python-versions = ">=3.9"
files = [
- {file = "MarkupSafe-2.1.5-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:a17a92de5231666cfbe003f0e4b9b3a7ae3afb1ec2845aadc2bacc93ff85febc"},
- {file = "MarkupSafe-2.1.5-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:72b6be590cc35924b02c78ef34b467da4ba07e4e0f0454a2c5907f473fc50ce5"},
- {file = "MarkupSafe-2.1.5-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e61659ba32cf2cf1481e575d0462554625196a1f2fc06a1c777d3f48e8865d46"},
- {file = "MarkupSafe-2.1.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2174c595a0d73a3080ca3257b40096db99799265e1c27cc5a610743acd86d62f"},
- {file = "MarkupSafe-2.1.5-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ae2ad8ae6ebee9d2d94b17fb62763125f3f374c25618198f40cbb8b525411900"},
- {file = "MarkupSafe-2.1.5-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:075202fa5b72c86ad32dc7d0b56024ebdbcf2048c0ba09f1cde31bfdd57bcfff"},
- {file = "MarkupSafe-2.1.5-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:598e3276b64aff0e7b3451b72e94fa3c238d452e7ddcd893c3ab324717456bad"},
- {file = "MarkupSafe-2.1.5-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:fce659a462a1be54d2ffcacea5e3ba2d74daa74f30f5f143fe0c58636e355fdd"},
- {file = "MarkupSafe-2.1.5-cp310-cp310-win32.whl", hash = "sha256:d9fad5155d72433c921b782e58892377c44bd6252b5af2f67f16b194987338a4"},
- {file = "MarkupSafe-2.1.5-cp310-cp310-win_amd64.whl", hash = "sha256:bf50cd79a75d181c9181df03572cdce0fbb75cc353bc350712073108cba98de5"},
- {file = "MarkupSafe-2.1.5-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:629ddd2ca402ae6dbedfceeba9c46d5f7b2a61d9749597d4307f943ef198fc1f"},
- {file = "MarkupSafe-2.1.5-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:5b7b716f97b52c5a14bffdf688f971b2d5ef4029127f1ad7a513973cfd818df2"},
- {file = "MarkupSafe-2.1.5-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6ec585f69cec0aa07d945b20805be741395e28ac1627333b1c5b0105962ffced"},
- {file = "MarkupSafe-2.1.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b91c037585eba9095565a3556f611e3cbfaa42ca1e865f7b8015fe5c7336d5a5"},
- {file = "MarkupSafe-2.1.5-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7502934a33b54030eaf1194c21c692a534196063db72176b0c4028e140f8f32c"},
- {file = "MarkupSafe-2.1.5-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:0e397ac966fdf721b2c528cf028494e86172b4feba51d65f81ffd65c63798f3f"},
- {file = "MarkupSafe-2.1.5-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:c061bb86a71b42465156a3ee7bd58c8c2ceacdbeb95d05a99893e08b8467359a"},
- {file = "MarkupSafe-2.1.5-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:3a57fdd7ce31c7ff06cdfbf31dafa96cc533c21e443d57f5b1ecc6cdc668ec7f"},
- {file = "MarkupSafe-2.1.5-cp311-cp311-win32.whl", hash = "sha256:397081c1a0bfb5124355710fe79478cdbeb39626492b15d399526ae53422b906"},
- {file = "MarkupSafe-2.1.5-cp311-cp311-win_amd64.whl", hash = "sha256:2b7c57a4dfc4f16f7142221afe5ba4e093e09e728ca65c51f5620c9aaeb9a617"},
- {file = "MarkupSafe-2.1.5-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:8dec4936e9c3100156f8a2dc89c4b88d5c435175ff03413b443469c7c8c5f4d1"},
- {file = "MarkupSafe-2.1.5-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:3c6b973f22eb18a789b1460b4b91bf04ae3f0c4234a0a6aa6b0a92f6f7b951d4"},
- {file = "MarkupSafe-2.1.5-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ac07bad82163452a6884fe8fa0963fb98c2346ba78d779ec06bd7a6262132aee"},
- {file = "MarkupSafe-2.1.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f5dfb42c4604dddc8e4305050aa6deb084540643ed5804d7455b5df8fe16f5e5"},
- {file = "MarkupSafe-2.1.5-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ea3d8a3d18833cf4304cd2fc9cbb1efe188ca9b5efef2bdac7adc20594a0e46b"},
- {file = "MarkupSafe-2.1.5-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:d050b3361367a06d752db6ead6e7edeb0009be66bc3bae0ee9d97fb326badc2a"},
- {file = "MarkupSafe-2.1.5-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:bec0a414d016ac1a18862a519e54b2fd0fc8bbfd6890376898a6c0891dd82e9f"},
- {file = "MarkupSafe-2.1.5-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:58c98fee265677f63a4385256a6d7683ab1832f3ddd1e66fe948d5880c21a169"},
- {file = "MarkupSafe-2.1.5-cp312-cp312-win32.whl", hash = "sha256:8590b4ae07a35970728874632fed7bd57b26b0102df2d2b233b6d9d82f6c62ad"},
- {file = "MarkupSafe-2.1.5-cp312-cp312-win_amd64.whl", hash = "sha256:823b65d8706e32ad2df51ed89496147a42a2a6e01c13cfb6ffb8b1e92bc910bb"},
- {file = "MarkupSafe-2.1.5-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:c8b29db45f8fe46ad280a7294f5c3ec36dbac9491f2d1c17345be8e69cc5928f"},
- {file = "MarkupSafe-2.1.5-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ec6a563cff360b50eed26f13adc43e61bc0c04d94b8be985e6fb24b81f6dcfdf"},
- {file = "MarkupSafe-2.1.5-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a549b9c31bec33820e885335b451286e2969a2d9e24879f83fe904a5ce59d70a"},
- {file = "MarkupSafe-2.1.5-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4f11aa001c540f62c6166c7726f71f7573b52c68c31f014c25cc7901deea0b52"},
- {file = "MarkupSafe-2.1.5-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:7b2e5a267c855eea6b4283940daa6e88a285f5f2a67f2220203786dfa59b37e9"},
- {file = "MarkupSafe-2.1.5-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:2d2d793e36e230fd32babe143b04cec8a8b3eb8a3122d2aceb4a371e6b09b8df"},
- {file = "MarkupSafe-2.1.5-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:ce409136744f6521e39fd8e2a24c53fa18ad67aa5bc7c2cf83645cce5b5c4e50"},
- {file = "MarkupSafe-2.1.5-cp37-cp37m-win32.whl", hash = "sha256:4096e9de5c6fdf43fb4f04c26fb114f61ef0bf2e5604b6ee3019d51b69e8c371"},
- {file = "MarkupSafe-2.1.5-cp37-cp37m-win_amd64.whl", hash = "sha256:4275d846e41ecefa46e2015117a9f491e57a71ddd59bbead77e904dc02b1bed2"},
- {file = "MarkupSafe-2.1.5-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:656f7526c69fac7f600bd1f400991cc282b417d17539a1b228617081106feb4a"},
- {file = "MarkupSafe-2.1.5-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:97cafb1f3cbcd3fd2b6fbfb99ae11cdb14deea0736fc2b0952ee177f2b813a46"},
- {file = "MarkupSafe-2.1.5-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1f3fbcb7ef1f16e48246f704ab79d79da8a46891e2da03f8783a5b6fa41a9532"},
- {file = "MarkupSafe-2.1.5-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fa9db3f79de01457b03d4f01b34cf91bc0048eb2c3846ff26f66687c2f6d16ab"},
- {file = "MarkupSafe-2.1.5-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ffee1f21e5ef0d712f9033568f8344d5da8cc2869dbd08d87c84656e6a2d2f68"},
- {file = "MarkupSafe-2.1.5-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:5dedb4db619ba5a2787a94d877bc8ffc0566f92a01c0ef214865e54ecc9ee5e0"},
- {file = "MarkupSafe-2.1.5-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:30b600cf0a7ac9234b2638fbc0fb6158ba5bdcdf46aeb631ead21248b9affbc4"},
- {file = "MarkupSafe-2.1.5-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:8dd717634f5a044f860435c1d8c16a270ddf0ef8588d4887037c5028b859b0c3"},
- {file = "MarkupSafe-2.1.5-cp38-cp38-win32.whl", hash = "sha256:daa4ee5a243f0f20d528d939d06670a298dd39b1ad5f8a72a4275124a7819eff"},
- {file = "MarkupSafe-2.1.5-cp38-cp38-win_amd64.whl", hash = "sha256:619bc166c4f2de5caa5a633b8b7326fbe98e0ccbfacabd87268a2b15ff73a029"},
- {file = "MarkupSafe-2.1.5-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:7a68b554d356a91cce1236aa7682dc01df0edba8d043fd1ce607c49dd3c1edcf"},
- {file = "MarkupSafe-2.1.5-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:db0b55e0f3cc0be60c1f19efdde9a637c32740486004f20d1cff53c3c0ece4d2"},
- {file = "MarkupSafe-2.1.5-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3e53af139f8579a6d5f7b76549125f0d94d7e630761a2111bc431fd820e163b8"},
- {file = "MarkupSafe-2.1.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:17b950fccb810b3293638215058e432159d2b71005c74371d784862b7e4683f3"},
- {file = "MarkupSafe-2.1.5-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4c31f53cdae6ecfa91a77820e8b151dba54ab528ba65dfd235c80b086d68a465"},
- {file = "MarkupSafe-2.1.5-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:bff1b4290a66b490a2f4719358c0cdcd9bafb6b8f061e45c7a2460866bf50c2e"},
- {file = "MarkupSafe-2.1.5-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:bc1667f8b83f48511b94671e0e441401371dfd0f0a795c7daa4a3cd1dde55bea"},
- {file = "MarkupSafe-2.1.5-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:5049256f536511ee3f7e1b3f87d1d1209d327e818e6ae1365e8653d7e3abb6a6"},
- {file = "MarkupSafe-2.1.5-cp39-cp39-win32.whl", hash = "sha256:00e046b6dd71aa03a41079792f8473dc494d564611a8f89bbbd7cb93295ebdcf"},
- {file = "MarkupSafe-2.1.5-cp39-cp39-win_amd64.whl", hash = "sha256:fa173ec60341d6bb97a89f5ea19c85c5643c1e7dedebc22f5181eb73573142c5"},
- {file = "MarkupSafe-2.1.5.tar.gz", hash = "sha256:d283d37a890ba4c1ae73ffadf8046435c76e7bc2247bbb63c00bd1a709c6544b"},
+ {file = "MarkupSafe-3.0.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:db842712984e91707437461930e6011e60b39136c7331e971952bb30465bc1a1"},
+ {file = "MarkupSafe-3.0.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:3ffb4a8e7d46ed96ae48805746755fadd0909fea2306f93d5d8233ba23dda12a"},
+ {file = "MarkupSafe-3.0.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:67c519635a4f64e495c50e3107d9b4075aec33634272b5db1cde839e07367589"},
+ {file = "MarkupSafe-3.0.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:48488d999ed50ba8d38c581d67e496f955821dc183883550a6fbc7f1aefdc170"},
+ {file = "MarkupSafe-3.0.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f31ae06f1328595d762c9a2bf29dafd8621c7d3adc130cbb46278079758779ca"},
+ {file = "MarkupSafe-3.0.1-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:80fcbf3add8790caddfab6764bde258b5d09aefbe9169c183f88a7410f0f6dea"},
+ {file = "MarkupSafe-3.0.1-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:3341c043c37d78cc5ae6e3e305e988532b072329639007fd408a476642a89fd6"},
+ {file = "MarkupSafe-3.0.1-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:cb53e2a99df28eee3b5f4fea166020d3ef9116fdc5764bc5117486e6d1211b25"},
+ {file = "MarkupSafe-3.0.1-cp310-cp310-win32.whl", hash = "sha256:db15ce28e1e127a0013dfb8ac243a8e392db8c61eae113337536edb28bdc1f97"},
+ {file = "MarkupSafe-3.0.1-cp310-cp310-win_amd64.whl", hash = "sha256:4ffaaac913c3f7345579db4f33b0020db693f302ca5137f106060316761beea9"},
+ {file = "MarkupSafe-3.0.1-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:26627785a54a947f6d7336ce5963569b5d75614619e75193bdb4e06e21d447ad"},
+ {file = "MarkupSafe-3.0.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:b954093679d5750495725ea6f88409946d69cfb25ea7b4c846eef5044194f583"},
+ {file = "MarkupSafe-3.0.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:973a371a55ce9ed333a3a0f8e0bcfae9e0d637711534bcb11e130af2ab9334e7"},
+ {file = "MarkupSafe-3.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:244dbe463d5fb6d7ce161301a03a6fe744dac9072328ba9fc82289238582697b"},
+ {file = "MarkupSafe-3.0.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d98e66a24497637dd31ccab090b34392dddb1f2f811c4b4cd80c230205c074a3"},
+ {file = "MarkupSafe-3.0.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:ad91738f14eb8da0ff82f2acd0098b6257621410dcbd4df20aaa5b4233d75a50"},
+ {file = "MarkupSafe-3.0.1-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:7044312a928a66a4c2a22644147bc61a199c1709712069a344a3fb5cfcf16915"},
+ {file = "MarkupSafe-3.0.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:a4792d3b3a6dfafefdf8e937f14906a51bd27025a36f4b188728a73382231d91"},
+ {file = "MarkupSafe-3.0.1-cp311-cp311-win32.whl", hash = "sha256:fa7d686ed9883f3d664d39d5a8e74d3c5f63e603c2e3ff0abcba23eac6542635"},
+ {file = "MarkupSafe-3.0.1-cp311-cp311-win_amd64.whl", hash = "sha256:9ba25a71ebf05b9bb0e2ae99f8bc08a07ee8e98c612175087112656ca0f5c8bf"},
+ {file = "MarkupSafe-3.0.1-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:8ae369e84466aa70f3154ee23c1451fda10a8ee1b63923ce76667e3077f2b0c4"},
+ {file = "MarkupSafe-3.0.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:40f1e10d51c92859765522cbd79c5c8989f40f0419614bcdc5015e7b6bf97fc5"},
+ {file = "MarkupSafe-3.0.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5a4cb365cb49b750bdb60b846b0c0bc49ed62e59a76635095a179d440540c346"},
+ {file = "MarkupSafe-3.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ee3941769bd2522fe39222206f6dd97ae83c442a94c90f2b7a25d847d40f4729"},
+ {file = "MarkupSafe-3.0.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:62fada2c942702ef8952754abfc1a9f7658a4d5460fabe95ac7ec2cbe0d02abc"},
+ {file = "MarkupSafe-3.0.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:4c2d64fdba74ad16138300815cfdc6ab2f4647e23ced81f59e940d7d4a1469d9"},
+ {file = "MarkupSafe-3.0.1-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:fb532dd9900381d2e8f48172ddc5a59db4c445a11b9fab40b3b786da40d3b56b"},
+ {file = "MarkupSafe-3.0.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:0f84af7e813784feb4d5e4ff7db633aba6c8ca64a833f61d8e4eade234ef0c38"},
+ {file = "MarkupSafe-3.0.1-cp312-cp312-win32.whl", hash = "sha256:cbf445eb5628981a80f54087f9acdbf84f9b7d862756110d172993b9a5ae81aa"},
+ {file = "MarkupSafe-3.0.1-cp312-cp312-win_amd64.whl", hash = "sha256:a10860e00ded1dd0a65b83e717af28845bb7bd16d8ace40fe5531491de76b79f"},
+ {file = "MarkupSafe-3.0.1-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:e81c52638315ff4ac1b533d427f50bc0afc746deb949210bc85f05d4f15fd772"},
+ {file = "MarkupSafe-3.0.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:312387403cd40699ab91d50735ea7a507b788091c416dd007eac54434aee51da"},
+ {file = "MarkupSafe-3.0.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2ae99f31f47d849758a687102afdd05bd3d3ff7dbab0a8f1587981b58a76152a"},
+ {file = "MarkupSafe-3.0.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c97ff7fedf56d86bae92fa0a646ce1a0ec7509a7578e1ed238731ba13aabcd1c"},
+ {file = "MarkupSafe-3.0.1-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a7420ceda262dbb4b8d839a4ec63d61c261e4e77677ed7c66c99f4e7cb5030dd"},
+ {file = "MarkupSafe-3.0.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:45d42d132cff577c92bfba536aefcfea7e26efb975bd455db4e6602f5c9f45e7"},
+ {file = "MarkupSafe-3.0.1-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:4c8817557d0de9349109acb38b9dd570b03cc5014e8aabf1cbddc6e81005becd"},
+ {file = "MarkupSafe-3.0.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:6a54c43d3ec4cf2a39f4387ad044221c66a376e58c0d0e971d47c475ba79c6b5"},
+ {file = "MarkupSafe-3.0.1-cp313-cp313-win32.whl", hash = "sha256:c91b394f7601438ff79a4b93d16be92f216adb57d813a78be4446fe0f6bc2d8c"},
+ {file = "MarkupSafe-3.0.1-cp313-cp313-win_amd64.whl", hash = "sha256:fe32482b37b4b00c7a52a07211b479653b7fe4f22b2e481b9a9b099d8a430f2f"},
+ {file = "MarkupSafe-3.0.1-cp313-cp313t-macosx_10_13_universal2.whl", hash = "sha256:17b2aea42a7280db02ac644db1d634ad47dcc96faf38ab304fe26ba2680d359a"},
+ {file = "MarkupSafe-3.0.1-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:852dc840f6d7c985603e60b5deaae1d89c56cb038b577f6b5b8c808c97580f1d"},
+ {file = "MarkupSafe-3.0.1-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0778de17cff1acaeccc3ff30cd99a3fd5c50fc58ad3d6c0e0c4c58092b859396"},
+ {file = "MarkupSafe-3.0.1-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:800100d45176652ded796134277ecb13640c1a537cad3b8b53da45aa96330453"},
+ {file = "MarkupSafe-3.0.1-cp313-cp313t-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d06b24c686a34c86c8c1fba923181eae6b10565e4d80bdd7bc1c8e2f11247aa4"},
+ {file = "MarkupSafe-3.0.1-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:33d1c36b90e570ba7785dacd1faaf091203d9942bc036118fab8110a401eb1a8"},
+ {file = "MarkupSafe-3.0.1-cp313-cp313t-musllinux_1_2_i686.whl", hash = "sha256:beeebf760a9c1f4c07ef6a53465e8cfa776ea6a2021eda0d0417ec41043fe984"},
+ {file = "MarkupSafe-3.0.1-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:bbde71a705f8e9e4c3e9e33db69341d040c827c7afa6789b14c6e16776074f5a"},
+ {file = "MarkupSafe-3.0.1-cp313-cp313t-win32.whl", hash = "sha256:82b5dba6eb1bcc29cc305a18a3c5365d2af06ee71b123216416f7e20d2a84e5b"},
+ {file = "MarkupSafe-3.0.1-cp313-cp313t-win_amd64.whl", hash = "sha256:730d86af59e0e43ce277bb83970530dd223bf7f2a838e086b50affa6ec5f9295"},
+ {file = "MarkupSafe-3.0.1-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:4935dd7883f1d50e2ffecca0aa33dc1946a94c8f3fdafb8df5c330e48f71b132"},
+ {file = "MarkupSafe-3.0.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:e9393357f19954248b00bed7c56f29a25c930593a77630c719653d51e7669c2a"},
+ {file = "MarkupSafe-3.0.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:40621d60d0e58aa573b68ac5e2d6b20d44392878e0bfc159012a5787c4e35bc8"},
+ {file = "MarkupSafe-3.0.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f94190df587738280d544971500b9cafc9b950d32efcb1fba9ac10d84e6aa4e6"},
+ {file = "MarkupSafe-3.0.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b6a387d61fe41cdf7ea95b38e9af11cfb1a63499af2759444b99185c4ab33f5b"},
+ {file = "MarkupSafe-3.0.1-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:8ad4ad1429cd4f315f32ef263c1342166695fad76c100c5d979c45d5570ed58b"},
+ {file = "MarkupSafe-3.0.1-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:e24bfe89c6ac4c31792793ad9f861b8f6dc4546ac6dc8f1c9083c7c4f2b335cd"},
+ {file = "MarkupSafe-3.0.1-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:2a4b34a8d14649315c4bc26bbfa352663eb51d146e35eef231dd739d54a5430a"},
+ {file = "MarkupSafe-3.0.1-cp39-cp39-win32.whl", hash = "sha256:242d6860f1fd9191aef5fae22b51c5c19767f93fb9ead4d21924e0bcb17619d8"},
+ {file = "MarkupSafe-3.0.1-cp39-cp39-win_amd64.whl", hash = "sha256:93e8248d650e7e9d49e8251f883eed60ecbc0e8ffd6349e18550925e31bd029b"},
+ {file = "markupsafe-3.0.1.tar.gz", hash = "sha256:3e683ee4f5d0fa2dde4db77ed8dd8a876686e3fc417655c2ece9a90576905344"},
]
[[package]]
@@ -5635,19 +5640,19 @@ signedtoken = ["cryptography (>=3.0.0)", "pyjwt (>=2.0.0,<3)"]
[[package]]
name = "oci"
-version = "2.135.1"
+version = "2.135.2"
description = "Oracle Cloud Infrastructure Python SDK"
optional = false
python-versions = "*"
files = [
- {file = "oci-2.135.1-py3-none-any.whl", hash = "sha256:249e24638faa2058b2fa9ab4917ff230f2a8b3b97cd11a261ce6c7f97c3ed2ff"},
- {file = "oci-2.135.1.tar.gz", hash = "sha256:bea8aaba19d3fed186ceaeedba6d46f1cdb3c6c7d93b39ab225a15cbd63f9ce8"},
+ {file = "oci-2.135.2-py3-none-any.whl", hash = "sha256:5213319244e1c7f108bcb417322f33f01f043fd9636d4063574039f5fdf4e4f7"},
+ {file = "oci-2.135.2.tar.gz", hash = "sha256:520f78983c5246eae80dd5ecfd05e3a565c8b98d02ef0c1b11ba1f61bcccb61d"},
]
[package.dependencies]
certifi = "*"
circuitbreaker = {version = ">=1.3.1,<3.0.0", markers = "python_version >= \"3.7\""}
-cryptography = ">=3.2.1,<43.0.0"
+cryptography = ">=3.2.1,<46.0.0"
pyOpenSSL = ">=17.5.0,<25.0.0"
python-dateutil = ">=2.5.3,<3.0.0"
pytz = ">=2016.10"
@@ -6277,13 +6282,13 @@ files = [
[[package]]
name = "pgvecto-rs"
-version = "0.2.1"
+version = "0.2.2"
description = "Python binding for pgvecto.rs"
optional = false
python-versions = "<3.13,>=3.8"
files = [
- {file = "pgvecto_rs-0.2.1-py3-none-any.whl", hash = "sha256:b3ee2c465219469ad537b3efea2916477c6c576b3d6fd4298980d0733d12bb27"},
- {file = "pgvecto_rs-0.2.1.tar.gz", hash = "sha256:07046eaad2c4f75745f76de9ba483541909f1c595aced8d3434224a4f933daca"},
+ {file = "pgvecto_rs-0.2.2-py3-none-any.whl", hash = "sha256:5f3f7f806813de408c45dc10a9eb418b986c4d7b7723e8fce9298f2f7d8fbbd5"},
+ {file = "pgvecto_rs-0.2.2.tar.gz", hash = "sha256:edaa913d1747152b1407cbdf6337d51ac852547b54953ef38997433be3a75a3b"},
]
[package.dependencies]
@@ -6753,19 +6758,6 @@ files = [
{file = "pyarrow-17.0.0-cp312-cp312-win_amd64.whl", hash = "sha256:392bc9feabc647338e6c89267635e111d71edad5fcffba204425a7c8d13610d7"},
{file = "pyarrow-17.0.0-cp38-cp38-macosx_10_15_x86_64.whl", hash = "sha256:af5ff82a04b2171415f1410cff7ebb79861afc5dae50be73ce06d6e870615204"},
{file = "pyarrow-17.0.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:edca18eaca89cd6382dfbcff3dd2d87633433043650c07375d095cd3517561d8"},
- {file = "pyarrow-17.0.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7c7916bff914ac5d4a8fe25b7a25e432ff921e72f6f2b7547d1e325c1ad9d155"},
- {file = "pyarrow-17.0.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f553ca691b9e94b202ff741bdd40f6ccb70cdd5fbf65c187af132f1317de6145"},
- {file = "pyarrow-17.0.0-cp38-cp38-manylinux_2_28_aarch64.whl", hash = "sha256:0cdb0e627c86c373205a2f94a510ac4376fdc523f8bb36beab2e7f204416163c"},
- {file = "pyarrow-17.0.0-cp38-cp38-manylinux_2_28_x86_64.whl", hash = "sha256:d7d192305d9d8bc9082d10f361fc70a73590a4c65cf31c3e6926cd72b76bc35c"},
- {file = "pyarrow-17.0.0-cp38-cp38-win_amd64.whl", hash = "sha256:02dae06ce212d8b3244dd3e7d12d9c4d3046945a5933d28026598e9dbbda1fca"},
- {file = "pyarrow-17.0.0-cp39-cp39-macosx_10_15_x86_64.whl", hash = "sha256:13d7a460b412f31e4c0efa1148e1d29bdf18ad1411eb6757d38f8fbdcc8645fb"},
- {file = "pyarrow-17.0.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:9b564a51fbccfab5a04a80453e5ac6c9954a9c5ef2890d1bcf63741909c3f8df"},
- {file = "pyarrow-17.0.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:32503827abbc5aadedfa235f5ece8c4f8f8b0a3cf01066bc8d29de7539532687"},
- {file = "pyarrow-17.0.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a155acc7f154b9ffcc85497509bcd0d43efb80d6f733b0dc3bb14e281f131c8b"},
- {file = "pyarrow-17.0.0-cp39-cp39-manylinux_2_28_aarch64.whl", hash = "sha256:dec8d129254d0188a49f8a1fc99e0560dc1b85f60af729f47de4046015f9b0a5"},
- {file = "pyarrow-17.0.0-cp39-cp39-manylinux_2_28_x86_64.whl", hash = "sha256:a48ddf5c3c6a6c505904545c25a4ae13646ae1f8ba703c4df4a1bfe4f4006bda"},
- {file = "pyarrow-17.0.0-cp39-cp39-win_amd64.whl", hash = "sha256:42bf93249a083aca230ba7e2786c5f673507fa97bbd9725a1e2754715151a204"},
- {file = "pyarrow-17.0.0.tar.gz", hash = "sha256:4beca9521ed2c0921c1023e68d097d0299b62c362639ea315572a58f3f50fd28"},
]
[package.dependencies]
@@ -7124,13 +7116,13 @@ test = ["pretend", "pytest (>=3.0.1)", "pytest-rerunfailures"]
[[package]]
name = "pypandoc"
-version = "1.13"
+version = "1.14"
description = "Thin wrapper for pandoc."
optional = false
python-versions = ">=3.6"
files = [
- {file = "pypandoc-1.13-py3-none-any.whl", hash = "sha256:4c7d71bf2f1ed122aac287113b5c4d537a33bbc3c1df5aed11a7d4a7ac074681"},
- {file = "pypandoc-1.13.tar.gz", hash = "sha256:31652073c7960c2b03570bd1e94f602ca9bc3e70099df5ead4cea98ff5151c1e"},
+ {file = "pypandoc-1.14-py3-none-any.whl", hash = "sha256:1315c7ad7fac7236dacf69a05b521ed2c3f1d0177f70e9b92bfffce6c023df22"},
+ {file = "pypandoc-1.14.tar.gz", hash = "sha256:6b4c45f5f1b9fb5bb562079164806bdbbc3e837b5402bcf3f1139edc5730a197"},
]
[[package]]
@@ -8195,13 +8187,13 @@ files = [
[[package]]
name = "s3transfer"
-version = "0.10.2"
+version = "0.10.3"
description = "An Amazon S3 Transfer Manager"
optional = false
python-versions = ">=3.8"
files = [
- {file = "s3transfer-0.10.2-py3-none-any.whl", hash = "sha256:eca1c20de70a39daee580aef4986996620f365c4e0fda6a86100231d62f1bf69"},
- {file = "s3transfer-0.10.2.tar.gz", hash = "sha256:0711534e9356d3cc692fdde846b4a1e4b0cb6519971860796e6bc4c7aea00ef6"},
+ {file = "s3transfer-0.10.3-py3-none-any.whl", hash = "sha256:263ed587a5803c6c708d3ce44dc4dfedaab4c1a32e8329bab818933d79ddcf5d"},
+ {file = "s3transfer-0.10.3.tar.gz", hash = "sha256:4f50ed74ab84d474ce614475e0b8d5047ff080810aac5d01ea25231cfc944b0c"},
]
[package.dependencies]
@@ -8943,13 +8935,13 @@ test = ["pytest", "tornado (>=4.5)", "typeguard"]
[[package]]
name = "tencentcloud-sdk-python-common"
-version = "3.0.1244"
+version = "3.0.1246"
description = "Tencent Cloud Common SDK for Python"
optional = false
python-versions = "*"
files = [
- {file = "tencentcloud-sdk-python-common-3.0.1244.tar.gz", hash = "sha256:51e895a4f380ead51de5ebcef990cfda17cf466b130b8d1be7a95c11158a66e2"},
- {file = "tencentcloud_sdk_python_common-3.0.1244-py2.py3-none-any.whl", hash = "sha256:a3275496740d7876386166e83331eab7ad66e70fe4216c96893e9697fdeb9848"},
+ {file = "tencentcloud-sdk-python-common-3.0.1246.tar.gz", hash = "sha256:a724d53d5dd6c68beff9ae1c2eb7737889d67f7724819ec5189e878e5322940b"},
+ {file = "tencentcloud_sdk_python_common-3.0.1246-py2.py3-none-any.whl", hash = "sha256:e82a103cc4f1a8d07a83600604eba89e46899b005328b921dbcba9f73b3e819b"},
]
[package.dependencies]
@@ -8957,17 +8949,17 @@ requests = ">=2.16.0"
[[package]]
name = "tencentcloud-sdk-python-hunyuan"
-version = "3.0.1244"
+version = "3.0.1246"
description = "Tencent Cloud Hunyuan SDK for Python"
optional = false
python-versions = "*"
files = [
- {file = "tencentcloud-sdk-python-hunyuan-3.0.1244.tar.gz", hash = "sha256:b43f6848ac464cb244f6b1a17c97b00cd36ea40e91a4fba9f7b8ac1e94ae600a"},
- {file = "tencentcloud_sdk_python_hunyuan-3.0.1244-py2.py3-none-any.whl", hash = "sha256:c2679f49d129dd5ec905cbac97884f6a872e50300ec7ba1ab4fe654d1458213f"},
+ {file = "tencentcloud-sdk-python-hunyuan-3.0.1246.tar.gz", hash = "sha256:099db4a80e7788e1ca09b8be45758e47a6c5976e304857f26621f958cca5b39b"},
+ {file = "tencentcloud_sdk_python_hunyuan-3.0.1246-py2.py3-none-any.whl", hash = "sha256:14ad0a6787bb579a9270e6fe6ee81131a286c2f1b56cac8d7de0056983b6548f"},
]
[package.dependencies]
-tencentcloud-sdk-python-common = "3.0.1244"
+tencentcloud-sdk-python-common = "3.0.1246"
[[package]]
name = "threadpoolctl"
@@ -9636,13 +9628,13 @@ zstd = ["zstandard (>=0.18.0)"]
[[package]]
name = "uvicorn"
-version = "0.31.0"
+version = "0.31.1"
description = "The lightning-fast ASGI server."
optional = false
python-versions = ">=3.8"
files = [
- {file = "uvicorn-0.31.0-py3-none-any.whl", hash = "sha256:cac7be4dd4d891c363cd942160a7b02e69150dcbc7a36be04d5f4af4b17c8ced"},
- {file = "uvicorn-0.31.0.tar.gz", hash = "sha256:13bc21373d103859f68fe739608e2eb054a816dea79189bc3ca08ea89a275906"},
+ {file = "uvicorn-0.31.1-py3-none-any.whl", hash = "sha256:adc42d9cac80cf3e51af97c1851648066841e7cfb6993a4ca8de29ac1548ed41"},
+ {file = "uvicorn-0.31.1.tar.gz", hash = "sha256:f5167919867b161b7bcaf32646c6a94cdbd4c3aa2eb5c17d36bb9aa5cfd8c493"},
]
[package.dependencies]
@@ -10233,13 +10225,13 @@ files = [
[[package]]
name = "xmltodict"
-version = "0.13.0"
+version = "0.14.1"
description = "Makes working with XML feel like you are working with JSON"
optional = false
-python-versions = ">=3.4"
+python-versions = ">=3.6"
files = [
- {file = "xmltodict-0.13.0-py2.py3-none-any.whl", hash = "sha256:aa89e8fd76320154a40d19a0df04a4695fb9dc5ba977cbb68ab3e4eb225e7852"},
- {file = "xmltodict-0.13.0.tar.gz", hash = "sha256:341595a488e3e01a85a9d8911d8912fd922ede5fecc4dce437eb4b6c8d037e56"},
+ {file = "xmltodict-0.14.1-py2.py3-none-any.whl", hash = "sha256:3ef4a7b71c08f19047fcbea572e1d7f4207ab269da1565b5d40e9823d3894e63"},
+ {file = "xmltodict-0.14.1.tar.gz", hash = "sha256:338c8431e4fc554517651972d62f06958718f6262b04316917008e8fd677a6b0"},
]
[[package]]
@@ -10595,4 +10587,4 @@ cffi = ["cffi (>=1.11)"]
[metadata]
lock-version = "2.0"
python-versions = ">=3.10,<3.13"
-content-hash = "34ba8efcc67da342036ef075b693f59fdc67d246f40b857c9c1bd6f80c7283bd"
+content-hash = "259bffdcb68115a512695954dea8058bdc0bcc3770ce79106271ea94c6b5ed40"
diff --git a/api/pyproject.toml b/api/pyproject.toml
index 956d4dbd11..b72cc44abb 100644
--- a/api/pyproject.toml
+++ b/api/pyproject.toml
@@ -236,7 +236,7 @@ alibabacloud_gpdb20160503 = "~3.8.0"
alibabacloud_tea_openapi = "~0.3.9"
chromadb = "0.5.1"
clickhouse-connect = "~0.7.16"
-elasticsearch = "~8.15.1"
+elasticsearch = "8.14.0"
oracledb = "~2.2.1"
pgvecto-rs = { version = "~0.2.1", extras = ['sqlalchemy'] }
pgvector = "0.2.5"
diff --git a/docker/docker-compose.yaml b/docker/docker-compose.yaml
index c1a76d7f88..316a6fb64e 100644
--- a/docker/docker-compose.yaml
+++ b/docker/docker-compose.yaml
@@ -630,7 +630,7 @@ services:
# https://www.elastic.co/guide/en/elasticsearch/reference/current/settings.html
# https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html#docker-prod-prerequisites
elasticsearch:
- image: docker.elastic.co/elasticsearch/elasticsearch:8.15.1
+ image: docker.elastic.co/elasticsearch/elasticsearch:8.14.3
container_name: elasticsearch
profiles:
- elasticsearch
@@ -657,7 +657,7 @@ services:
# https://www.elastic.co/guide/en/kibana/current/docker.html
# https://www.elastic.co/guide/en/kibana/current/settings.html
kibana:
- image: docker.elastic.co/kibana/kibana:8.15.1
+ image: docker.elastic.co/kibana/kibana:8.14.3
container_name: kibana
profiles:
- elasticsearch
From 75f0a5e36af9889c1173f26daa4e53c21bf09291 Mon Sep 17 00:00:00 2001
From: Sa Zhang <55871322+Nick17t@users.noreply.github.com>
Date: Thu, 10 Oct 2024 17:00:34 +0800
Subject: [PATCH 43/61] fix: Typo Correction in jina.yaml (#9161)
---
api/core/tools/provider/builtin/jina/jina.yaml | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/api/core/tools/provider/builtin/jina/jina.yaml b/api/core/tools/provider/builtin/jina/jina.yaml
index 346175c41f..af3ca23ffa 100644
--- a/api/core/tools/provider/builtin/jina/jina.yaml
+++ b/api/core/tools/provider/builtin/jina/jina.yaml
@@ -6,9 +6,9 @@ identity:
zh_Hans: Jina AI
pt_BR: Jina AI
description:
- en_US: Convert any URL to an LLM-friendly input or perform searches on the web for grounding information. Experience improved output for your agent and RAG systems at no cost.
- zh_Hans: 将任何URL转换为LLM易读的输入或在网页上搜索引擎上搜索引擎。
- pt_BR: Converte qualquer URL em uma entrada LLm-fácil de ler ou realize pesquisas na web para obter informação de grounding. Tenha uma experiência melhor para seu agente e sistemas RAG sem custo.
+ en_US: Your Search Foundation, Supercharged!
+ zh_Hans: 您的搜索底座,从此不同!
+ pt_BR: Your Search Foundation, Supercharged!
icon: icon.svg
tags:
- search
From be2f1e59f2c2984c4df7f274d1ac0edc67880de7 Mon Sep 17 00:00:00 2001
From: Xiaoguang Sun
Date: Thu, 10 Oct 2024 17:21:28 +0800
Subject: [PATCH 44/61] improve: Refresh updated_at field of
DataSourceOauthBinding model (#9173)
Signed-off-by: Xiaoguang Sun
---
api/libs/oauth_data_source.py | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/api/libs/oauth_data_source.py b/api/libs/oauth_data_source.py
index 05a73b09b7..e747ea97ad 100644
--- a/api/libs/oauth_data_source.py
+++ b/api/libs/oauth_data_source.py
@@ -1,3 +1,4 @@
+import datetime
import urllib.parse
import requests
@@ -69,6 +70,7 @@ class NotionOAuth(OAuthDataSource):
if data_source_binding:
data_source_binding.source_info = source_info
data_source_binding.disabled = False
+ data_source_binding.updated_at = datetime.datetime.now(datetime.timezone.utc).replace(tzinfo=None)
db.session.commit()
else:
new_data_source_binding = DataSourceOauthBinding(
@@ -104,6 +106,7 @@ class NotionOAuth(OAuthDataSource):
if data_source_binding:
data_source_binding.source_info = source_info
data_source_binding.disabled = False
+ data_source_binding.updated_at = datetime.datetime.now(datetime.timezone.utc).replace(tzinfo=None)
db.session.commit()
else:
new_data_source_binding = DataSourceOauthBinding(
@@ -138,6 +141,7 @@ class NotionOAuth(OAuthDataSource):
}
data_source_binding.source_info = new_source_info
data_source_binding.disabled = False
+ data_source_binding.updated_at = datetime.datetime.now(datetime.timezone.utc).replace(tzinfo=None)
db.session.commit()
else:
raise ValueError("Data source binding not found")
From 05c1ef75c4086b20457ac68bd884e9b93d69085e Mon Sep 17 00:00:00 2001
From: zhuhao <37029601+hwzhuhao@users.noreply.github.com>
Date: Thu, 10 Oct 2024 17:39:26 +0800
Subject: [PATCH 45/61] feat: add allow_llm_to_see_data flag for vanna (#9156)
---
.../provider/builtin/vanna/tools/vanna.py | 7 +-
.../provider/builtin/vanna/tools/vanna.yaml | 12 +-
api/poetry.lock | 276 ++++++------------
api/pyproject.toml | 2 +-
4 files changed, 102 insertions(+), 195 deletions(-)
diff --git a/api/core/tools/provider/builtin/vanna/tools/vanna.py b/api/core/tools/provider/builtin/vanna/tools/vanna.py
index c90d766e48..2443991d57 100644
--- a/api/core/tools/provider/builtin/vanna/tools/vanna.py
+++ b/api/core/tools/provider/builtin/vanna/tools/vanna.py
@@ -111,9 +111,10 @@ class VannaTool(BuiltinTool):
# with "visualize" set to True (default behavior) leads to remote code execution.
# Affected versions: <= 0.5.5
#########################################################################################
- generate_chart = False
- # generate_chart = tool_parameters.get("generate_chart", True)
- res = vn.ask(prompt, False, True, generate_chart)
+ allow_llm_to_see_data = tool_parameters.get("allow_llm_to_see_data", False)
+ res = vn.ask(
+ prompt, print_results=False, auto_train=True, visualize=False, allow_llm_to_see_data=allow_llm_to_see_data
+ )
result = []
diff --git a/api/core/tools/provider/builtin/vanna/tools/vanna.yaml b/api/core/tools/provider/builtin/vanna/tools/vanna.yaml
index ae2eae94c4..12ca8a862e 100644
--- a/api/core/tools/provider/builtin/vanna/tools/vanna.yaml
+++ b/api/core/tools/provider/builtin/vanna/tools/vanna.yaml
@@ -200,14 +200,14 @@ parameters:
en_US: If enabled, it will attempt to train on the metadata of that database
zh_Hans: 是否自动从数据库获取元数据来训练
form: form
- - name: generate_chart
+ - name: allow_llm_to_see_data
type: boolean
required: false
- default: True
+ default: false
label:
- en_US: Generate Charts
- zh_Hans: 生成图表
+ en_US: Whether to allow the LLM to see the data
+ zh_Hans: 是否允许LLM查看数据
human_description:
- en_US: Generate Charts
- zh_Hans: 是否生成图表
+ en_US: Whether to allow the LLM to see the data
+ zh_Hans: 是否允许LLM查看数据
form: form
diff --git a/api/poetry.lock b/api/poetry.lock
index a63200caca..b7421ca566 100644
--- a/api/poetry.lock
+++ b/api/poetry.lock
@@ -1628,128 +1628,6 @@ pandas = ["pandas"]
sqlalchemy = ["sqlalchemy (>1.3.21,<2.0)"]
tzlocal = ["tzlocal (>=4.0)"]
-[[package]]
-name = "clickhouse-driver"
-version = "0.2.9"
-description = "Python driver with native interface for ClickHouse"
-optional = false
-python-versions = "<4,>=3.7"
-files = [
- {file = "clickhouse-driver-0.2.9.tar.gz", hash = "sha256:050ea4870ead993910b39e7fae965dc1c347b2e8191dcd977cd4b385f9e19f87"},
- {file = "clickhouse_driver-0.2.9-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:6ce04e9d0d0f39561f312d1ac1a8147bc9206e4267e1a23e20e0423ebac95534"},
- {file = "clickhouse_driver-0.2.9-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:7ae5c8931bf290b9d85582e7955b9aad7f19ff9954e48caa4f9a180ea4d01078"},
- {file = "clickhouse_driver-0.2.9-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3e51792f3bd12c32cb15a907f12de3c9d264843f0bb33dce400e3966c9f09a3f"},
- {file = "clickhouse_driver-0.2.9-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:42fc546c31e4a04c97b749769335a679c9044dc693fa7a93e38c97fd6727173d"},
- {file = "clickhouse_driver-0.2.9-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:6a383a403d185185c64e49edd6a19b2ec973c5adcb8ebff7ed2fc539a2cc65a5"},
- {file = "clickhouse_driver-0.2.9-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f05321a97e816afc75b3e4f9eda989848fecf14ecf1a91d0f22c04258123d1f7"},
- {file = "clickhouse_driver-0.2.9-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:be47e793846aac28442b6b1c6554e0731b848a5a7759a54aa2489997354efe4a"},
- {file = "clickhouse_driver-0.2.9-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:780e42a215d1ae2f6d695d74dd6f087781fb2fa51c508b58f79e68c24c5364e0"},
- {file = "clickhouse_driver-0.2.9-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:9e28f1fe850675e173db586e9f1ac790e8f7edd507a4227cd54cd7445f8e75b6"},
- {file = "clickhouse_driver-0.2.9-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:125aae7f1308d3083dadbb3c78f828ae492e060f13e4007a0cf53a8169ed7b39"},
- {file = "clickhouse_driver-0.2.9-cp310-cp310-musllinux_1_1_s390x.whl", hash = "sha256:2f3c4fbb61e75c62a1ab93a1070d362de4cb5682f82833b2c12deccb3bae888d"},
- {file = "clickhouse_driver-0.2.9-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:0dc03196a84e32d23b88b665be69afae98f57426f5fdf203e16715b756757961"},
- {file = "clickhouse_driver-0.2.9-cp310-cp310-win32.whl", hash = "sha256:25695d78a1d7ad6e221e800612eac08559f6182bf6dee0a220d08de7b612d993"},
- {file = "clickhouse_driver-0.2.9-cp310-cp310-win_amd64.whl", hash = "sha256:367acac95398d721a0a2a6cf87e93638c5588b79498a9848676ce7f182540a6c"},
- {file = "clickhouse_driver-0.2.9-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:5a7353a7a08eee3aa0001d8a5d771cb1f37e2acae1b48178002431f23892121a"},
- {file = "clickhouse_driver-0.2.9-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:6af1c6cbc3481205503ab72a34aa76d6519249c904aa3f7a84b31e7b435555be"},
- {file = "clickhouse_driver-0.2.9-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:48033803abd1100bfff6b9a1769d831b672cd3cda5147e0323b956fd1416d38d"},
- {file = "clickhouse_driver-0.2.9-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1f202a58a540c85e47c31dabc8f84b6fe79dca5315c866450a538d58d6fa0571"},
- {file = "clickhouse_driver-0.2.9-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:e4df50fd84bfa4aa1eb7b52d48136066bfb64fabb7ceb62d4c318b45a296200b"},
- {file = "clickhouse_driver-0.2.9-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:433a650571a0d7766eb6f402e8f5930222997686c2ee01ded22f1d8fd46af9d4"},
- {file = "clickhouse_driver-0.2.9-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:232ee260475611cbf7adb554b81db6b5790b36e634fe2164f4ffcd2ca3e63a71"},
- {file = "clickhouse_driver-0.2.9-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:09049f7e71f15c9c9a03f597f77fc1f7b61ababd155c06c0d9e64d1453d945d7"},
- {file = "clickhouse_driver-0.2.9-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:424153d1d5f5a807f596a48cc88119f9fb3213ca7e38f57b8d15dcc964dd91f7"},
- {file = "clickhouse_driver-0.2.9-cp311-cp311-musllinux_1_1_ppc64le.whl", hash = "sha256:4f078fd1cf19c4ca63b8d1e0803df665310c8d5b644c5b02bf2465e8d6ef8f55"},
- {file = "clickhouse_driver-0.2.9-cp311-cp311-musllinux_1_1_s390x.whl", hash = "sha256:f138d939e26e767537f891170b69a55a88038919f5c10d8865b67b8777fe4848"},
- {file = "clickhouse_driver-0.2.9-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:9aafabc7e32942f85dcb46f007f447ab69024831575df97cae28c6ed127654d1"},
- {file = "clickhouse_driver-0.2.9-cp311-cp311-win32.whl", hash = "sha256:935e16ebf1a1998d8493979d858821a755503c9b8af572d9c450173d4b88868c"},
- {file = "clickhouse_driver-0.2.9-cp311-cp311-win_amd64.whl", hash = "sha256:306b3102cba278b5dfec6f5f7dc8b78416c403901510475c74913345b56c9e42"},
- {file = "clickhouse_driver-0.2.9-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:fcb2fd00e58650ae206a6d5dbc83117240e622471aa5124733fbf2805eb8bda0"},
- {file = "clickhouse_driver-0.2.9-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:b7a3e6b0a1eb218e3d870a94c76daaf65da46dca8f6888ea6542f94905c24d88"},
- {file = "clickhouse_driver-0.2.9-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4a8d8e2888a857d8db3d98765a5ad23ab561241feaef68bbffc5a0bd9c142342"},
- {file = "clickhouse_driver-0.2.9-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:85d50c011467f5ff6772c4059345968b854b72e07a0219030b7c3f68419eb7f7"},
- {file = "clickhouse_driver-0.2.9-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:93b395c1370629ccce8fb3e14cd5be2646d227bd32018c21f753c543e9a7e96b"},
- {file = "clickhouse_driver-0.2.9-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6dbcee870c60d9835e5dce1456ab6b9d807e6669246357f4b321ef747b90fa43"},
- {file = "clickhouse_driver-0.2.9-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:fffa5a5f317b1ec92e406a30a008929054cf3164d2324a3c465d0a0330273bf8"},
- {file = "clickhouse_driver-0.2.9-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:476702740a279744badbd177ae1c4a2d089ec128bd676861219d1f92078e4530"},
- {file = "clickhouse_driver-0.2.9-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:5cd6d95fab5ff80e9dc9baedc9a926f62f74072d42d5804388d63b63bec0bb63"},
- {file = "clickhouse_driver-0.2.9-cp312-cp312-musllinux_1_1_ppc64le.whl", hash = "sha256:05027d32d7cf3e46cb8d04f8c984745ae01bd1bc7b3579f9dadf9b3cca735697"},
- {file = "clickhouse_driver-0.2.9-cp312-cp312-musllinux_1_1_s390x.whl", hash = "sha256:3d11831842250b4c1b26503a6e9c511fc03db096608b7c6af743818c421a3032"},
- {file = "clickhouse_driver-0.2.9-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:81b4b671b785ebb0b8aeabf2432e47072413d81db959eb8cfd8b6ab58c5799c6"},
- {file = "clickhouse_driver-0.2.9-cp312-cp312-win32.whl", hash = "sha256:e893bd4e014877174a59e032b0e99809c95ec61328a0e6bd9352c74a2f6111a8"},
- {file = "clickhouse_driver-0.2.9-cp312-cp312-win_amd64.whl", hash = "sha256:de6624e28eeffd01668803d28ae89e3d4e359b1bff8b60e4933e1cb3c6f86f18"},
- {file = "clickhouse_driver-0.2.9-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:909205324089a9ee59bee7ecbfa94595435118cca310fd62efdf13f225aa2965"},
- {file = "clickhouse_driver-0.2.9-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:03f31d6e47dc2b0f367f598f5629147ed056d7216c1788e25190fcfbfa02e749"},
- {file = "clickhouse_driver-0.2.9-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ed84179914b2b7bb434c2322a6e7fd83daa681c97a050450511b66d917a129bb"},
- {file = "clickhouse_driver-0.2.9-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:67d1bf63efb4ba14ae6c6da99622e4a549e68fc3ee14d859bf611d8e6a61b3fa"},
- {file = "clickhouse_driver-0.2.9-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9eed23ea41dd582d76f7a2ec7e09cbe5e9fec008f11a4799fa35ce44a3ebd283"},
- {file = "clickhouse_driver-0.2.9-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a654291132766efa2703058317749d7c69b69f02d89bac75703eaf7f775e20da"},
- {file = "clickhouse_driver-0.2.9-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:1c26c5ef16d0ef3cabc5bc03e827e01b0a4afb5b4eaf8850b7cf740cee04a1d4"},
- {file = "clickhouse_driver-0.2.9-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:b57e83d7986d3cbda6096974a9510eb53cb33ad9072288c87c820ba5eee3370e"},
- {file = "clickhouse_driver-0.2.9-cp37-cp37m-musllinux_1_1_ppc64le.whl", hash = "sha256:153cc03b36f22cbde55aa6a5bbe99072a025567a54c48b262eb0da15d8cd7c83"},
- {file = "clickhouse_driver-0.2.9-cp37-cp37m-musllinux_1_1_s390x.whl", hash = "sha256:83a857d99192936091f495826ae97497cd1873af213b1e069d56369fb182ab8e"},
- {file = "clickhouse_driver-0.2.9-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:bb05a9bb22cbe9ad187ad268f86adf7e60df6083331fe59c01571b7b725212dd"},
- {file = "clickhouse_driver-0.2.9-cp37-cp37m-win32.whl", hash = "sha256:3e282c5c25e32d96ed151e5460d2bf4ecb805ea64449197dd918e84e768016df"},
- {file = "clickhouse_driver-0.2.9-cp37-cp37m-win_amd64.whl", hash = "sha256:c46dccfb04a9afd61a1b0e60bfefceff917f76da2c863f9b36b39248496d5c77"},
- {file = "clickhouse_driver-0.2.9-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:612ca9028c718f362c97f552e63d313cf1a70a616ef8532ddb0effdaf12ebef9"},
- {file = "clickhouse_driver-0.2.9-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:471b884d318e012f68d858476052742048918854f7dfe87d78e819f87a848ffb"},
- {file = "clickhouse_driver-0.2.9-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:58ee63c35e99da887eb035c8d6d9e64fd298a0efc1460395297dd5cc281a6912"},
- {file = "clickhouse_driver-0.2.9-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:0819bb63d2c5025a1fb9589f57ef82602687cef11081d6dfa6f2ce44606a1772"},
- {file = "clickhouse_driver-0.2.9-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f6680ee18870bca1fbab1736c8203a965efaec119ab4c37821ad99add248ee08"},
- {file = "clickhouse_driver-0.2.9-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:713c498741b54debd3a10a5529e70b6ed85ca33c3e8629e24ae5cd8160b5a5f2"},
- {file = "clickhouse_driver-0.2.9-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:730837b8f63941065c9c955c44286aef0987fb084ffb3f55bf1e4fe07df62269"},
- {file = "clickhouse_driver-0.2.9-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:9f4e38b2ea09214c8e7848a19391009a18c56a3640e1ba1a606b9e57aeb63404"},
- {file = "clickhouse_driver-0.2.9-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:457f1d6639e0345b717ae603c79bd087a35361ce68c1c308d154b80b841e5e7d"},
- {file = "clickhouse_driver-0.2.9-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:49a55aeb8ea625a87965a96e361bbb1ad67d0931bfb2a575f899c1064e70c2da"},
- {file = "clickhouse_driver-0.2.9-cp38-cp38-musllinux_1_1_s390x.whl", hash = "sha256:9230058d8c9b1a04079afae4650fb67745f0f1c39db335728f64d48bd2c19246"},
- {file = "clickhouse_driver-0.2.9-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:8798258bd556542dd9c6b8ebe62f9c5110c9dcdf97c57fb077e7b8b6d6da0826"},
- {file = "clickhouse_driver-0.2.9-cp38-cp38-win32.whl", hash = "sha256:ce8e3f4be46bcc63555863f70ab0035202b082b37e6f16876ef50e7bc4b47056"},
- {file = "clickhouse_driver-0.2.9-cp38-cp38-win_amd64.whl", hash = "sha256:2d982959ff628255808d895a67493f2dab0c3a9bfc65eeda0f00c8ae9962a1b3"},
- {file = "clickhouse_driver-0.2.9-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:a46b227fab4420566ed24ee70d90076226d16fcf09c6ad4d428717efcf536446"},
- {file = "clickhouse_driver-0.2.9-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:7eaa2ce5ea08cf5fddebb8c274c450e102f329f9e6966b6cd85aa671c48e5552"},
- {file = "clickhouse_driver-0.2.9-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f97f0083194d6e23b5ef6156ed0d5388c37847b298118199d7937ba26412a9e2"},
- {file = "clickhouse_driver-0.2.9-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a6cab5cdbb0f8ee51d879d977b78f07068b585225ac656f3c081896c362e8f83"},
- {file = "clickhouse_driver-0.2.9-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:cdb1b011a53ee71539e9dc655f268b111bac484db300da92829ed59e910a8fd0"},
- {file = "clickhouse_driver-0.2.9-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7bf51bb761b281d20910b4b689c699ef98027845467daa5bb5dfdb53bd6ee404"},
- {file = "clickhouse_driver-0.2.9-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b8ea462e3cebb121ff55002e9c8a9a0a3fd9b5bbbf688b4960f0a83c0172fb31"},
- {file = "clickhouse_driver-0.2.9-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:70bee21c245226ad0d637bf470472e2d487b86911b6d673a862127b934336ff4"},
- {file = "clickhouse_driver-0.2.9-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:253a3c223b944d691bf0abbd599f592ea3b36f0a71d2526833b1718f37eca5c2"},
- {file = "clickhouse_driver-0.2.9-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:a6549b53fc5c403dc556cb39b2ae94d73f9b113daa00438a660bb1dd5380ae4d"},
- {file = "clickhouse_driver-0.2.9-cp39-cp39-musllinux_1_1_s390x.whl", hash = "sha256:1c685cd4abe61af1c26279ff04b9f567eb4d6c1ec7fb265af7481b1f153043aa"},
- {file = "clickhouse_driver-0.2.9-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:7e25144219577491929d032a6c3ddd63c6cd7fa764af829a5637f798190d9b26"},
- {file = "clickhouse_driver-0.2.9-cp39-cp39-win32.whl", hash = "sha256:0b9925610d25405a8e6d83ff4f54fc2456a121adb0155999972f5edd6ba3efc8"},
- {file = "clickhouse_driver-0.2.9-cp39-cp39-win_amd64.whl", hash = "sha256:b243de483cfa02716053b0148d73558f4694f3c27b97fc1eaa97d7079563a14d"},
- {file = "clickhouse_driver-0.2.9-pp310-pypy310_pp73-macosx_10_9_x86_64.whl", hash = "sha256:45a3d5b1d06750fd6a18c29b871494a2635670099ec7693e756a5885a4a70dbf"},
- {file = "clickhouse_driver-0.2.9-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8415ffebd6ca9eef3024763abc450f8659f1716d015bd563c537d01c7fbc3569"},
- {file = "clickhouse_driver-0.2.9-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ace48db993aa4bd31c42de0fa8d38c94ad47405916d6b61f7a7168a48fb52ac1"},
- {file = "clickhouse_driver-0.2.9-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b07123334fe143bfe6fa4e3d4b732d647d5fd2cfb9ec7f2f76104b46fe9d20c6"},
- {file = "clickhouse_driver-0.2.9-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:e2af3efa73d296420ce6362789f5b1febf75d4aa159a479393f01549115509d5"},
- {file = "clickhouse_driver-0.2.9-pp37-pypy37_pp73-macosx_10_9_x86_64.whl", hash = "sha256:baf57eede88d07a1eb04352d26fc58a4d97991ca3d8840f7c5d48691dec9f251"},
- {file = "clickhouse_driver-0.2.9-pp37-pypy37_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:275d0ccdab9c3571bdb3e9acfab4497930aa584ff2766b035bb2f854deaf8b82"},
- {file = "clickhouse_driver-0.2.9-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:293da77bfcac3168fb35b27c242f97c1a05502435c0686ecbb8e2e4abcb3de26"},
- {file = "clickhouse_driver-0.2.9-pp37-pypy37_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:8d6c2e5830705e4eeef33070ca4d5a24dfa221f28f2f540e5e6842c26e70b10b"},
- {file = "clickhouse_driver-0.2.9-pp37-pypy37_pp73-win_amd64.whl", hash = "sha256:11934bd78d97dd7e1a23a6222b5edd1e1b4d34e1ead5c846dc2b5c56fdc35ff5"},
- {file = "clickhouse_driver-0.2.9-pp38-pypy38_pp73-macosx_10_9_x86_64.whl", hash = "sha256:b802b6f0fbdcc3ab81b87f09b694dde91ab049f44d1d2c08c3dc8ea9a5950cfa"},
- {file = "clickhouse_driver-0.2.9-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7af871c5315eb829ecf4533c790461ea8f73b3bfd5f533b0467e479fdf6ddcfd"},
- {file = "clickhouse_driver-0.2.9-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9d577dd4867b9e26cf60590e1f500990c8701a6e3cfbb9e644f4d0c0fb607028"},
- {file = "clickhouse_driver-0.2.9-pp38-pypy38_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:2ed3dea2d1eca85fef5b8564ddd76dedb15a610c77d55d555b49d9f7c896b64b"},
- {file = "clickhouse_driver-0.2.9-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:91ec96f2c48e5bdeac9eea43a9bc9cc19acb2d2c59df0a13d5520dfc32457605"},
- {file = "clickhouse_driver-0.2.9-pp39-pypy39_pp73-macosx_10_9_x86_64.whl", hash = "sha256:7667ab423452754f36ba8fb41e006a46baace9c94e2aca2a745689b9f2753dfb"},
- {file = "clickhouse_driver-0.2.9-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:653583b1f3b088d106f180d6f02c90917ecd669ec956b62903a05df4a7f44863"},
- {file = "clickhouse_driver-0.2.9-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7ef3dd0cbdf2f0171caab90389af0ede068ec802bf46c6a77f14e6edc86671bc"},
- {file = "clickhouse_driver-0.2.9-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:11b1833ee8ff8d5df39a34a895e060b57bd81e05ea68822bc60476daff4ce1c8"},
- {file = "clickhouse_driver-0.2.9-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:8a3195639e6393b9d4aafe736036881ff86b6be5855d4bf7d9f5c31637181ec3"},
-]
-
-[package.dependencies]
-pytz = "*"
-tzlocal = "*"
-
-[package.extras]
-lz4 = ["clickhouse-cityhash (>=1.0.2.1)", "lz4", "lz4 (<=3.0.1)"]
-numpy = ["numpy (>=1.12.0)", "pandas (>=0.24.0)"]
-zstd = ["clickhouse-cityhash (>=1.0.2.1)", "zstd"]
-
[[package]]
name = "cloudpickle"
version = "2.2.1"
@@ -2589,6 +2467,24 @@ files = [
{file = "filetype-1.2.0.tar.gz", hash = "sha256:66b56cd6474bf41d8c54660347d37afcc3f7d1970648de365c102ef77548aadb"},
]
+[[package]]
+name = "flasgger"
+version = "0.9.7.1"
+description = "Extract swagger specs from your flask project"
+optional = false
+python-versions = "*"
+files = [
+ {file = "flasgger-0.9.7.1.tar.gz", hash = "sha256:ca098e10bfbb12f047acc6299cc70a33851943a746e550d86e65e60d4df245fb"},
+]
+
+[package.dependencies]
+Flask = ">=0.10"
+jsonschema = ">=3.0.1"
+mistune = "*"
+packaging = "*"
+PyYAML = ">=3.0"
+six = ">=1.10.0"
+
[[package]]
name = "flask"
version = "3.0.3"
@@ -5022,6 +4918,17 @@ files = [
[package.dependencies]
tqdm = "*"
+[[package]]
+name = "mistune"
+version = "3.0.2"
+description = "A sane and fast Markdown parser with useful plugins and renderers"
+optional = false
+python-versions = ">=3.7"
+files = [
+ {file = "mistune-3.0.2-py3-none-any.whl", hash = "sha256:71481854c30fdbc938963d3605b72501f5c10a9320ecd412c121c163a1c7d205"},
+ {file = "mistune-3.0.2.tar.gz", hash = "sha256:fc7f93ded930c92394ef2cb6f04a8aabab4117a91449e72dcc8dfa646a508be8"},
+]
+
[[package]]
name = "mmh3"
version = "5.0.1"
@@ -6758,6 +6665,19 @@ files = [
{file = "pyarrow-17.0.0-cp312-cp312-win_amd64.whl", hash = "sha256:392bc9feabc647338e6c89267635e111d71edad5fcffba204425a7c8d13610d7"},
{file = "pyarrow-17.0.0-cp38-cp38-macosx_10_15_x86_64.whl", hash = "sha256:af5ff82a04b2171415f1410cff7ebb79861afc5dae50be73ce06d6e870615204"},
{file = "pyarrow-17.0.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:edca18eaca89cd6382dfbcff3dd2d87633433043650c07375d095cd3517561d8"},
+ {file = "pyarrow-17.0.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7c7916bff914ac5d4a8fe25b7a25e432ff921e72f6f2b7547d1e325c1ad9d155"},
+ {file = "pyarrow-17.0.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f553ca691b9e94b202ff741bdd40f6ccb70cdd5fbf65c187af132f1317de6145"},
+ {file = "pyarrow-17.0.0-cp38-cp38-manylinux_2_28_aarch64.whl", hash = "sha256:0cdb0e627c86c373205a2f94a510ac4376fdc523f8bb36beab2e7f204416163c"},
+ {file = "pyarrow-17.0.0-cp38-cp38-manylinux_2_28_x86_64.whl", hash = "sha256:d7d192305d9d8bc9082d10f361fc70a73590a4c65cf31c3e6926cd72b76bc35c"},
+ {file = "pyarrow-17.0.0-cp38-cp38-win_amd64.whl", hash = "sha256:02dae06ce212d8b3244dd3e7d12d9c4d3046945a5933d28026598e9dbbda1fca"},
+ {file = "pyarrow-17.0.0-cp39-cp39-macosx_10_15_x86_64.whl", hash = "sha256:13d7a460b412f31e4c0efa1148e1d29bdf18ad1411eb6757d38f8fbdcc8645fb"},
+ {file = "pyarrow-17.0.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:9b564a51fbccfab5a04a80453e5ac6c9954a9c5ef2890d1bcf63741909c3f8df"},
+ {file = "pyarrow-17.0.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:32503827abbc5aadedfa235f5ece8c4f8f8b0a3cf01066bc8d29de7539532687"},
+ {file = "pyarrow-17.0.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a155acc7f154b9ffcc85497509bcd0d43efb80d6f733b0dc3bb14e281f131c8b"},
+ {file = "pyarrow-17.0.0-cp39-cp39-manylinux_2_28_aarch64.whl", hash = "sha256:dec8d129254d0188a49f8a1fc99e0560dc1b85f60af729f47de4046015f9b0a5"},
+ {file = "pyarrow-17.0.0-cp39-cp39-manylinux_2_28_x86_64.whl", hash = "sha256:a48ddf5c3c6a6c505904545c25a4ae13646ae1f8ba703c4df4a1bfe4f4006bda"},
+ {file = "pyarrow-17.0.0-cp39-cp39-win_amd64.whl", hash = "sha256:42bf93249a083aca230ba7e2786c5f673507fa97bbd9725a1e2754715151a204"},
+ {file = "pyarrow-17.0.0.tar.gz", hash = "sha256:4beca9521ed2c0921c1023e68d097d0299b62c362639ea315572a58f3f50fd28"},
]
[package.dependencies]
@@ -9411,23 +9331,6 @@ files = [
{file = "tzdata-2024.2.tar.gz", hash = "sha256:7d85cc416e9382e69095b7bdf4afd9e3880418a2413feec7069d533d6b4e31cc"},
]
-[[package]]
-name = "tzlocal"
-version = "5.2"
-description = "tzinfo object for the local timezone"
-optional = false
-python-versions = ">=3.8"
-files = [
- {file = "tzlocal-5.2-py3-none-any.whl", hash = "sha256:49816ef2fe65ea8ac19d19aa7a1ae0551c834303d5014c6d5a62e4cbda8047b8"},
- {file = "tzlocal-5.2.tar.gz", hash = "sha256:8d399205578f1a9342816409cc1e46a93ebd5755e39ea2d85334bea911bf0e6e"},
-]
-
-[package.dependencies]
-tzdata = {version = "*", markers = "platform_system == \"Windows\""}
-
-[package.extras]
-devenv = ["check-manifest", "pytest (>=4.3)", "pytest-cov", "pytest-mock (>=3.3)", "zest.releaser"]
-
[[package]]
name = "ujson"
version = "5.10.0"
@@ -9709,19 +9612,20 @@ files = [
[[package]]
name = "vanna"
-version = "0.5.5"
+version = "0.7.3"
description = "Generate SQL queries from natural language"
optional = false
python-versions = ">=3.9"
files = [
- {file = "vanna-0.5.5-py3-none-any.whl", hash = "sha256:e1a308b7127b9e98c2579c0e4178fc1475d891c498e4a0667cffa10df8891e73"},
- {file = "vanna-0.5.5.tar.gz", hash = "sha256:7d9bf188a635bb75e4f8db15f0e6dbe72a426784779485f087b2df0ce175e664"},
+ {file = "vanna-0.7.3-py3-none-any.whl", hash = "sha256:82ba39e5d6c503d1c8cca60835ed401d20ec3a3da98d487f529901dcb30061d6"},
+ {file = "vanna-0.7.3.tar.gz", hash = "sha256:4590dd94d2fe180b4efc7a83c867b73144ef58794018910dc226857cfb703077"},
]
[package.dependencies]
-clickhouse_driver = {version = "*", optional = true, markers = "extra == \"clickhouse\""}
+clickhouse_connect = {version = "*", optional = true, markers = "extra == \"clickhouse\""}
db-dtypes = {version = "*", optional = true, markers = "extra == \"postgres\""}
duckdb = {version = "*", optional = true, markers = "extra == \"duckdb\""}
+flasgger = "*"
flask = "*"
flask-sock = "*"
kaleido = "*"
@@ -9735,17 +9639,20 @@ sqlparse = "*"
tabulate = "*"
[package.extras]
-all = ["PyMySQL", "anthropic", "chromadb", "db-dtypes", "duckdb", "fastembed", "google-cloud-aiplatform", "google-cloud-bigquery", "google-generativeai", "httpx", "marqo", "mistralai", "ollama", "openai", "opensearch-dsl", "opensearch-py", "pinecone-client", "psycopg2-binary", "qdrant-client", "snowflake-connector-python", "transformers", "zhipuai"]
+all = ["PyMySQL", "anthropic", "azure-common", "azure-identity", "azure-search-documents", "chromadb", "db-dtypes", "duckdb", "fastembed", "google-cloud-aiplatform", "google-cloud-bigquery", "google-generativeai", "httpx", "marqo", "mistralai (>=1.0.0)", "ollama", "openai", "opensearch-dsl", "opensearch-py", "pinecone-client", "psycopg2-binary", "pymilvus[model]", "qdrant-client", "qianfan", "snowflake-connector-python", "transformers", "weaviate-client", "zhipuai"]
anthropic = ["anthropic"]
+azuresearch = ["azure-common", "azure-identity", "azure-search-documents", "fastembed"]
+bedrock = ["boto3", "botocore"]
bigquery = ["google-cloud-bigquery"]
chromadb = ["chromadb"]
-clickhouse = ["clickhouse_driver"]
+clickhouse = ["clickhouse_connect"]
duckdb = ["duckdb"]
gemini = ["google-generativeai"]
google = ["google-cloud-aiplatform", "google-generativeai"]
hf = ["transformers"]
marqo = ["marqo"]
-mistralai = ["mistralai"]
+milvus = ["pymilvus[model]"]
+mistralai = ["mistralai (>=1.0.0)"]
mysql = ["PyMySQL"]
ollama = ["httpx", "ollama"]
openai = ["openai"]
@@ -9753,9 +9660,11 @@ opensearch = ["opensearch-dsl", "opensearch-py"]
pinecone = ["fastembed", "pinecone-client"]
postgres = ["db-dtypes", "psycopg2-binary"]
qdrant = ["fastembed", "qdrant-client"]
+qianfan = ["qianfan"]
snowflake = ["snowflake-connector-python"]
test = ["tox"]
vllm = ["vllm"]
+weaviate = ["weaviate-client"]
zhipuai = ["zhipuai"]
[[package]]
@@ -10423,54 +10332,51 @@ test = ["zope.testrunner"]
[[package]]
name = "zope-interface"
-version = "7.0.3"
+version = "7.1.0"
description = "Interfaces for Python"
optional = false
python-versions = ">=3.8"
files = [
- {file = "zope.interface-7.0.3-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:9b9369671a20b8d039b8e5a1a33abd12e089e319a3383b4cc0bf5c67bd05fe7b"},
- {file = "zope.interface-7.0.3-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:db6237e8fa91ea4f34d7e2d16d74741187e9105a63bbb5686c61fea04cdbacca"},
- {file = "zope.interface-7.0.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:53d678bb1c3b784edbfb0adeebfeea6bf479f54da082854406a8f295d36f8386"},
- {file = "zope.interface-7.0.3-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3aa8fcbb0d3c2be1bfd013a0f0acd636f6ed570c287743ae2bbd467ee967154d"},
- {file = "zope.interface-7.0.3-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6195c3c03fef9f87c0dbee0b3b6451df6e056322463cf35bca9a088e564a3c58"},
- {file = "zope.interface-7.0.3-cp310-cp310-win_amd64.whl", hash = "sha256:11fa1382c3efb34abf16becff8cb214b0b2e3144057c90611621f2d186b7e1b7"},
- {file = "zope.interface-7.0.3-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:af94e429f9d57b36e71ef4e6865182090648aada0cb2d397ae2b3f7fc478493a"},
- {file = "zope.interface-7.0.3-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:6dd647fcd765030638577fe6984284e0ebba1a1008244c8a38824be096e37fe3"},
- {file = "zope.interface-7.0.3-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1bee1b722077d08721005e8da493ef3adf0b7908e0cd85cc7dc836ac117d6f32"},
- {file = "zope.interface-7.0.3-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:2545d6d7aac425d528cd9bf0d9e55fcd47ab7fd15f41a64b1c4bf4c6b24946dc"},
- {file = "zope.interface-7.0.3-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6d04b11ea47c9c369d66340dbe51e9031df2a0de97d68f442305ed7625ad6493"},
- {file = "zope.interface-7.0.3-cp311-cp311-win_amd64.whl", hash = "sha256:064ade95cb54c840647205987c7b557f75d2b2f7d1a84bfab4cf81822ef6e7d1"},
- {file = "zope.interface-7.0.3-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:3fcdc76d0cde1c09c37b7c6b0f8beba2d857d8417b055d4f47df9c34ec518bdd"},
- {file = "zope.interface-7.0.3-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:3d4b91821305c8d8f6e6207639abcbdaf186db682e521af7855d0bea3047c8ca"},
- {file = "zope.interface-7.0.3-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:35062d93bc49bd9b191331c897a96155ffdad10744ab812485b6bad5b588d7e4"},
- {file = "zope.interface-7.0.3-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c96b3e6b0d4f6ddfec4e947130ec30bd2c7b19db6aa633777e46c8eecf1d6afd"},
- {file = "zope.interface-7.0.3-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7e0c151a6c204f3830237c59ee4770cc346868a7a1af6925e5e38650141a7f05"},
- {file = "zope.interface-7.0.3-cp312-cp312-win_amd64.whl", hash = "sha256:3de1d553ce72868b77a7e9d598c9bff6d3816ad2b4cc81c04f9d8914603814f3"},
- {file = "zope.interface-7.0.3-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ab985c566a99cc5f73bc2741d93f1ed24a2cc9da3890144d37b9582965aff996"},
- {file = "zope.interface-7.0.3-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d976fa7b5faf5396eb18ce6c132c98e05504b52b60784e3401f4ef0b2e66709b"},
- {file = "zope.interface-7.0.3-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:21a207c6b2c58def5011768140861a73f5240f4f39800625072ba84e76c9da0b"},
- {file = "zope.interface-7.0.3-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:382d31d1e68877061daaa6499468e9eb38eb7625d4369b1615ac08d3860fe896"},
- {file = "zope.interface-7.0.3-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:2c4316a30e216f51acbd9fb318aa5af2e362b716596d82cbb92f9101c8f8d2e7"},
- {file = "zope.interface-7.0.3-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:01e6e58078ad2799130c14a1d34ec89044ada0e1495329d72ee0407b9ae5100d"},
- {file = "zope.interface-7.0.3-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:799ef7a444aebbad5a145c3b34bff012b54453cddbde3332d47ca07225792ea4"},
- {file = "zope.interface-7.0.3-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d3b7ce6d46fb0e60897d62d1ff370790ce50a57d40a651db91a3dde74f73b738"},
- {file = "zope.interface-7.0.3-cp38-cp38-win_amd64.whl", hash = "sha256:f418c88f09c3ba159b95a9d1cfcdbe58f208443abb1f3109f4b9b12fd60b187c"},
- {file = "zope.interface-7.0.3-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:84f8794bd59ca7d09d8fce43ae1b571be22f52748169d01a13d3ece8394d8b5b"},
- {file = "zope.interface-7.0.3-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:7d92920416f31786bc1b2f34cc4fc4263a35a407425319572cbf96b51e835cd3"},
- {file = "zope.interface-7.0.3-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:95e5913ec718010dc0e7c215d79a9683b4990e7026828eedfda5268e74e73e11"},
- {file = "zope.interface-7.0.3-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1eeeb92cb7d95c45e726e3c1afe7707919370addae7ed14f614e22217a536958"},
- {file = "zope.interface-7.0.3-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ecd32f30f40bfd8511b17666895831a51b532e93fc106bfa97f366589d3e4e0e"},
- {file = "zope.interface-7.0.3-cp39-cp39-win_amd64.whl", hash = "sha256:5112c530fa8aa2108a3196b9c2f078f5738c1c37cfc716970edc0df0414acda8"},
- {file = "zope.interface-7.0.3.tar.gz", hash = "sha256:cd2690d4b08ec9eaf47a85914fe513062b20da78d10d6d789a792c0b20307fb1"},
+ {file = "zope.interface-7.1.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:2bd9e9f366a5df08ebbdc159f8224904c1c5ce63893984abb76954e6fbe4381a"},
+ {file = "zope.interface-7.1.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:661d5df403cd3c5b8699ac480fa7f58047a3253b029db690efa0c3cf209993ef"},
+ {file = "zope.interface-7.1.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:2b6a4924f5bad9fe21d99f66a07da60d75696a136162427951ec3cb223a5570d"},
+ {file = "zope.interface-7.1.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:80a3c00b35f6170be5454b45abe2719ea65919a2f09e8a6e7b1362312a872cd3"},
+ {file = "zope.interface-7.1.0-cp310-cp310-win_amd64.whl", hash = "sha256:b936d61dbe29572fd2cfe13e30b925e5383bed1aba867692670f5a2a2eb7b4e9"},
+ {file = "zope.interface-7.1.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:0ac20581fc6cd7c754f6dff0ae06fedb060fa0e9ea6309d8be8b2701d9ea51c4"},
+ {file = "zope.interface-7.1.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:848b6fa92d7c8143646e64124ed46818a0049a24ecc517958c520081fd147685"},
+ {file = "zope.interface-7.1.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3bcff5c09d0215f42ba64b49205a278e44413d9bf9fa688fd9e42bfe472b5f4f"},
+ {file = "zope.interface-7.1.0-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:07add15de0cc7e69917f7d286b64d54125c950aeb43efed7a5ea7172f000fbc1"},
+ {file = "zope.interface-7.1.0-cp311-cp311-win_amd64.whl", hash = "sha256:9940d5bc441f887c5f375ec62bcf7e7e495a2d5b1da97de1184a88fb567f06af"},
+ {file = "zope.interface-7.1.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:f245d039f72e6f802902375755846f5de1ee1e14c3e8736c078565599bcab621"},
+ {file = "zope.interface-7.1.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:6159e767d224d8f18deff634a1d3722e68d27488c357f62ebeb5f3e2f5288b1f"},
+ {file = "zope.interface-7.1.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ff115ef91c0eeac69cd92daeba36a9d8e14daee445b504eeea2b1c0b55821984"},
+ {file = "zope.interface-7.1.0-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bec001798ab62c3fc5447162bf48496ae9fba02edc295a9e10a0b0c639a6452e"},
+ {file = "zope.interface-7.1.0-cp312-cp312-win_amd64.whl", hash = "sha256:124149e2d42067b9c6597f4dafdc7a0983d0163868f897b7bb5dc850b14f9a87"},
+ {file = "zope.interface-7.1.0-cp313-cp313-macosx_10_9_x86_64.whl", hash = "sha256:9733a9a0f94ef53d7aa64661811b20875b5bc6039034c6e42fb9732170130573"},
+ {file = "zope.interface-7.1.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:5fcf379b875c610b5a41bc8a891841533f98de0520287d7f85e25386cd10d3e9"},
+ {file = "zope.interface-7.1.0-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4af4a12b459a273b0b34679a5c3dc5e34c1847c3dd14a628aa0668e19e638ea2"},
+ {file = "zope.interface-7.1.0-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a735f82d2e3ed47ca01a20dfc4c779b966b16352650a8036ab3955aad151ed8a"},
+ {file = "zope.interface-7.1.0-cp313-cp313-win_amd64.whl", hash = "sha256:5501e772aff595e3c54266bc1bfc5858e8f38974ce413a8f1044aae0f32a83a3"},
+ {file = "zope.interface-7.1.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:ec59fe53db7d32abb96c6d4efeed84aab4a7c38c62d7a901a9b20c09dd936e7a"},
+ {file = "zope.interface-7.1.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:e53c291debef523b09e1fe3dffe5f35dde164f1c603d77f770b88a1da34b7ed6"},
+ {file = "zope.interface-7.1.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4a00ead2e24c76436e1b457a5132d87f83858330f6c923640b7ef82d668525d1"},
+ {file = "zope.interface-7.1.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5e28ea0bc4b084fc93a483877653a033062435317082cdc6388dec3438309faf"},
+ {file = "zope.interface-7.1.0-cp38-cp38-win_amd64.whl", hash = "sha256:27cfb5205d68b12682b6e55ab8424662d96e8ead19550aad0796b08dd2c9a45e"},
+ {file = "zope.interface-7.1.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:9e3e48f3dea21c147e1b10c132016cb79af1159facca9736d231694ef5a740a8"},
+ {file = "zope.interface-7.1.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:a99240b1d02dc469f6afbe7da1bf617645e60290c272968f4e53feec18d7dce8"},
+ {file = "zope.interface-7.1.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b7b25db127db3e6b597c5f74af60309c4ad65acd826f89609662f0dc33a54728"},
+ {file = "zope.interface-7.1.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2a29ac607e970b5576547f0e3589ec156e04de17af42839eedcf478450687317"},
+ {file = "zope.interface-7.1.0-cp39-cp39-win_amd64.whl", hash = "sha256:a14c9decf0eb61e0892631271d500c1e306c7b6901c998c7035e194d9150fdd1"},
+ {file = "zope_interface-7.1.0.tar.gz", hash = "sha256:3f005869a1a05e368965adb2075f97f8ee9a26c61898a9e52a9764d93774f237"},
]
[package.dependencies]
setuptools = "*"
[package.extras]
-docs = ["Sphinx", "repoze.sphinx.autointerface", "sphinx-rtd-theme"]
-test = ["coverage (>=5.0.3)", "zope.event", "zope.testing"]
-testing = ["coverage (>=5.0.3)", "zope.event", "zope.testing"]
+docs = ["Sphinx", "furo", "repoze.sphinx.autointerface"]
+test = ["coverage[toml]", "zope.event", "zope.testing"]
+testing = ["coverage[toml]", "zope.event", "zope.testing"]
[[package]]
name = "zstandard"
@@ -10587,4 +10493,4 @@ cffi = ["cffi (>=1.11)"]
[metadata]
lock-version = "2.0"
python-versions = ">=3.10,<3.13"
-content-hash = "259bffdcb68115a512695954dea8058bdc0bcc3770ce79106271ea94c6b5ed40"
+content-hash = "d324192116c4b243e504d57f4605b79c46592a976201d903b16a910b71d84b57"
diff --git a/api/pyproject.toml b/api/pyproject.toml
index b72cc44abb..11bcc255d7 100644
--- a/api/pyproject.toml
+++ b/api/pyproject.toml
@@ -210,7 +210,7 @@ numexpr = "~2.9.0"
opensearch-py = "2.4.0"
qrcode = "~7.4.2"
twilio = "~9.0.4"
-vanna = { version = "0.5.5", extras = ["postgres", "mysql", "clickhouse", "duckdb"] }
+vanna = { version = "0.7.3", extras = ["postgres", "mysql", "clickhouse", "duckdb"] }
wikipedia = "1.4.0"
yfinance = "~0.2.40"
From a34891851bd3dc28c443d4255a955a3bc857e6d0 Mon Sep 17 00:00:00 2001
From: -LAN-
Date: Fri, 11 Oct 2024 10:32:27 +0800
Subject: [PATCH 46/61] fix(log list): prevent duplicate data fetch (#9190)
---
web/app/components/app/log/list.tsx | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/web/app/components/app/log/list.tsx b/web/app/components/app/log/list.tsx
index 149e877fa4..7dff48c20a 100644
--- a/web/app/components/app/log/list.tsx
+++ b/web/app/components/app/log/list.tsx
@@ -299,10 +299,14 @@ function DetailPanel {
- if (appDetail?.id && detail.id && appDetail?.mode !== 'completion')
+ if (appDetail?.id && detail.id && appDetail?.mode !== 'completion' && !fetchInitiated.current) {
+ fetchInitiated.current = true
fetchData()
- }, [appDetail?.id, detail.id, appDetail?.mode])
+ }
+ }, [appDetail?.id, detail.id, appDetail?.mode, fetchData])
const isChatMode = appDetail?.mode !== 'completion'
const isAdvanced = appDetail?.mode === 'advanced-chat'
From cabdb4ef1779a139d464b0495b7ed9874818b81c Mon Sep 17 00:00:00 2001
From: Jyong <76649700+JohnJyong@users.noreply.github.com>
Date: Fri, 11 Oct 2024 10:32:42 +0800
Subject: [PATCH 47/61] fix retrieval resource positon missed (#9155)
Co-authored-by: Bowen Liang
---
api/core/rag/entities/context_entities.py | 4 +++-
api/core/rag/retrieval/dataset_retrieval.py | 3 +++
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/api/core/rag/entities/context_entities.py b/api/core/rag/entities/context_entities.py
index dde3beccf6..cd18ad081f 100644
--- a/api/core/rag/entities/context_entities.py
+++ b/api/core/rag/entities/context_entities.py
@@ -1,3 +1,5 @@
+from typing import Optional
+
from pydantic import BaseModel
@@ -7,4 +9,4 @@ class DocumentContext(BaseModel):
"""
content: str
- score: float
+ score: Optional[float] = None
diff --git a/api/core/rag/retrieval/dataset_retrieval.py b/api/core/rag/retrieval/dataset_retrieval.py
index ae61ba7112..ae79b44158 100644
--- a/api/core/rag/retrieval/dataset_retrieval.py
+++ b/api/core/rag/retrieval/dataset_retrieval.py
@@ -231,6 +231,9 @@ class DatasetRetrieval:
source["content"] = segment.content
retrieval_resource_list.append(source)
if hit_callback and retrieval_resource_list:
+ retrieval_resource_list = sorted(retrieval_resource_list, key=lambda x: x.get("score"), reverse=True)
+ for position, item in enumerate(retrieval_resource_list, start=1):
+ item["position"] = position
hit_callback.return_retriever_resource_info(retrieval_resource_list)
if document_context_list:
document_context_list = sorted(document_context_list, key=lambda x: x.score, reverse=True)
From 5c76131d3dc1e4a5719cc828ba5a485e97024d90 Mon Sep 17 00:00:00 2001
From: Fei He
Date: Fri, 11 Oct 2024 10:35:56 +0800
Subject: [PATCH 48/61] feat: add gte rerank for tongyi (#9153)
---
.../model_providers/tongyi/rerank/__init__.py | 0
.../tongyi/rerank/_position.yaml | 1 +
.../tongyi/rerank/gte-rerank.yaml | 4 +
.../model_providers/tongyi/rerank/rerank.py | 136 ++++++++++++++++++
.../model_providers/tongyi/tongyi.yaml | 1 +
.../model_runtime/tongyi/test_rerank.py | 40 ++++++
6 files changed, 182 insertions(+)
create mode 100644 api/core/model_runtime/model_providers/tongyi/rerank/__init__.py
create mode 100644 api/core/model_runtime/model_providers/tongyi/rerank/_position.yaml
create mode 100644 api/core/model_runtime/model_providers/tongyi/rerank/gte-rerank.yaml
create mode 100644 api/core/model_runtime/model_providers/tongyi/rerank/rerank.py
create mode 100644 api/tests/integration_tests/model_runtime/tongyi/test_rerank.py
diff --git a/api/core/model_runtime/model_providers/tongyi/rerank/__init__.py b/api/core/model_runtime/model_providers/tongyi/rerank/__init__.py
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/api/core/model_runtime/model_providers/tongyi/rerank/_position.yaml b/api/core/model_runtime/model_providers/tongyi/rerank/_position.yaml
new file mode 100644
index 0000000000..439afda992
--- /dev/null
+++ b/api/core/model_runtime/model_providers/tongyi/rerank/_position.yaml
@@ -0,0 +1 @@
+- gte-rerank
diff --git a/api/core/model_runtime/model_providers/tongyi/rerank/gte-rerank.yaml b/api/core/model_runtime/model_providers/tongyi/rerank/gte-rerank.yaml
new file mode 100644
index 0000000000..44d51b9b0d
--- /dev/null
+++ b/api/core/model_runtime/model_providers/tongyi/rerank/gte-rerank.yaml
@@ -0,0 +1,4 @@
+model: gte-rerank
+model_type: rerank
+model_properties:
+ context_size: 4000
diff --git a/api/core/model_runtime/model_providers/tongyi/rerank/rerank.py b/api/core/model_runtime/model_providers/tongyi/rerank/rerank.py
new file mode 100644
index 0000000000..c9245bd82d
--- /dev/null
+++ b/api/core/model_runtime/model_providers/tongyi/rerank/rerank.py
@@ -0,0 +1,136 @@
+from typing import Optional
+
+import dashscope
+from dashscope.common.error import (
+ AuthenticationError,
+ InvalidParameter,
+ RequestFailure,
+ ServiceUnavailableError,
+ UnsupportedHTTPMethod,
+ UnsupportedModel,
+)
+
+from core.model_runtime.entities.rerank_entities import RerankDocument, RerankResult
+from core.model_runtime.errors.invoke import (
+ InvokeAuthorizationError,
+ InvokeBadRequestError,
+ InvokeConnectionError,
+ InvokeError,
+ InvokeRateLimitError,
+ InvokeServerUnavailableError,
+)
+from core.model_runtime.errors.validate import CredentialsValidateFailedError
+from core.model_runtime.model_providers.__base.rerank_model import RerankModel
+
+
+class GTERerankModel(RerankModel):
+ """
+ Model class for GTE rerank model.
+ """
+
+ def _invoke(
+ self,
+ model: str,
+ credentials: dict,
+ query: str,
+ docs: list[str],
+ score_threshold: Optional[float] = None,
+ top_n: Optional[int] = None,
+ user: Optional[str] = None,
+ ) -> RerankResult:
+ """
+ Invoke rerank model
+
+ :param model: model name
+ :param credentials: model credentials
+ :param query: search query
+ :param docs: docs for reranking
+ :param score_threshold: score threshold
+ :param top_n: top n
+ :param user: unique user id
+ :return: rerank result
+ """
+ if len(docs) == 0:
+ return RerankResult(model=model, docs=docs)
+
+ # initialize client
+ dashscope.api_key = credentials["dashscope_api_key"]
+
+ response = dashscope.TextReRank.call(
+ query=query,
+ documents=docs,
+ model=model,
+ top_n=top_n,
+ return_documents=True,
+ )
+
+ rerank_documents = []
+ for _, result in enumerate(response.output.results):
+ # format document
+ rerank_document = RerankDocument(
+ index=result.index,
+ score=result.relevance_score,
+ text=result["document"]["text"],
+ )
+
+ # score threshold check
+ if score_threshold is not None:
+ if result.relevance_score >= score_threshold:
+ rerank_documents.append(rerank_document)
+ else:
+ rerank_documents.append(rerank_document)
+
+ return RerankResult(model=model, docs=rerank_documents)
+
+ def validate_credentials(self, model: str, credentials: dict) -> None:
+ """
+ Validate model credentials
+
+ :param model: model name
+ :param credentials: model credentials
+ :return:
+ """
+ try:
+ self.invoke(
+ model=model,
+ credentials=credentials,
+ query="What is the capital of the United States?",
+ docs=[
+ "Carson City is the capital city of the American state of Nevada. At the 2010 United States "
+ "Census, Carson City had a population of 55,274.",
+ "The Commonwealth of the Northern Mariana Islands is a group of islands in the Pacific Ocean that "
+ "are a political division controlled by the United States. Its capital is Saipan.",
+ ],
+ score_threshold=0.8,
+ )
+ except Exception as ex:
+ print(ex)
+ raise CredentialsValidateFailedError(str(ex))
+
+ @property
+ def _invoke_error_mapping(self) -> dict[type[InvokeError], list[type[Exception]]]:
+ """
+ Map model invoke error to unified error
+ The key is the error type thrown to the caller
+ The value is the error type thrown by the model,
+ which needs to be converted into a unified error type for the caller.
+
+ :return: Invoke error mapping
+ """
+ return {
+ InvokeConnectionError: [
+ RequestFailure,
+ ],
+ InvokeServerUnavailableError: [
+ ServiceUnavailableError,
+ ],
+ InvokeRateLimitError: [],
+ InvokeAuthorizationError: [
+ AuthenticationError,
+ ],
+ InvokeBadRequestError: [
+ InvalidParameter,
+ UnsupportedModel,
+ UnsupportedHTTPMethod,
+ ],
+ }
diff --git a/api/core/model_runtime/model_providers/tongyi/tongyi.yaml b/api/core/model_runtime/model_providers/tongyi/tongyi.yaml
index 1a09c20fd9..6349c22714 100644
--- a/api/core/model_runtime/model_providers/tongyi/tongyi.yaml
+++ b/api/core/model_runtime/model_providers/tongyi/tongyi.yaml
@@ -18,6 +18,7 @@ supported_model_types:
- llm
- tts
- text-embedding
+ - rerank
configurate_methods:
- predefined-model
- customizable-model
diff --git a/api/tests/integration_tests/model_runtime/tongyi/test_rerank.py b/api/tests/integration_tests/model_runtime/tongyi/test_rerank.py
new file mode 100644
index 0000000000..2dcfb92c63
--- /dev/null
+++ b/api/tests/integration_tests/model_runtime/tongyi/test_rerank.py
@@ -0,0 +1,40 @@
+import os
+
+import dashscope
+import pytest
+
+from core.model_runtime.entities.rerank_entities import RerankResult
+from core.model_runtime.errors.validate import CredentialsValidateFailedError
+from core.model_runtime.model_providers.tongyi.rerank.rerank import GTERerankModel
+
+
+def test_validate_credentials():
+ model = GTERerankModel()
+
+ with pytest.raises(CredentialsValidateFailedError):
+ model.validate_credentials(model="get-rank", credentials={"dashscope_api_key": "invalid_key"})
+
+ model.validate_credentials(
+ model="get-rank", credentials={"dashscope_api_key": os.environ.get("TONGYI_DASHSCOPE_API_KEY")}
+ )
+
+
+def test_invoke_model():
+ model = GTERerankModel()
+
+ result = model.invoke(
+ model=dashscope.TextReRank.Models.gte_rerank,
+ credentials={"dashscope_api_key": os.environ.get("TONGYI_DASHSCOPE_API_KEY")},
+ query="什么是文本排序模型",
+ docs=[
+ "文本排序模型广泛用于搜索引擎和推荐系统中,它们根据文本相关性对候选文本进行排序",
+ "量子计算是计算科学的一个前沿领域",
+ "预训练语言模型的发展给文本排序模型带来了新的进展",
+ ],
+ score_threshold=0.7,
+ )
+
+ assert isinstance(result, RerankResult)
+ assert len(result.docs) == 1
+ assert result.docs[0].index == 0
+ assert result.docs[0].score >= 0.7
From 8bcad002dffcf0cb3c06f6240370d331dcad6949 Mon Sep 17 00:00:00 2001
From: Wu Tianwei <30284043+WTW0313@users.noreply.github.com>
Date: Fri, 11 Oct 2024 11:22:59 +0800
Subject: [PATCH 49/61] fix: add loading to 'delete' button & 'save' button
(#9214)
---
web/app/components/datasets/documents/list.tsx | 6 ++++++
web/app/components/datasets/settings/form/index.tsx | 2 ++
2 files changed, 8 insertions(+)
diff --git a/web/app/components/datasets/documents/list.tsx b/web/app/components/datasets/documents/list.tsx
index 540474e7a5..0e0eebb034 100644
--- a/web/app/components/datasets/documents/list.tsx
+++ b/web/app/components/datasets/documents/list.tsx
@@ -122,6 +122,7 @@ export const OperationAction: FC<{
}> = ({ embeddingAvailable, datasetId, detail, onUpdate, scene = 'list', className = '' }) => {
const { id, enabled = false, archived = false, data_source_type } = detail || {}
const [showModal, setShowModal] = useState(false)
+ const [deleting, setDeleting] = useState(false)
const { notify } = useContext(ToastContext)
const { t } = useTranslation()
const router = useRouter()
@@ -153,6 +154,7 @@ export const OperationAction: FC<{
break
default:
opApi = deleteDocument
+ setDeleting(true)
break
}
const [e] = await asyncRunSafe(opApi({ datasetId, documentId: id }) as Promise)
@@ -160,6 +162,8 @@ export const OperationAction: FC<{
notify({ type: 'success', message: t('common.actionMsg.modifiedSuccessfully') })
else
notify({ type: 'error', message: t('common.actionMsg.modifiedUnsuccessfully') })
+ if (operationName === 'delete')
+ setDeleting(false)
onUpdate(operationName)
}
@@ -295,6 +299,8 @@ export const OperationAction: FC<{
{showModal
&& {