| | |
| | | if db_user: |
| | | return Response(code=200, msg="Username already registered") |
| | | |
| | | bisheng_service = BishengService(settings.sgb_base_url) |
| | | # bisheng_service = BishengService(settings.sgb_base_url) |
| | | ragflow_service = RagflowService(settings.fwr_base_url) |
| | | |
| | | # 注册到毕昇 |
| | | try: |
| | | bisheng_info = await bisheng_service.register(user.username, user.password) |
| | | except Exception as e: |
| | | return Response(code=500, msg=f"Failed to register with Bisheng: {str(e)}") |
| | | # try: |
| | | # bisheng_info = await bisheng_service.register(user.username, user.password) |
| | | # except Exception as e: |
| | | # return Response(code=500, msg=f"Failed to register with Bisheng: {str(e)}") |
| | | |
| | | # 注册到ragflow |
| | | try: |
| | |
| | | |
| | | # 存储用户信息 |
| | | hashed_password = pwd_context.hash(user.password) |
| | | db_user = UserModel(username=user.username, hashed_password=hashed_password, email=ragflow_info.get("email", f"{user.username}@example.com"),ragflow_id=ragflow_info.get("id"),bisheng_id=bisheng_info.get("user_id")) |
| | | db_user = UserModel(username=user.username, hashed_password=hashed_password, email=ragflow_info.get("email", f"{user.username}@example.com"),ragflow_id=ragflow_info.get("id"),bisheng_id="") |
| | | db_user.password = db_user.encrypted_password(user.password) |
| | | db.add(db_user) |
| | | db.commit() |
| | |
| | | if not user: |
| | | return Response(code=400, msg="Incorrect username or password") |
| | | |
| | | bisheng_service = BishengService(settings.sgb_base_url) |
| | | # bisheng_service = BishengService(settings.sgb_base_url) |
| | | ragflow_service = RagflowService(settings.fwr_base_url) |
| | | |
| | | # 登录到毕昇 |
| | | try: |
| | | bisheng_token = await bisheng_service.login(login_data.username, login_data.password) |
| | | except Exception as e: |
| | | return Response(code=500, msg=f"Failed to login with Bisheng: {str(e)}") |
| | | # try: |
| | | # bisheng_token = await bisheng_service.login(login_data.username, login_data.password) |
| | | # except Exception as e: |
| | | # return Response(code=500, msg=f"Failed to login with Bisheng: {str(e)}") |
| | | |
| | | # 登录到ragflow |
| | | try: |
| | |
| | | # 创建本地token |
| | | access_token = create_access_token(data={"sub": user.username, "user_id": user.id}) |
| | | |
| | | upsert_token(db, user.id, access_token, bisheng_token, ragflow_token) |
| | | upsert_token(db, user.id, access_token, "bisheng_token", ragflow_token) |
| | | # print(111) |
| | | return Response(code=200, msg="Login successful", data={ |
| | | "access_token": access_token, |
| | |
| | | from Log import logger |
| | | from app.api import get_current_user_websocket |
| | | from app.config.config import settings |
| | | from app.config.const import IMAGE_TO_TEXT, DOCUMENT_TO_REPORT, DOCUMENT_TO_CLEANING |
| | | from app.config.const import IMAGE_TO_TEXT, DOCUMENT_TO_REPORT, DOCUMENT_TO_CLEANING, DOCUMENT_IA_QUESTIONS |
| | | from app.models import MenuCapacityModel |
| | | from app.models.agent_model import AgentModel, AgentType |
| | | from app.models.base_model import get_db |
| | |
| | | else: |
| | | agent_type = agent.capacity_type |
| | | chat_type = agent.chat_type |
| | | # print(agent_type) |
| | | # print(chat_type) |
| | | if not agent: |
| | | ret = {"message": "Agent not found", "type": "close"} |
| | | await websocket.send_json(ret) |
| | |
| | | # complete_response = "" |
| | | |
| | | answer_str = "" |
| | | async for rag_response in dify_service.chat(token, current_user.id, question, upload_file_id, |
| | | files = [] |
| | | if upload_file_id: |
| | | files.append({ |
| | | "type": "image", |
| | | "transfer_method": "local_file", |
| | | "url": "", |
| | | "upload_file_id": upload_file_id |
| | | }) |
| | | async for rag_response in dify_service.chat(token, current_user.id, question, files, |
| | | conversation_id): |
| | | # print(rag_response) |
| | | try: |
| | |
| | | result = {"message": f"内部错误: {e2}", "type": "close"} |
| | | await websocket.send_json(result) |
| | | print(f"Error process message of ragflow: {e2}") |
| | | elif chat_type == "documentIa": |
| | | # print(122112) |
| | | token = DfTokenDao(db).get_token_by_id(DOCUMENT_IA_QUESTIONS) |
| | | # print(token) |
| | | if not token: |
| | | await websocket.send_json({"message": "Invalid token", "type": "error"}) |
| | | |
| | | while True: |
| | | conversation_id = "" |
| | | # print(4343) |
| | | receive_message = await websocket.receive_json() |
| | | print(f"Received from client {chat_id}: {receive_message}") |
| | | upload_file_id = receive_message.get('upload_file_id', []) |
| | | question = receive_message.get('message', "") |
| | | if not question and not image_url: |
| | | await websocket.send_json({"message": "Invalid request", "type": "error"}) |
| | | continue |
| | | try: |
| | | session = SessionService(db).create_session( |
| | | chat_id, |
| | | question, |
| | | agent_id, |
| | | AgentType.DIFY, |
| | | current_user.id |
| | | ) |
| | | conversation_id = session.conversation_id |
| | | except Exception as e: |
| | | logger.error(e) |
| | | # complete_response = "" |
| | | files = [] |
| | | for fileId in upload_file_id: |
| | | files.append({ |
| | | "type": "document", |
| | | "transfer_method": "local_file", |
| | | "url": "", |
| | | "upload_file_id": fileId |
| | | }) |
| | | |
| | | answer_str = "" |
| | | complete_response = "" |
| | | async for rag_response in dify_service.chat(token, current_user.id, question, files, |
| | | conversation_id): |
| | | # print(rag_response) |
| | | try: |
| | | if rag_response[:5] == "data:": |
| | | # 如果是,则截取掉前5个字符,并去除首尾空白符 |
| | | complete_response = rag_response[5:].strip() |
| | | elif "event: ping" in rag_response: |
| | | continue |
| | | else: |
| | | # 否则,保持原样 |
| | | complete_response += rag_response |
| | | try: |
| | | data = json.loads(complete_response) |
| | | if data.get("event") == "node_started" or data.get( |
| | | "event") == "node_finished": # "event": "message_end" |
| | | if "data" not in data or not data["data"]: # 信息过滤 |
| | | logger.error("非法数据--------------------") |
| | | logger.error(data) |
| | | continue |
| | | else: # 正常输出 |
| | | answer = data.get("data", "") |
| | | if isinstance(answer, str): |
| | | logger.error("----------------未知数据--------------------") |
| | | logger.error(data) |
| | | continue |
| | | elif isinstance(answer, dict): |
| | | |
| | | message = answer.get("title", "") |
| | | |
| | | result = {"message": message, "type": "system"} |
| | | continue |
| | | elif data.get("event") == "message": # "event": "message_end" |
| | | # 正常输出 |
| | | answer = data.get("answer", "") |
| | | result = {"message": answer, "type": "message"} |
| | | elif data.get("event") == "workflow_finished": |
| | | answer = data.get("data", "") |
| | | if isinstance(answer, str): |
| | | logger.error("----------------未知数据--------------------") |
| | | logger.error(data) |
| | | result = {"message": "", "type": "close", "download_url": ""} |
| | | elif isinstance(answer, dict): |
| | | download_url = "" |
| | | outputs = answer.get("outputs", {}) |
| | | if outputs: |
| | | message = outputs.get("answer", "") |
| | | # download_url = outputs.get("download_url", "") |
| | | else: |
| | | message = answer.get("error", "") |
| | | |
| | | # result = {"message": message, "type": "message", |
| | | # "download_url": download_url} |
| | | try: |
| | | SessionService(db).update_session(chat_id, |
| | | message={"role": "assistant", |
| | | "content": { |
| | | "answer": message, |
| | | "download_url": download_url}}, |
| | | conversation_id=data.get( |
| | | "conversation_id")) |
| | | except Exception as e: |
| | | logger.error("保存dify的会话异常!") |
| | | logger.error(e) |
| | | # await websocket.send_json(result) |
| | | continue |
| | | elif data.get("event") == "message_end": |
| | | result = {"message": "", "type": "close"} |
| | | |
| | | else: |
| | | continue |
| | | try: |
| | | await websocket.send_json(result) |
| | | except Exception as e: |
| | | logger.error(e) |
| | | logger.error("返回客户端消息异常!") |
| | | complete_response = "" |
| | | except json.JSONDecodeError as e: |
| | | print(f"Error decoding JSON: {e}") |
| | | # print(f"Response text: {text}") |
| | | except Exception as e2: |
| | | result = {"message": f"内部错误: {e2}", "type": "close"} |
| | | await websocket.send_json(result) |
| | | print(f"Error process message of ragflow: {e2}") |
| | | |
| | | # 启动任务处理客户端消息 |
| | | tasks = [ |
| | |
| | | db_role = db.query(RoleModel).filter(RoleModel.name == role.roleName).first() |
| | | if db_role and db_role.id != role.roleId: |
| | | return Response(code=200, msg="role already created") |
| | | is_edit = await edit_role_resource(db, role.roleId,role.roleName, role.remark, role.roleKey, role.dataScope, role.resources, role.editType) |
| | | is_edit = await edit_role_resource(db, role.roleId,role.roleName, role.remark, role.roleKey, role.dataScope, role.resources, role.editType, role.depts) |
| | | if not is_edit: |
| | | return Response(code=500, msg="role edit failure", data={}) |
| | | return Response(code=200, msg="role edit successfully", data={}) |
| | |
| | | from fastapi import APIRouter, Depends |
| | | from app.api import Response, pwd_context, get_current_user, ResponseList |
| | | from app.models.base_model import get_db |
| | | from app.models.user import PageParameter, UserStatus, UserInfo, LoginData, UserPassword |
| | | from app.models.user import PageParameter, UserStatus, UserInfo, LoginData, UserPassword, UserDept |
| | | from app.models.user_model import UserModel |
| | | from app.service.auth import is_valid_password, verify_password |
| | | from app.service.user import get_user_list, edit_user_status, delete_user_data, create_user, edit_user_data, \ |
| | | edit_user_pwd, get_user_info, get_user_routers, get_user_menus, get_user_permission, get_user_dept, change_user_pwd, \ |
| | | user_data_service |
| | | user_data_service, edit_user_dept |
| | | |
| | | user_router = APIRouter() |
| | | |
| | |
| | | if not user_info: |
| | | return Response(code=500, msg="user get failure", data={}) |
| | | return Response(code=200, msg="successfully", data=user_info) |
| | | |
| | | |
| | | |
| | | @user_router.put("/dept", response_model=Response) |
| | | async def edit_user(user: UserDept, current_user: UserModel = Depends(get_current_user), db=Depends(get_db)): |
| | | user_info = db.query(UserModel).filter(UserModel.id == user.userId).first() |
| | | if not user_info: |
| | | return Response(code=400, msg="user does not exist") |
| | | is_edit = await edit_user_dept(db, user.userId, user.depts) |
| | | if not is_edit: |
| | | return Response(code=500, msg="user edit failure", data={}) |
| | | return Response(code=200, msg="user edit successfully", data={}) |
| | |
| | | DOCUMENT_TO_CLEANING = "document_to_cleaning" |
| | | DOCUMENT_TO_REPORT = "document_to_report" |
| | | IMAGE_TO_TEXT = "image_and_text_conversion" |
| | | DOCUMENT_IA_QUESTIONS = "document_ia_questions" |
| | | |
| | | |
| | | ### -----------app register -------------- |
| | |
| | | name = Column(String(255)) # 名称 |
| | | description = Column(Text) # 说明 |
| | | icon = Column(Text, default="intelligentFrame1") # 图标 |
| | | status = Column(String(1), default="1") # 状态 |
| | | status = Column(String(1), default="0") # 状态 |
| | | dialog_type = Column(String(1)) # 平台 |
| | | # agent_id = Column(String(36)) |
| | | mode = Column(String(36)) |
| | |
| | | |
| | | return json |
| | | |
| | | def to_base_json(self): |
| | | json = { |
| | | 'deptId': self.id, |
| | | 'deptName': self.name, |
| | | 'address': self.address, |
| | | 'code': self.code, |
| | | 'iconCls': self.iconcls, |
| | | 'orderNum': self.seq, |
| | | 'leader': self.leader, |
| | | 'phone': self.phone, |
| | | 'email': self.email, |
| | | 'status': self.status |
| | | } |
| | | |
| | | return json |
| | | |
| | | |
| | | def role_json(self, role): |
| | | return { |
| | |
| | | seq = Column(Integer) |
| | | roleKey = Column(String(100)) |
| | | dataScope = Column(Integer) |
| | | status = Column(String(10), default="0") |
| | | status = Column(String(10), default="1") |
| | | creator = Column(Integer) |
| | | role_type = Column(Integer, default=1) |
| | | |
| | |
| | | 'dataScope': self.dataScope |
| | | } |
| | | |
| | | if len(self.resources) > 0: |
| | | # if len(self.resources) > 0: |
| | | json['resources'] = [resource.to_json() for resource in self.resources] |
| | | |
| | | if hasattr(self, 'flag'): |
| | | json['flag'] = self.flag |
| | | json['dept'] = [dept.to_base_json() for dept in self.organizations] |
| | | |
| | | return json |
| | | |
| | |
| | | roleKey: Optional[str] = "" |
| | | dataScope: Optional[int] = 0 |
| | | editType: int |
| | | depts: Optional[list] = [] |
| | |
| | | oldPassword: str |
| | | |
| | | |
| | | class UserDept(BaseModel): |
| | | userId: int |
| | | depts: list |
| | | |
| | | |
| | |
| | | |
| | | async def create_dialog_service(db, dialog_id, dialog_name, description, icon, dialog_type, mode, user_id): |
| | | try: |
| | | dialog_model = DialogModel(id=dialog_id,name=dialog_name, description=description,icon=icon, dialog_type=dialog_type, tenant_id=user_id, agent_id=dialog_id, mode=mode) |
| | | dialog_model = DialogModel(id=dialog_id,name=dialog_name, description=description,icon=icon, dialog_type=dialog_type, tenant_id=user_id, mode=mode,update_date=datetime.now(),create_date=datetime.now()) |
| | | db.add(dialog_model) |
| | | db.commit() |
| | | db.refresh(dialog_model) |
| | |
| | | |
| | | async def update_dialog_status_service(db, dialog_id, status): |
| | | try: |
| | | db.query(DialogModel).filter_by(id=dialog_id).update({"status":status}) |
| | | db.query(DialogModel).filter_by(id=dialog_id).update({"status":status, "update_date": datetime.now()}) |
| | | db.commit() |
| | | except Exception as e: |
| | | logger.error(e) |
| | |
| | | |
| | | |
| | | |
| | | async def chat(self, token: str, user_id: int, message: str, upload_file_id: str, conversation_id: str): |
| | | async def chat(self, token: str, user_id: int, message: str, files: [], conversation_id: str): |
| | | |
| | | target_url = f"{self.base_url}/v1/chat-messages" |
| | | files = [] |
| | | if upload_file_id: |
| | | files = [ |
| | | { |
| | | "type": "image", |
| | | "transfer_method": "local_file", |
| | | "url": "", |
| | | "upload_file_id": upload_file_id |
| | | } |
| | | ] |
| | | data = { |
| | | "inputs": {}, |
| | | "query": message, |
| | |
| | | import uuid |
| | | |
| | | from Log import logger |
| | | from app.models import OrganizationModel |
| | | from app.models.resource_model import ResourceModel |
| | | from app.models.role_model import RoleModel |
| | | |
| | |
| | | if keyword: |
| | | query = query.filter(RoleModel.name.like('%{}%'.format(keyword))) |
| | | total = query.count() |
| | | roles = query.order_by(RoleModel.id.desc()).limit(page_size).offset( |
| | | roles = query.order_by(RoleModel.created_at.desc()).limit(page_size).offset( |
| | | (page_index - 1) * page_size).all() |
| | | return {"total": total, "rows": [role.to_json() for role in roles]} |
| | | |
| | |
| | | return True |
| | | |
| | | |
| | | async def edit_role_resource(db, role_id:str, role_name:str, description:str,role_key:str, data_scope:int, resources:list, edit_type:int): |
| | | async def edit_role_resource(db, role_id:str, role_name:str, description:str,role_key:str, data_scope:int, resources:list, edit_type:int, depts:list): |
| | | try: |
| | | role = db.query(RoleModel).filter(RoleModel.id == role_id).first() |
| | | if edit_type == 1: |
| | |
| | | role.roleKey = role_key |
| | | if data_scope: |
| | | role.dataScope = data_scope |
| | | else: |
| | | elif edit_type == 2: |
| | | role.resources = [db.get(ResourceModel, resourcesId) for resourcesId in resources] |
| | | elif edit_type == 3: |
| | | role.organizations = [db.get(OrganizationModel, deptId) for deptId in depts] |
| | | db.add(role) |
| | | db.commit() |
| | | except Exception as e: |
| | |
| | | from app.api.dialog import dialog_list |
| | | from app.config.config import settings |
| | | from app.config.const import RAGFLOW, BISHENG, DIFY |
| | | from app.models import RoleModel, GroupModel, AgentType, role_resource_table, DialogModel |
| | | from app.models import RoleModel, GroupModel, AgentType, role_resource_table, DialogModel, OrganizationModel |
| | | from app.models.menu_model import WebMenuModel, MenuCapacityModel |
| | | from app.models.user_model import UserModel, UserAppModel |
| | | from Log import logger |
| | |
| | | for group in user.groups: |
| | | for dialog in group.dialogs: |
| | | dialog_list.append(dialog.id) |
| | | print(dialog_list) |
| | | menu_list = db.query(WebMenuModel.id, WebMenuModel.title, WebMenuModel.describe, WebMenuModel.icon, WebMenuModel.desc,WebMenuModel.rank, |
| | | WebMenuModel.img, MenuCapacityModel.capacity_id, MenuCapacityModel.capacity_type, MenuCapacityModel.chat_id.label("agentId")).outerjoin( |
| | | MenuCapacityModel, WebMenuModel.id == MenuCapacityModel.menu_id).outerjoin( |
| | |
| | | for m in menus: |
| | | if user.permission == "admin": |
| | | continue |
| | | elif not m.capacity_type or m.capacity_type == 1 and m.capacity_id not in dialog_list: |
| | | elif m.capacity_id not in dialog_list: |
| | | break |
| | | else: |
| | | res.append({ |
| | |
| | | |
| | | |
| | | return {"roles": [i.to_dict() for i in user.roles], "user": user.to_dict()} |
| | | |
| | | |
| | | async def edit_user_dept(db, user_id, dept_list): |
| | | try: |
| | | user = db.query(UserModel).filter(UserModel.id == user_id).first() |
| | | user.organizations = [db.get(OrganizationModel, deptId) for deptId in dept_list] |
| | | db.commit() |
| | | except Exception as e: |
| | | logger.error(e) |
| | | db.rollback() |
| | | return False |
| | | return True |
| | |
| | | |
| | | from app.config.config import settings |
| | | from app.config.const import RAGFLOW, BISHENG, DIFY |
| | | from app.models import DialogModel |
| | | from app.models.dialog_model import DialogModel |
| | | from app.models.user_model import UserAppModel |
| | | from app.models.agent_model import AgentModel |
| | | from app.models.base_model import SessionLocal, Base |
| | | from app.service.v2.app_register import AppRegisterDao |
| | |
| | | result = db.query(AgentModel).delete() |
| | | db.commit() # 提交事务 |
| | | initial_agents = [ |
| | | ('80ee430a-e396-48c4-a12c-7c7cdf5eda51', 1, '报告生成', 'BISHENG', 'report'), |
| | | # ('80ee430a-e396-48c4-a12c-7c7cdf5eda51', 1, '报告生成', 'DIFY', 'report'), |
| | | ('basic_excel_merge', 2, '报表合并', 'BASIC', 'excelMerge'), |
| | | ('bfd090d589d811efb3630242ac190006', 4, '文档智能', 'BISHENG', 'report'), |
| | | ('bfd090d589d811efb3630242ac190006', 4, '文档智能', 'DIFY', 'documentIa'), |
| | | ('da3451da89d911efb9490242ac190006', 3, '知识问答', 'RAGFLOW', 'knowledgeQA'), |
| | | ('e96eb7a589db11ef87d20242ac190006', 5, '智能问答', 'RAGFLOW', 'chat'), |
| | | ('basic_excel_talk', 6, '智能数据', 'BASIC', 'excelTalk'), |
| | |
| | | |
| | | def sync_agents(): |
| | | try: |
| | | bisheng_data = get_data_from_bisheng(BISHENG_NAMES_TO_SYNC) |
| | | # bisheng_data = get_data_from_bisheng(BISHENG_NAMES_TO_SYNC) |
| | | ragflow_data = get_data_from_ragflow(RAGFLOW_NAMES_TO_SYNC) |
| | | |
| | | update_ids_in_local(bisheng_data) |
| | | # update_ids_in_local(bisheng_data) |
| | | update_ids_in_local(ragflow_data) |
| | | |
| | | print("Agents synchronized successfully") |
| | |
| | | raise |
| | | finally: |
| | | db.close() |
| | | |
| | | def get_rag_user_id(db, tenant_id, app_type): |
| | | |
| | | user = db.query(UserAppModel).filter(UserAppModel.app_type==app_type, UserAppModel.app_id==tenant_id).first() |
| | | if user: |
| | | return user.user_id |
| | | return tenant_id |
| | | |
| | | |
| | | def get_data_from_bisheng_v2(names: List[str]) -> List[Dict]: |
| | | db = SessionBisheng() |
| | |
| | | def update_ids_in_local_v2(data: List[Dict], dialog_type:str): |
| | | db = SessionLocal() |
| | | agent_id_list = [] |
| | | print("----------------------------------------") |
| | | print(data) |
| | | print("*********************************************") |
| | | type_dict = {"1": RAGFLOW,"2": BISHENG,"4": DIFY} |
| | | try: |
| | | for row in data: |
| | | agent_id_list.append(row["id"]) |
| | |
| | | if existing_agent: |
| | | existing_agent.name = row["name"] |
| | | existing_agent.description = row["description"] |
| | | existing_agent.tenant_id = get_rag_user_id(db, row["user_id"], type_dict[dialog_type]) |
| | | else: |
| | | existing = DialogModel(id=row["id"], name=row["name"], description=row["description"], tenant_id=row["user_id"], dialog_type=dialog_type) |
| | | existing = DialogModel(id=row["id"], name=row["name"], description=row["description"], tenant_id=get_rag_user_id(db, row["user_id"], type_dict[dialog_type]), dialog_type=dialog_type) |
| | | db.add(existing) |
| | | db.commit() |
| | | for dialog in db.query(DialogModel).filter_by(dialog_type=dialog_type).all(): |
| | |
| | | |
| | | |
| | | def get_data_from_ragflow_knowledge(): |
| | | ... |
| | | db = SessionRagflow() |
| | | try: |
| | | |
| | | results = db.query(Dialog.id, Dialog.name, Dialog.description, Dialog.status, Dialog.tenant_id).all() |
| | | formatted_results = [ |
| | | {"id": format_uuid(row[0]), "name": row[1], "description": row[2], "status": str(row[3]), |
| | | "user_id": str(row[4])} for row in results] |
| | | return formatted_results |
| | | finally: |
| | | db.close() |
| | | |
| | | def sync_agents_v2(): |
| | | db = SessionLocal() |
| | |
| | | { |
| | | "bisheng_app": 1, |
| | | "bisheng_app": 0, |
| | | "dify_app": 1, |
| | | "ragflow_app": 1 |
| | | } |
| | |
| | | "rank": 100, |
| | | "dialog": [ |
| | | { |
| | | "id": "1", |
| | | "chat_id": "", |
| | | "id": "80ee430a-e396-48c4-a12c-7c7cdf5eda51", |
| | | "chat_id": "80ee430a-e396-48c4-a12c-7c7cdf5eda51", |
| | | "chat_type": "report", |
| | | "agentType": 2 |
| | | } |
| | |
| | | "describe": "基于您上传的报表进行合并,助您快速完成报表整合与分析", |
| | | "dialog": [ |
| | | { |
| | | "id": "2", |
| | | "chat_id": "", |
| | | "id": "basic_excel_merge", |
| | | "chat_id": "basic_excel_merge", |
| | | "chat_type": "excelMerge", |
| | | "agentType": 1 |
| | | "agentType": 3 |
| | | } |
| | | ], |
| | | "rank": 99 |
| | |
| | | "desc": "遍历已创建的文档知识库,生成完整和准确的答案,同时显示来源文档供您参考", |
| | | "describe": "垂域知识的问答助手,针对你的提问,我们将遍历已创建的文档知识库,生成完整和准确的答案,同时显示来源文档供您参考。", |
| | | "rank": 98, |
| | | "dialog": [] |
| | | "dialog": [ |
| | | { |
| | | "id": "42e4fcdc-9bea-11ef-ac30-0242ac160006", |
| | | "chat_id": "42e4fcdc-9bea-11ef-ac30-0242ac160006", |
| | | "chat_type": "knowledgeQA", |
| | | "agentType": 1 |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | "id": 3, |
| | |
| | | "rank": 97, |
| | | "dialog": [ |
| | | { |
| | | "id": "3", |
| | | "chat_id": "", |
| | | "id": "c684bab4-f05b-423e-8727-f50497e73ebf", |
| | | "chat_id": "c684bab4-f05b-423e-8727-f50497e73ebf", |
| | | "chat_type": "report", |
| | | "agentType": 1 |
| | | "agentType": 2 |
| | | } |
| | | ] |
| | | }, |
| | |
| | | "desc": "能够理解和学习人类的语言,具备多轮对话的能力", |
| | | "describe": "我可以理解和学习人类的语言,具备多轮对话的能力,现在和我开始交流吧~", |
| | | "rank": 96, |
| | | "dialog": [] |
| | | "dialog": [ |
| | | { |
| | | "id": "90d53372-9c02-11ef-bf6b-0242ac160006", |
| | | "chat_id": "90d53372-9c02-11ef-bf6b-0242ac160006", |
| | | "chat_type": "chat", |
| | | "agentType": 1 |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | "id": 5, |
| | |
| | | "desc": "您可以上传文档或添加数据库地址,小数可针对你文档的数据进行分析,并生成指定的图表", |
| | | "describe": "您可以上传文档或添加数据库地址,小数可针对你文档的数据进行分析,并生成指定的图表", |
| | | "rank": 95, |
| | | "dialog": [] |
| | | "dialog": [ |
| | | { |
| | | "id": "basic_excel_talk", |
| | | "chat_id": "basic_excel_talk", |
| | | "chat_type": "excelTalk", |
| | | "agentType": 1 |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | "id": 6, |
| | |
| | | "desc": "基于您上传的图片,生成对应的文字描述并基于图片内容实现问答。", |
| | | "describe": "基于您上传的图片,生成对应的文字描述并基于图片内容实现问答。", |
| | | "rank": 94, |
| | | "dialog": [] |
| | | "dialog": [ |
| | | { |
| | | "id": "9d75142a-66eb-4e23-b7d4-03efe4584915", |
| | | "chat_id": "9d75142a-66eb-4e23-b7d4-03efe4584915", |
| | | "chat_type": "imageTalk", |
| | | "agentType": 4 |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | "id": 7, |
| | |
| | | "desc": "您可以上传文档,小数能针对单文档或多个文档内容自动出题,高效便捷的帮助你建立私人题库。", |
| | | "describe": "您可以上传文档,小数能针对单文档或多个文档内容自动出题,高效便捷的帮助你建立私人题库。", |
| | | "rank": 93, |
| | | "dialog": [] |
| | | "dialog": [ |
| | | { |
| | | "id": "basic_paper_talk", |
| | | "chat_id": "basic_paper_talk", |
| | | "chat_type": "paperTalk", |
| | | "agentType": 3 |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | "id": 8, |
| | |
| | | "desc": "您可以上传文档,小数能针对单文档或多个文档内容自动出题,高效便捷的帮助你建立私人题库。", |
| | | "describe": "您可以上传文档,小数能针对单文档或多个文档内容自动出题,高效便捷的帮助你建立私人题库。", |
| | | "rank": 92, |
| | | "dialog": [] |
| | | "dialog": [ |
| | | { |
| | | "id": "basic_question_talk", |
| | | "chat_id": "basic_question_talk", |
| | | "chat_type": "questionTalk", |
| | | "agentType": 3 |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | "id": 9, |
| | |
| | | "rank": 91, |
| | | "dialog": [ |
| | | { |
| | | "id": "basic_excel_merge", |
| | | "id": "72a69e47-458d-47f9-b534-1859e5da244f", |
| | | "chat_id": "basic_report_clean", |
| | | "chat_type": "reportWorkflow", |
| | | "agentType": 4 |
| | | }, |
| | | { |
| | | "id": "basic_paper_talk", |
| | | "id": "6eda0700-6273-488d-a97c-88d315bd9d8f", |
| | | "chat_id": "basic_report_clean", |
| | | "chat_type": "reportWorkflow", |
| | | "agentType": 4 |