| | |
| | | from app.service.dialog import get_session_history |
| | | from app.service.ragflow import RagflowService |
| | | from app.service.service_token import get_ragflow_token, get_bisheng_token |
| | | from app.task.fetch_agent import initialize_agents |
| | | # from app.task.fetch_agent import initialize_agents |
| | | |
| | | router = APIRouter() |
| | | |
| | |
| | | # -*- coding: utf-8 -*- |
| | | import json |
| | | |
| | | from fastapi import APIRouter, Depends |
| | |
| | | return Response(code=400, msg=str(e)) |
| | | try: |
| | | file_upload = await dify_service.upload(token, f.filename, file_content, current_user.id) |
| | | if not file_upload: |
| | | raise HTTPException(status_code=500, detail="上传文件出错") |
| | | try: |
| | | tokens = await read_file(file_content, f.filename, f.content_type) |
| | | file_upload["tokens"] = tokens |
| | |
| | | import os.path |
| | | import os.path |
| | | import re |
| | | import uuid |
| | | import base64 |