Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

enhance: use urllib join instead of fstring (#9549)

Byron.wang37fea072bc11
diff --git a/README.md b/README.md
index 75094d39dbf..f6d14bb840c 100644
--- a/README.md
+++ b/README.md
@@ -168,7 +168,7 @@ Star Dify on GitHub and be instantly notified of new releases.
> Before installing Dify, make sure your machine meets the following minimum system requirements:
>
>- CPU >= 2 Core
->- RAM >= 4GB
+>- RAM >= 4 GiB
</br>
diff --git a/README_CN.md b/README_CN.md
index 4553524ce53..689f98ccf47 100644
--- a/README_CN.md
+++ b/README_CN.md
@@ -174,7 +174,7 @@ Dify 是一个开源的 LLM 应用开发平台。其直观的界面结合了 AI
在安装 Dify 之前,请确保您的机器满足以下最低系统要求:
- CPU >= 2 Core
-- RAM >= 4GB
+- RAM >= 4 GiB
### 快速启动
diff --git a/api/services/enterprise/base.py b/api/services/enterprise/base.py
index 7d4fdfd2d03..380051b40d8 100644
--- a/api/services/enterprise/base.py
+++ b/api/services/enterprise/base.py
@@ -1,4 +1,5 @@
import os
+from urllib.parse import urljoin
import requests
@@ -15,8 +16,7 @@ class EnterpriseRequest:
@classmethod
def send_request(cls, method, endpoint, json=None, params=None):
headers = {"Content-Type": "application/json", "Enterprise-Api-Secret-Key": cls.secret_key}
-
- url = f"{cls.base_url}{endpoint}"
+ url = urljoin(cls.base_url, endpoint)
response = requests.request(method, url, json=json, params=params, headers=headers, proxies=cls.proxies)
return response.json()
diff --git a/api/tests/unit_tests/core/model_runtime/model_providers/wenxin/test_text_embedding.py b/api/tests/unit_tests/core/model_runtime/model_providers/wenxin/test_text_embedding.py
index 5b159b49b61..a301f56d75c 100644
--- a/api/tests/unit_tests/core/model_runtime/model_providers/wenxin/test_text_embedding.py
+++ b/api/tests/unit_tests/core/model_runtime/model_providers/wenxin/test_text_embedding.py
@@ -1,3 +1,5 @@
+import string
+
import numpy as np
from core.model_runtime.entities.text_embedding_entities import TextEmbeddingResult
@@ -31,7 +33,7 @@ def test_max_chunks():
max_chunks = embedding_model._get_max_chunks(model, credentials)
embedding_model._create_text_embedding = _create_text_embedding
- texts = ["0123456789" for i in range(0, max_chunks * 2)]
+ texts = [string.digits for i in range(0, max_chunks * 2)]
result: TextEmbeddingResult = embedding_model.invoke(model, credentials, texts, "test")
assert len(result.embeddings) == max_chunks * 2