| | |
| | | from typing import Dict, List, Tuple |
| | | |
| | | from sqlalchemy import create_engine, Column, String, Integer |
| | | from sqlalchemy.dialects.postgresql import array |
| | | from sqlalchemy.exc import IntegrityError |
| | | from sqlalchemy.orm import sessionmaker |
| | | |
| | | from app.config.config import settings |
| | | from app.models.agent_model import AgentModel |
| | | from app.models.base_model import SessionLocal, Base |
| | | from app.service.v2.initialize_data import dialog_menu_sync |
| | | |
| | | # 创建数据库引擎和会话工厂 |
| | | engine_bisheng = create_engine(settings.sgb_db_url) |
| | |
| | | ('basic_excel_talk', 6, '智能数据', 'BASIC', 'excelTalk'), |
| | | ('basic_question_talk', 7, '出题组卷', 'BASIC', 'questionTalk'), |
| | | ('9d75142a-66eb-4e23-b7d4-03efe4584915', 8, '小数绘图', 'DIFY', 'imageTalk'), |
| | | ('basic_paper_talk', 8, '文档出卷', 'BASIC', 'paperTalk') |
| | | ('basic_paper_talk', 8, '文档出卷', 'BASIC', 'paperTalk'), |
| | | ('basic_report_clean', 10, '文档报告', 'DIFY', 'reportWorkflow') |
| | | ] |
| | | |
| | | for agent in initial_agents: |
| | |
| | | print("Agents synchronized successfully") |
| | | except Exception as e: |
| | | print(f"Failed to sync agents: {str(e)}") |
| | | |
| | | |
| | | async def sync_web_menu(): |
| | | db = SessionLocal() |
| | | await dialog_menu_sync(db) |
| | | |
| | | |
| | | async def sync_default_group(): |
| | | db = SessionLocal() |
| | | await dialog_menu_sync(db) |