Skip to content

Commit

Permalink
fix: minimax tests (#1313)
Browse files Browse the repository at this point in the history
  • Loading branch information
takatost authored Oct 11, 2023
1 parent 7f6ad96 commit ff493d0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 69 deletions.
37 changes: 0 additions & 37 deletions .github/workflows/check_no_chinese_comments.py

This file was deleted.

31 changes: 0 additions & 31 deletions .github/workflows/check_no_chinese_comments.yml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
from unittest.mock import patch
import json

from langchain.schema import ChatResult, ChatGeneration, AIMessage

from core.model_providers.providers.base import CredentialsValidateFailedError
from core.model_providers.providers.minimax_provider import MinimaxProvider
from models.provider import ProviderType, Provider
Expand All @@ -24,7 +26,8 @@ def decrypt_side_effect(tenant_id, encrypted_key):


def test_is_provider_credentials_valid_or_raise_valid(mocker):
mocker.patch('langchain.llms.minimax.Minimax._call', return_value='abc')
mocker.patch('core.third_party.langchain.llms.minimax_llm.MinimaxChatLLM._generate',
return_value=ChatResult(generations=[ChatGeneration(message=AIMessage(content='abc'))]))

MODEL_PROVIDER_CLASS.is_provider_credentials_valid_or_raise(VALIDATE_CREDENTIAL)

Expand Down

0 comments on commit ff493d0

Please sign in to comment.