mirror of
http://112.124.100.131/huang.ze/ebiz-dify-ai.git
synced 2025-12-16 06:16:53 +08:00
Fix variable typo (#8084)
This commit is contained in:
@@ -8,11 +8,11 @@ from core.model_runtime.entities.llm_entities import LLMResult, LLMResultChunk,
|
||||
from core.model_runtime.entities.message_entities import AssistantPromptMessage, SystemPromptMessage, UserPromptMessage
|
||||
from core.model_runtime.entities.model_entities import AIModelEntity
|
||||
from core.model_runtime.errors.validate import CredentialsValidateFailedError
|
||||
from core.model_runtime.model_providers.baichuan.llm.llm import BaichuanLarguageModel
|
||||
from core.model_runtime.model_providers.baichuan.llm.llm import BaichuanLanguageModel
|
||||
|
||||
|
||||
def test_predefined_models():
|
||||
model = BaichuanLarguageModel()
|
||||
model = BaichuanLanguageModel()
|
||||
model_schemas = model.predefined_models()
|
||||
assert len(model_schemas) >= 1
|
||||
assert isinstance(model_schemas[0], AIModelEntity)
|
||||
@@ -20,7 +20,7 @@ def test_predefined_models():
|
||||
|
||||
def test_validate_credentials_for_chat_model():
|
||||
sleep(3)
|
||||
model = BaichuanLarguageModel()
|
||||
model = BaichuanLanguageModel()
|
||||
|
||||
with pytest.raises(CredentialsValidateFailedError):
|
||||
model.validate_credentials(
|
||||
@@ -38,7 +38,7 @@ def test_validate_credentials_for_chat_model():
|
||||
|
||||
def test_invoke_model():
|
||||
sleep(3)
|
||||
model = BaichuanLarguageModel()
|
||||
model = BaichuanLanguageModel()
|
||||
|
||||
response = model.invoke(
|
||||
model="baichuan2-turbo",
|
||||
@@ -64,7 +64,7 @@ def test_invoke_model():
|
||||
|
||||
def test_invoke_model_with_system_message():
|
||||
sleep(3)
|
||||
model = BaichuanLarguageModel()
|
||||
model = BaichuanLanguageModel()
|
||||
|
||||
response = model.invoke(
|
||||
model="baichuan2-turbo",
|
||||
@@ -93,7 +93,7 @@ def test_invoke_model_with_system_message():
|
||||
|
||||
def test_invoke_stream_model():
|
||||
sleep(3)
|
||||
model = BaichuanLarguageModel()
|
||||
model = BaichuanLanguageModel()
|
||||
|
||||
response = model.invoke(
|
||||
model="baichuan2-turbo",
|
||||
@@ -122,7 +122,7 @@ def test_invoke_stream_model():
|
||||
|
||||
def test_invoke_with_search():
|
||||
sleep(3)
|
||||
model = BaichuanLarguageModel()
|
||||
model = BaichuanLanguageModel()
|
||||
|
||||
response = model.invoke(
|
||||
model="baichuan2-turbo",
|
||||
@@ -156,7 +156,7 @@ def test_invoke_with_search():
|
||||
|
||||
def test_get_num_tokens():
|
||||
sleep(3)
|
||||
model = BaichuanLarguageModel()
|
||||
model = BaichuanLanguageModel()
|
||||
|
||||
response = model.get_num_tokens(
|
||||
model="baichuan2-turbo",
|
||||
|
||||
@@ -155,7 +155,7 @@ def test_invoke_chat_model_with_vision_multi_pics(setup_google_mock):
|
||||
user="abc-123",
|
||||
)
|
||||
|
||||
print(f"resultz: {result.message.content}")
|
||||
print(f"result: {result.message.content}")
|
||||
assert isinstance(result, LLMResult)
|
||||
assert len(result.message.content) > 0
|
||||
|
||||
|
||||
@@ -109,7 +109,7 @@ def test_invoke_stream_chat_model(setup_openai_mock, setup_xinference_mock):
|
||||
|
||||
|
||||
"""
|
||||
Funtion calling of xinference does not support stream mode currently
|
||||
Function calling of xinference does not support stream mode currently
|
||||
"""
|
||||
# def test_invoke_stream_chat_model_with_functions():
|
||||
# model = XinferenceAILargeLanguageModel()
|
||||
|
||||
@@ -31,5 +31,5 @@ class PGVectoRSVectorTest(AbstractVectorTest):
|
||||
assert len(ids) == 1
|
||||
|
||||
|
||||
def test_pgvecot_rs(setup_mock_redis):
|
||||
def test_pgvecto_rs(setup_mock_redis):
|
||||
PGVectoRSVectorTest().run_all_tests()
|
||||
|
||||
Reference in New Issue
Block a user