Add sync_default_tools function to manage system-provided tools
- Introduce a new `sync_default_tools` function in `session.py` to ensure essential reusable tools are created without overwriting existing edits. - Update the `lifespan` context manager in `app.py` to call `sync_default_tools`, enhancing the initialization process for the application. - This change improves the management of default tools within the system, ensuring they are available for use while preserving user modifications.
This commit is contained in:
@@ -16,7 +16,7 @@ from contextlib import asynccontextmanager
|
||||
|
||||
import settings
|
||||
import uvicorn
|
||||
from db.session import sync_interface_definitions
|
||||
from db.session import sync_default_tools, sync_interface_definitions
|
||||
from fastapi import FastAPI
|
||||
from fastapi.middleware.cors import CORSMiddleware
|
||||
|
||||
@@ -36,6 +36,7 @@ from routes import (
|
||||
@asynccontextmanager
|
||||
async def lifespan(_app: FastAPI):
|
||||
await sync_interface_definitions()
|
||||
await sync_default_tools()
|
||||
yield
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user