zhaoqingang
2024-11-11 c1768114de381e37e272e9faf7db8e95a93ff381
app/service/ragflow.py
@@ -1,7 +1,5 @@
import httpx
from typing import Union, Dict, List
from Tools.scripts.objgraph import ignore
from fastapi import HTTPException
from starlette import status
@@ -152,10 +150,7 @@
        url = f"{self.base_url}/v1/tenant/{tenant_id}/user"
        headers = {"Authorization": token}
        data = {"email": email, "user_id": user_id}
        print(url)
        print(data)
        async with httpx.AsyncClient(timeout=60) as client:
            response = await client.post(url, headers=headers, json=data)
            print(response.text)
            if response.status_code != 200:
                raise Exception(f"Ragflow add user to tenant failed: {response.text}")