mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-07-30 23:28:35 +00:00
feat(Agent): ChatAgent And AgentHub
1.Upgrade sqlalchemy to version 2.0
This commit is contained in:
parent
1c90cbc64c
commit
0e8fe405b1
@ -72,7 +72,7 @@ else:
|
||||
Session = sessionmaker(autocommit=False, autoflush=False, bind=engine)
|
||||
session = Session()
|
||||
|
||||
Base = declarative_base(bind=engine)
|
||||
Base = declarative_base()
|
||||
|
||||
# Base.metadata.create_all()
|
||||
|
||||
@ -84,6 +84,8 @@ alembic_cfg = AlembicConfig(alembic_ini_path)
|
||||
alembic_cfg.set_main_option('sqlalchemy.url', str(engine.url))
|
||||
|
||||
os.makedirs(default_db_path + "/alembic", exist_ok=True)
|
||||
os.makedirs(default_db_path + "/alembic/versions", exist_ok=True)
|
||||
|
||||
alembic_cfg.set_main_option('script_location', default_db_path + "/alembic")
|
||||
|
||||
# 将模型和会话传递给Alembic配置
|
||||
|
@ -31,7 +31,7 @@ class ChatAgent(BaseChat):
|
||||
self.plugins_prompt_generator.command_registry = CFG.command_registry
|
||||
|
||||
# load select plugin
|
||||
agent_module = CFG.SYSTEM_APP.get_componet(ComponentType.AGENT_HUB, ModuleAgent)
|
||||
agent_module = CFG.SYSTEM_APP.get_component(ComponentType.AGENT_HUB, ModuleAgent)
|
||||
self.plugins_prompt_generator = agent_module.load_select_plugin(self.plugins_prompt_generator, self.select_plugins)
|
||||
|
||||
self.api_call = ApiCall(plugin_generator=self.plugins_prompt_generator)
|
||||
|
@ -26,9 +26,11 @@ def initialize_components(
|
||||
|
||||
# Register global default executor factory first
|
||||
system_app.register(DefaultExecutorFactory)
|
||||
|
||||
system_app.register_instance(controller)
|
||||
|
||||
from pilot.base_modules.agent.controller import module_agent
|
||||
system_app.register_instance(module_agent)
|
||||
|
||||
_initialize_embedding_model(
|
||||
param, system_app, embedding_model_name, embedding_model_path
|
||||
)
|
||||
|
@ -81,9 +81,8 @@ app.include_router(api_fb_v1, prefix="/api", tags=["FeedBack"])
|
||||
|
||||
|
||||
app.include_router(knowledge_router, tags=["Knowledge"])
|
||||
|
||||
app.include_router(prompt_router, tags=["Prompt"])
|
||||
# app.include_router(api_editor_route_v1)
|
||||
|
||||
|
||||
@app.get("/openapi.json")
|
||||
async def get_openapi_endpoint():
|
||||
|
Loading…
Reference in New Issue
Block a user