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V8mnt7XbYNrBYl46mlQ"

from unittest import TestCase
from unittest.mock import patch, Mock
import falconai

class TestChat(TestCase): 

    # @patch("falconai.core.requests.requests.post")
    async def test_chat_response(self):
        # Mocking the response from the chat API
        # mock_response = Mock()
        # mock_response.json.return_value = {"response": "Test response"}
        # mock_post.return_value = mock_response
        
        
        response = await falconai.models.chat(
            query="Write a story about Pakistan",
            model_name="Falcon40B",
            app_type="web",
            params={
                "temperature": 1,
                "stop": ["\n\n"],
                "max_new_tokens": 900,
                "top_p": 1
            },
            context=""
        )
        
        self.assertEqual(response, {"response": "Test response"})
