zhaoqingang
2025-02-10 48e33c7fbd6969d05b2affda0321595d2d6b370a
app/service/v2/app_driver/chat_data.py
@@ -47,6 +47,12 @@
        password = RagflowCrypto(settings.PUBLIC_KEY, settings.PRIVATE_KEY).encrypt(password)
        return password
    @staticmethod
    async def get_chat_headers(token):
        return {
            'Content-Type': 'application/json',
            'Authorization': token
        }
@@ -69,9 +75,14 @@
            'Content-Type': 'application/json',
            'Authorization': f"Bearer {token}"
        }
        ans = await chat.chat_parameters(url, params, headers)
        print(ans)
        # ans = await chat.chat_parameters(url, params, headers)
        # print(ans)
        ping_url = "http://192.168.20.119:13002/console/api/workspaces"
        user_token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoiNzBhNWVhZWYtYzU4Yi00YTE0LTliOGQtYWE2MzY0ZmE1ZDE3IiwiZXhwIjoxNzM5MjU2MDMyLCJpc3MiOiJTRUxGX0hPU1RFRCIsInN1YiI6IkNvbnNvbGUgQVBJIFBhc3Nwb3J0In0.tlxdRIVL2Ewgb0V4M5pj6v_U2yyvQxtCDrbvSxLjUBs"
        token = "Bearer {}"
        res = await chat.chat_ping(ping_url, {}, await chat.get_chat_headers(token.format(user_token)))
        print(res)
    import asyncio