feat(Agent): ChatAgent And AgentHub

1.Upgrade sqlalchemy to version 2.0
This commit is contained in:
yhjun1026 2023-10-16 12:00:46 +08:00
parent 1c90cbc64c
commit 0e8fe405b1
5 changed files with 9 additions and 6 deletions

View File

@ -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配置

View File

@ -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)

View File

@ -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
)

View File

@ -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():

View File

@ -308,7 +308,7 @@ def core_requires():
"auto-gpt-plugin-template",
"gTTS==2.3.1",
"langchain>=0.0.286",
"SQLAlchemy",
"SQLAlchemy==2.0.22",
"pymysql",
"duckdb==0.8.1",
"duckdb-engine",