mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-13 16:09:00 +08:00
enhance: use urllib join instead of fstring (#9549)
This commit is contained in:
parent
31a603e905
commit
37fea072bc
@ -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:
|
> Before installing Dify, make sure your machine meets the following minimum system requirements:
|
||||||
>
|
>
|
||||||
>- CPU >= 2 Core
|
>- CPU >= 2 Core
|
||||||
>- RAM >= 4GB
|
>- RAM >= 4 GiB
|
||||||
|
|
||||||
</br>
|
</br>
|
||||||
|
|
||||||
|
@ -174,7 +174,7 @@ Dify 是一个开源的 LLM 应用开发平台。其直观的界面结合了 AI
|
|||||||
在安装 Dify 之前,请确保您的机器满足以下最低系统要求:
|
在安装 Dify 之前,请确保您的机器满足以下最低系统要求:
|
||||||
|
|
||||||
- CPU >= 2 Core
|
- CPU >= 2 Core
|
||||||
- RAM >= 4GB
|
- RAM >= 4 GiB
|
||||||
|
|
||||||
### 快速启动
|
### 快速启动
|
||||||
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import os
|
import os
|
||||||
|
from urllib.parse import urljoin
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
@ -15,8 +16,7 @@ class EnterpriseRequest:
|
|||||||
@classmethod
|
@classmethod
|
||||||
def send_request(cls, method, endpoint, json=None, params=None):
|
def send_request(cls, method, endpoint, json=None, params=None):
|
||||||
headers = {"Content-Type": "application/json", "Enterprise-Api-Secret-Key": cls.secret_key}
|
headers = {"Content-Type": "application/json", "Enterprise-Api-Secret-Key": cls.secret_key}
|
||||||
|
url = urljoin(cls.base_url, endpoint)
|
||||||
url = f"{cls.base_url}{endpoint}"
|
|
||||||
response = requests.request(method, url, json=json, params=params, headers=headers, proxies=cls.proxies)
|
response = requests.request(method, url, json=json, params=params, headers=headers, proxies=cls.proxies)
|
||||||
|
|
||||||
return response.json()
|
return response.json()
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
import string
|
||||||
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
|
||||||
from core.model_runtime.entities.text_embedding_entities import TextEmbeddingResult
|
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)
|
max_chunks = embedding_model._get_max_chunks(model, credentials)
|
||||||
embedding_model._create_text_embedding = _create_text_embedding
|
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")
|
result: TextEmbeddingResult = embedding_model.invoke(model, credentials, texts, "test")
|
||||||
assert len(result.embeddings) == max_chunks * 2
|
assert len(result.embeddings) == max_chunks * 2
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user