# coding: utf-8

"""
    XingChen 开放接口定义

    No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)

    The version of the OpenAPI document: v2
    Generated by OpenAPI Generator (https://openapi-generator.tech)

    Do not edit the class manually.
"""  # noqa: E501


import unittest

import requests

from xingchen import Configuration, ApiClient, ChatReqParams, CharacterKey, Message, AdvancedSettings, Scenario
from xingchen.api.chat_api_sub import ChatApiSub  # noqa: E501


class TestChatApiSub(unittest.TestCase):
    """ChatApiSub unit test stubs"""
    def setUp(self) -> None:
        configuration = Configuration(
            host="https://pre-xingchen.aliyun.com",
        )
        result = requests.get("https://alimt-plugins.alibaba.com/api/auth/refresh?token=0aSUXbPxRzEeIXU7")
        access_token = result.content.decode("utf-8")
        print(access_token)
        configuration.access_token = access_token
        with ApiClient(configuration) as api_client:
            self.api = ChatApiSub(api_client)  # noqa: E501

    def tearDown(self) -> None:
        pass

    def test_chat(self) -> None:
        """Test case for chat

        用户对话  # noqa: E501
        """
        chat_req_params = {
            "botProfile": {
                "characterId": "77d0e93e1ce240f582c46d0b812a558a", "version": 1
            },
            "advancedSettings": {
                "enableWebSearch": True,
                "enableCharacterKbSearch": True,
                "enableLongTermMemory": True,
                "enableDebug": False
            },
            "modelParameters": {
                "modelName": "", "topP": 0.8, "topK": 100, "seed": 1234
            },
            "userProfile": {
                "userId": "123456789", "userName": "云账号名称", "basicInfo": ""
            },
            "scenario": {
                "description": "我是赵云，想拜关云长为二哥"
            },
            "messages": [
                {
                    "role": "user", "name": "小明", "content": "你有几个兄弟"
                }
            ]
        }  # ChatReqParams | 对话请求
        api_response = self.api.chat(chat_req_params)
        print("The response of ChatApiSub->chat:\n")
        print(api_response)
        pass

    def test_chat_v2(self) -> None:
        """Test case for chat_v2

        用户对话v2  # noqa: E501
        """
        pass

    def test_custom_chat(self) -> None:
        """Test case for custom_chat

        用户对话  # noqa: E501
        """
        pass

    def test_custom_chat1(self) -> None:
        """Test case for custom_chat1

        用户对话  # noqa: E501
        """
        pass


if __name__ == '__main__':
    unittest.main()
