zhaoqingang
2025-04-08 0650b889a36d9b9fd42415b9b9819676f839ae9b
app/service/v2/app_driver/chat_base.py
@@ -22,19 +22,33 @@
    @staticmethod
    async def http_post(url, data, headers, timeout=300):
        async with httpx.AsyncClient(timeout=timeout) as client:
            response = client.post(url, json=data, headers=headers)
            response = await client.post(url, json=data, headers=headers)
            return response
    @staticmethod
    async def http_get(url, params, headers, timeout=300):
        async with httpx.AsyncClient(timeout=timeout) as client:
            response = client.get(url, params=params, headers=headers)
            response = await client.get(url, params=params, headers=headers)
            return response
    @staticmethod
    async def http_put(url, data, headers, timeout=300):
        async with httpx.AsyncClient(timeout=timeout) as client:
            response = await client.put(url, json=data, headers=headers)
            return response
    @staticmethod
    async def http_upload_file(url, data, files, headers, timeout=300):
        async with httpx.AsyncClient(timeout=timeout) as client:
            response = await client.post(url, headers=headers, files=files, data=data)
            return response
    @staticmethod
    async def get_headers(token):
        headers = {
            # 'Content-Type': 'application/json',
        return {
            'Content-Type': 'application/json',
            'Authorization': f'Bearer {token}'
        }