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.

improve: CI experience (#5168)

Yeuolye8afc416dd18
diff --git a/api/tests/integration_tests/model_runtime/__mock/anthropic.py b/api/tests/integration_tests/model_runtime/__mock/anthropic.py
index 037501c4108..3326f874b09 100644
--- a/api/tests/integration_tests/model_runtime/__mock/anthropic.py
+++ b/api/tests/integration_tests/model_runtime/__mock/anthropic.py
@@ -1,6 +1,5 @@
import os
from collections.abc import Iterable
-from time import sleep
from typing import Any, Literal, Union
import anthropic
@@ -64,7 +63,6 @@ class MockAnthropicClass:
index = 0
for i in range(0, len(full_response_text)):
- sleep(0.1)
yield ContentBlockDeltaEvent(
type='content_block_delta',
delta=TextDelta(text=full_response_text[i], type='text_delta'),
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 35a93b24895..c5af941d1ef 100644
--- a/api/tests/integration_tests/model_runtime/__mock/openai_chat.py
+++ b/api/tests/integration_tests/model_runtime/__mock/openai_chat.py
@@ -1,7 +1,7 @@
import re
from collections.abc import Generator
from json import dumps, loads
-from time import sleep, time
+from time import time
# import monkeypatch
from typing import Any, Literal, Optional, Union
@@ -112,7 +112,6 @@ class MockChatClass:
if not function_call:
tool_calls = MockChatClass.generate_tool_calls(tools=tools)
- sleep(1)
return _ChatCompletion(
id='cmpl-3QJQa5jXJ5Z5X',
choices=[
@@ -151,7 +150,6 @@ class MockChatClass:
full_text = "Hello, world!\n\n```python\nprint('Hello, world!')\n```"
for i in range(0, len(full_text) + 1):
- sleep(0.1)
if i == len(full_text):
yield ChatCompletionChunk(
id='cmpl-3QJQa5jXJ5Z5X',
diff --git a/api/tests/integration_tests/model_runtime/__mock/openai_completion.py b/api/tests/integration_tests/model_runtime/__mock/openai_completion.py
index ec0f306aa37..b0d26759055 100644
--- a/api/tests/integration_tests/model_runtime/__mock/openai_completion.py
+++ b/api/tests/integration_tests/model_runtime/__mock/openai_completion.py
@@ -1,6 +1,6 @@
import re
from collections.abc import Generator
-from time import sleep, time
+from time import time
# import monkeypatch
from typing import Any, Literal, Optional, Union
@@ -20,7 +20,6 @@ class MockCompletionsClass:
def mocked_openai_completion_create_sync(
model: str
) -> CompletionMessage:
- sleep(1)
return CompletionMessage(
id="cmpl-3QJQa5jXJ5Z5X",
object="text_completion",
@@ -48,7 +47,6 @@ class MockCompletionsClass:
) -> Generator[CompletionMessage, None, None]:
full_text = "Hello, world!\n\n```python\nprint('Hello, world!')\n```"
for i in range(0, len(full_text) + 1):
- sleep(0.1)
if i == len(full_text):
yield CompletionMessage(
id="cmpl-3QJQa5jXJ5Z5X",