Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
117 commits
Select commit Hold shift + click to select a range
801a3b4
Merge branch 'develop_storage_factory' of https://github.com/ModelEng…
Zhi-a Nov 12, 2025
e6a6072
✨Agent runtime isolation Step1: Service decomposition based on Docker…
YehongPan Nov 12, 2025
cedaa2f
Merge branch 'develop' of https://github.com/ModelEngine-Group/nexent…
YehongPan Nov 13, 2025
9a33b45
Merge branch 'develop_storage_factory' of https://github.com/ModelEng…
Zhi-a Nov 13, 2025
415b24e
✨Agent runtime isolation Step1: Service decomposition based on Docker…
YehongPan Nov 13, 2025
852f2ca
Add Huawei ICT agent entry to memorial wall
18June96 Nov 13, 2025
af94934
Add messages from happyzhang
happyzhanghengyu0 Nov 13, 2025
aa40f1f
Add user comments to open source memorial wall
duanchuangju666 Nov 14, 2025
4d1ddb4
Add user testimonials to memorial wall
LockerCN Nov 15, 2025
64fb8eb
Update opensource-memorial-wall.md
xlp888 Nov 16, 2025
b47227b
Update opensource-memorial-wall.md
dym040615 Nov 16, 2025
d9472f1
Merge branch 'develop' of https://github.com/ModelEngine-Group/nexent…
YehongPan Nov 17, 2025
5ea3e1f
Add Huawei ICT agent entry to memorial wall from 18June96/patch-2
WMC001 Nov 17, 2025
e2b3e0a
Add messages from happyzhang from happyzhanghengyu0/patch-1
WMC001 Nov 17, 2025
8686498
Add user testimonials to memorial wall from LockerCN/patch-1
WMC001 Nov 17, 2025
a3574e3
Merge branch 'develop' into patch-1
WMC001 Nov 17, 2025
04d92b7
Update opensource-memorial-wall.md from xlp888/patch-1
WMC001 Nov 17, 2025
2d71370
Merge branch 'develop' into patch-1
WMC001 Nov 17, 2025
b12b63c
Merge pull request #1681 from duanchuangju666/patch-1
WMC001 Nov 17, 2025
ea166e4
Merge branch 'develop' into patch-1
WMC001 Nov 17, 2025
9076776
Update opensource-memorial-wall.md from dym040615/patch-1
WMC001 Nov 17, 2025
3ddd9f0
🐛 Bugfix: ray initialize failed
Jasonxia007 Nov 17, 2025
9412414
🐛 fix ray initialize failed
Phinease Nov 17, 2025
aa52193
⭐️ Agent Space
Phinease Nov 17, 2025
db40b28
Update opensource-memorial-wall.md
kno-do Nov 17, 2025
925c499
Update opensource-memorial-wall.md
dym040615 Nov 17, 2025
74af038
Update opensource-memorial-wall.md
kno-do Nov 17, 2025
7be849a
Merge branch 'develop' of https://github.com/ModelEngine-Group/nexent…
Zhi-a Nov 17, 2025
8fee112
✨Agent runtime isolation Step1: Service decomposition based on Docker…
YehongPan Nov 17, 2025
f98f1b7
♻️ Refactor: refactor elasticsearch core to vectordb core
Jasonxia007 Nov 18, 2025
98d1dbf
✨Agent runtime isolation Step1: Service decomposition based on Docker…
YehongPan Nov 18, 2025
cb7c776
⭐️ Agent Space
Phinease Nov 18, 2025
e070d16
⭐️ Navigation system
Phinease Nov 18, 2025
6d761ba
Merge branch 'develop' of https://github.com/nexent-hub/nexent into c…
Phinease Nov 18, 2025
e19b5fa
⭐️ Navigation system
Phinease Nov 18, 2025
c8a9a29
⭐️ Add pages to Navigation
Phinease Nov 18, 2025
91f3e8d
⭐️ Add pages to Navigation
Phinease Nov 18, 2025
218c7d0
⭐️ Add pages to Navigation
Phinease Nov 18, 2025
53c2acd
Update opensource-memorial-wall.md from kno-do/patch-1
WMC001 Nov 18, 2025
6e2ea61
Update opensource-memorial-wall.md from dym040615/patch-3
WMC001 Nov 18, 2025
df5aa73
Merge branch 'develop' into patch-2
WMC001 Nov 18, 2025
4a2f436
Update opensource-memorial-wall.md from kno-do/patch-2
WMC001 Nov 18, 2025
6295f40
⭐️ Navigation SPA mode
Phinease Nov 18, 2025
ac5c95b
⭐️ Navigation SPA mode
Phinease Nov 18, 2025
67d7ffc
⭐️ Navigation SPA mode to chat
Phinease Nov 18, 2025
7d9f001
⭐️ Navigation SPA mode to chat
Phinease Nov 18, 2025
d2ae145
🐛 Fix sidebar height
Phinease Nov 18, 2025
a7158b5
⭐️ Navigation SPA mode to chat
Phinease Nov 18, 2025
b31ce93
🐛 Bugfix: Agent import does not import max steps of agent run #1582
WMC001 Nov 17, 2025
ea542c5
🐛 fix Agent import does not import max steps of agent run #1582
Phinease Nov 18, 2025
3782682
🧪 Add tests for vectordb core
Jasonxia007 Nov 18, 2025
c24c41f
Merge remote-tracking branch 'origin/develop' into xyc/elasticsearch_…
Jasonxia007 Nov 18, 2025
4b4624a
✨ Multi-modal data sdk
Zhi-a Nov 17, 2025
ffca4a8
🧪 Add tests for vectordb core
Jasonxia007 Nov 18, 2025
75250b4
🐛 Fix chat sidebar and main area scroll height
Phinease Nov 19, 2025
7aae3c4
✨Agent configuration page logic optimization #1711
YehongPan Nov 19, 2025
742640d
Merge branch 'develop' of https://github.com/ModelEngine-Group/nexent…
YehongPan Nov 19, 2025
7cb29ae
✨Agent configuration page logic optimization #1711
YehongPan Nov 19, 2025
3b17869
⭐️ SPA permission check
Phinease Nov 19, 2025
3af0d76
✨Agent runtime isolation Step1: Service decomposition based on Docker…
YehongPan Nov 19, 2025
29847eb
Merge remote-tracking branch 'refs/remotes/origin/develop' into pyh/f…
YehongPan Nov 19, 2025
5b05526
✨ Multi-modal agent config
Zhi-a Nov 19, 2025
9ee40cd
🐛 Fix chat sidebar and main area scroll height
Phinease Nov 19, 2025
b416ec4
✨ Agent runtime isolation Step1: Service decomposition based on Docke…
Phinease Nov 19, 2025
fca802e
Add new testimonial for qinjavermo
jingjing-ai520 Nov 19, 2025
b2fe33d
✨ Multi-modal data sdk
Phinease Nov 19, 2025
a1bf5ca
✨ Agent configuration page logic optimization #1711
Phinease Nov 19, 2025
40541c5
✨ Now knowledgebase page supports chunk preview and chunk download
Jasonxia007 Nov 19, 2025
dcfde3c
Merge remote-tracking branch 'origin/develop' into xyc/elasticsearch_…
Jasonxia007 Nov 19, 2025
16427e2
Add tests for vectordb core
Jasonxia007 Nov 19, 2025
b89b9d5
✨Agent runtime isolation Step1: Service decomposition based on Docker…
YehongPan Nov 19, 2025
091ba52
🧪 Add tests for feature
Jasonxia007 Nov 19, 2025
e5f9a06
Merge remote-tracking branch 'origin/develop' into xyc/kb_chunk_preview
Jasonxia007 Nov 19, 2025
0ed42e6
♻️ Refactor: refactor elasticsearch core to vectordb core
Jasonxia007 Nov 19, 2025
1289001
Merge pull request #1735 from ModelEngine-Group/pyh/feat_runtime_isol…
YehongPan Nov 19, 2025
ebf2504
✨ Add video rendering for the chat page, name searching when batching…
WMC001 Nov 19, 2025
1eb6fd4
Add new testimonials to open source memorial wall
lvxiaohai99 Nov 19, 2025
984ce07
Add user testimonial to memorial wall
chengyudan Nov 19, 2025
02e7b2f
Merge remote-tracking branch 'origin/develop' into xyc/kb_chunk_preview
Jasonxia007 Nov 20, 2025
f3774df
✨ Unit test: optimize the display effect of the final answer
WMC001 Nov 20, 2025
2dd7f06
Add new testimonial for qinjavermo from jingjing-ai520/patch-1
WMC001 Nov 20, 2025
abb227a
Merge branch 'develop' into patch-1
WMC001 Nov 20, 2025
24c19ad
✨ Unit test: optimize the display effect of the final answer
WMC001 Nov 20, 2025
8636859
✨ Add video rendering for the chat page, name searching when batching…
Phinease Nov 20, 2025
8f84b67
Add new testimonials to open source memorial wall from lvxiaohai99/pa…
WMC001 Nov 20, 2025
8e1ae61
🐛 Fixed the incompatibility issue of env.example utf8-bom on Linux.
Zhi-a Nov 20, 2025
dda87ef
Merge branch 'develop' into patch-1
WMC001 Nov 20, 2025
b279ecd
Add user testimonial to memorial wall from chengyudan/patch-1
WMC001 Nov 20, 2025
e9e245b
new memorial messages to the wall
Nov 20, 2025
5a671e3
🐛 Changes to app settings on the configuration page need to be saved …
WMC001 Nov 20, 2025
1ac2d19
🐛 Add filtering in the custom model modification section as well #1754
WMC001 Nov 20, 2025
1c11673
Add info tip for chengyudan
chengyudan Nov 20, 2025
abf3f0c
🐛 Bugfix: The intelligent generation agent cannot recognize the selec…
Jasonxia007 Nov 20, 2025
b2b16a4
✨ Now chunk preview supports pagination
Jasonxia007 Nov 20, 2025
7147083
🐛 Bugfix: agent tools params cannot initialize correctly
Jasonxia007 Nov 20, 2025
216a404
Add user messages to open source memorial wall
china-king-hs Nov 20, 2025
7ce348f
🐛 The intelligent generation agent cannot recognize the selected tool
Phinease Nov 20, 2025
1ffe066
🐛 When modifying a custom model, specifically the configuration of a …
WMC001 Nov 21, 2025
17d41f1
Merge pull request #1736 from ModelEngine-Group/xyc/kb_chunk_preview
Phinease Nov 21, 2025
321b257
Merge pull request #1749 from ModelEngine-Group/develop_fix_env_example
Phinease Nov 21, 2025
1ca3dcf
Merge pull request #1751 from ModelEngine-Group/wmc/bugfix_1117
Phinease Nov 21, 2025
cf76857
⭐️ Comming soon pages
Phinease Nov 21, 2025
c73c9ee
⭐️ Comming soon pages
Phinease Nov 21, 2025
61fc236
Update app version v1.7.6
WMC001 Nov 21, 2025
bc22cac
⭐️ Comming soon pages
Phinease Nov 21, 2025
d5db7a8
🐛 When the knowledge base is automatically summarized, other interfac…
YehongPan Nov 21, 2025
395d10b
🐛 Bugfix: agent tools params cannot initialize correctly
Jasonxia007 Nov 21, 2025
259c710
🐛 When the knowledge base is automatically summarized, other interfac…
YehongPan Nov 21, 2025
8d9edb9
🐛 Bugfix: knowledgebase search tools cannot initialize correctly
Jasonxia007 Nov 21, 2025
3cd9e45
🐛 knowledgebase search tools cannot initialize correctly
Phinease Nov 21, 2025
4a9faea
⭐️ Update app version v1.7.6
Phinease Nov 21, 2025
3d3fba6
🐛 When the knowledge base is automatically summarized, other interfac…
YehongPan Nov 21, 2025
0cd9494
new memorial messages to the wall from 992638310-glitch/new_memorial_…
WMC001 Nov 21, 2025
9f855fc
Add user messages to open source memorial wall from china-king-hs/pat…
WMC001 Nov 21, 2025
b760b4a
Merge branch 'develop' into patch-2
WMC001 Nov 21, 2025
a4f0a5c
Add info tip from chengyudan/patch-2
WMC001 Nov 21, 2025
09be0c1
🐛 When the knowledge base is automatically summarized, other interfac…
Phinease Nov 21, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions backend/agents/create_agent_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@
from nexent.core.agents.agent_model import AgentRunInfo, ModelConfig, AgentConfig, ToolConfig
from nexent.memory.memory_service import search_memory_in_levels

from services.elasticsearch_service import ElasticSearchService, elastic_core, get_embedding_model
from services.vectordatabase_service import (
ElasticSearchService,
get_vector_db_core,
get_embedding_model,
)
from services.tenant_config_service import get_selected_knowledge_list
from services.remote_mcp_service import get_remote_mcp_server_list
from services.memory_config_service import build_memory_context
Expand Down Expand Up @@ -227,9 +231,11 @@ async def create_tool_config_list(agent_id, tenant_id, user_id):
tenant_id=tenant_id, user_id=user_id)
index_names = [knowledge_info.get(
"index_name") for knowledge_info in knowledge_info_list]
tool_config.metadata = {"index_names": index_names,
"es_core": elastic_core,
"embedding_model": get_embedding_model(tenant_id=tenant_id)}
tool_config.metadata = {
"index_names": index_names,
"vdb_core": get_vector_db_core(),
"embedding_model": get_embedding_model(tenant_id=tenant_id),
}
tool_config_list.append(tool_config)

return tool_config_list
Expand Down
23 changes: 12 additions & 11 deletions backend/apps/agent_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,13 @@
# Import monitoring utilities
from utils.monitoring import monitoring_manager

router = APIRouter(prefix="/agent")
agent_runtime_router = APIRouter(prefix="/agent")
agent_config_router = APIRouter(prefix="/agent")
logger = logging.getLogger("agent_app")


# Define API route
@router.post("/run")
@agent_runtime_router.post("/run")
@monitoring_manager.monitor_endpoint("agent.run", exclude_params=["authorization"])
async def agent_run_api(agent_request: AgentRequest, http_request: Request, authorization: str = Header(None)):
"""
Expand All @@ -45,7 +46,7 @@ async def agent_run_api(agent_request: AgentRequest, http_request: Request, auth
status_code=HTTPStatus.INTERNAL_SERVER_ERROR, detail="Agent run error.")


@router.get("/stop/{conversation_id}")
@agent_runtime_router.get("/stop/{conversation_id}")
async def agent_stop_api(conversation_id: int, authorization: Optional[str] = Header(None)):
"""
stop agent run and preprocess tasks for specified conversation_id
Expand All @@ -58,7 +59,7 @@ async def agent_stop_api(conversation_id: int, authorization: Optional[str] = He
detail=f"no running agent or preprocess tasks found for conversation_id {conversation_id}")


@router.post("/search_info")
@agent_config_router.post("/search_info")
async def search_agent_info_api(agent_id: int = Body(...), authorization: Optional[str] = Header(None)):
"""
Search agent info by agent_id
Expand All @@ -72,7 +73,7 @@ async def search_agent_info_api(agent_id: int = Body(...), authorization: Option
status_code=HTTPStatus.INTERNAL_SERVER_ERROR, detail="Agent search info error.")


@router.get("/get_creating_sub_agent_id")
@agent_config_router.get("/get_creating_sub_agent_id")
async def get_creating_sub_agent_info_api(authorization: Optional[str] = Header(None)):
"""
Create a new sub agent, return agent_ID
Expand All @@ -85,7 +86,7 @@ async def get_creating_sub_agent_info_api(authorization: Optional[str] = Header(
status_code=HTTPStatus.INTERNAL_SERVER_ERROR, detail="Agent create error.")


@router.post("/update")
@agent_config_router.post("/update")
async def update_agent_info_api(request: AgentInfoRequest, authorization: Optional[str] = Header(None)):
"""
Update an existing agent
Expand All @@ -99,7 +100,7 @@ async def update_agent_info_api(request: AgentInfoRequest, authorization: Option
status_code=HTTPStatus.INTERNAL_SERVER_ERROR, detail="Agent update error.")


@router.delete("")
@agent_config_router.delete("")
async def delete_agent_api(request: AgentIDRequest, authorization: Optional[str] = Header(None)):
"""
Delete an agent
Expand All @@ -113,7 +114,7 @@ async def delete_agent_api(request: AgentIDRequest, authorization: Optional[str]
status_code=HTTPStatus.INTERNAL_SERVER_ERROR, detail="Agent delete error.")


@router.post("/export")
@agent_config_router.post("/export")
async def export_agent_api(request: AgentIDRequest, authorization: Optional[str] = Header(None)):
"""
export an agent
Expand All @@ -127,7 +128,7 @@ async def export_agent_api(request: AgentIDRequest, authorization: Optional[str]
status_code=HTTPStatus.INTERNAL_SERVER_ERROR, detail="Agent export error.")


@router.post("/import")
@agent_config_router.post("/import")
async def import_agent_api(request: AgentImportRequest, authorization: Optional[str] = Header(None)):
"""
import an agent
Expand All @@ -141,7 +142,7 @@ async def import_agent_api(request: AgentImportRequest, authorization: Optional[
status_code=HTTPStatus.INTERNAL_SERVER_ERROR, detail="Agent import error.")


@router.get("/list")
@agent_config_router.get("/list")
async def list_all_agent_info_api(authorization: Optional[str] = Header(None), request: Request = None):
"""
list all agent info
Expand All @@ -155,7 +156,7 @@ async def list_all_agent_info_api(authorization: Optional[str] = Header(None), r
status_code=HTTPStatus.INTERNAL_SERVER_ERROR, detail="Agent list error.")


@router.get("/call_relationship/{agent_id}")
@agent_config_router.get("/call_relationship/{agent_id}")
async def get_agent_call_relationship_api(agent_id: int, authorization: Optional[str] = Header(None)):
"""
Get agent call relationship tree including tools and sub-agents
Expand Down
14 changes: 5 additions & 9 deletions backend/apps/base_app.py → backend/apps/config_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@
from fastapi.middleware.cors import CORSMiddleware
from fastapi.responses import JSONResponse

from apps.agent_app import router as agent_router
from apps.agent_app import agent_config_router as agent_router
from apps.config_sync_app import router as config_sync_router
from apps.conversation_management_app import router as conversation_management_router
from apps.elasticsearch_app import router as elasticsearch_router
from apps.file_management_app import router as file_manager_router
from apps.vectordatabase_app import router as vectordatabase_router
from apps.file_management_app import file_management_config_router as file_manager_router
from apps.image_app import router as proxy_router
from apps.knowledge_summary_app import router as summary_router
from apps.memory_config_app import router as memory_router
from apps.me_model_managment_app import router as me_model_manager_router
from apps.mock_user_management_app import router as mock_user_management_router
from apps.model_managment_app import router as model_manager_router
Expand All @@ -20,7 +18,7 @@
from apps.tenant_config_app import router as tenant_config_router
from apps.tool_config_app import router as tool_config_router
from apps.user_management_app import router as user_management_router
from apps.voice_app import router as voice_router
from apps.voice_app import voice_config_router as voice_router
from consts.const import IS_SPEED_MODE

# Import monitoring utilities
Expand All @@ -41,11 +39,9 @@

app.include_router(me_model_manager_router)
app.include_router(model_manager_router)
app.include_router(memory_router)
app.include_router(config_sync_router)
app.include_router(agent_router)
app.include_router(conversation_management_router)
app.include_router(elasticsearch_router)
app.include_router(vectordatabase_router)
app.include_router(voice_router)
app.include_router(file_manager_router)
app.include_router(proxy_router)
Expand Down
21 changes: 11 additions & 10 deletions backend/apps/file_management_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,20 @@
logger = logging.getLogger("file_management_app")

# Create API router
router = APIRouter(prefix="/file")
file_management_runtime_router = APIRouter(prefix="/file")
file_management_config_router = APIRouter(prefix="/file")


# Handle preflight requests
@router.options("/{full_path:path}")
@file_management_config_router.options("/{full_path:path}")
async def options_route(full_path: str):
return JSONResponse(
status_code=HTTPStatus.OK,
content={"detail": "OK"},
)


@router.post("/upload")
@file_management_config_router.post("/upload")
async def upload_files(
file: List[UploadFile] = File(..., alias="file"),
destination: str = Form(...,
Expand Down Expand Up @@ -59,7 +60,7 @@ async def upload_files(
detail="No valid files uploaded")


@router.post("/process")
@file_management_config_router.post("/process")
async def process_files(
files: List[dict] = Body(
..., description="List of file details to process, including path_or_url and filename"),
Expand Down Expand Up @@ -100,7 +101,7 @@ async def process_files(
)


@router.post("/storage")
@file_management_runtime_router.post("/storage")
async def storage_upload_files(
files: List[UploadFile] = File(..., description="List of files to upload"),
folder: str = Form(
Expand All @@ -125,7 +126,7 @@ async def storage_upload_files(
}


@router.get("/storage")
@file_management_config_router.get("/storage")
async def get_storage_files(
prefix: str = Query("", description="File prefix filter"),
limit: int = Query(100, description="Maximum number of files to return"),
Expand Down Expand Up @@ -160,7 +161,7 @@ async def get_storage_files(
)


@router.get("/storage/{path}/{object_name}")
@file_management_config_router.get("/storage/{path}/{object_name}")
async def get_storage_file(
object_name: str = PathParam(..., description="File object name"),
download: str = Query("ignore", description="How to get the file"),
Expand Down Expand Up @@ -200,7 +201,7 @@ async def get_storage_file(
)


@router.delete("/storage/{object_name:path}")
@file_management_config_router.delete("/storage/{object_name:path}")
async def remove_storage_file(
object_name: str = PathParam(..., description="File object name to delete")
):
Expand All @@ -224,7 +225,7 @@ async def remove_storage_file(
)


@router.post("/storage/batch-urls")
@file_management_config_router.post("/storage/batch-urls")
async def get_storage_file_batch_urls(
request_data: dict = Body(...,
description="JSON containing list of file object names"),
Expand Down Expand Up @@ -272,7 +273,7 @@ async def get_storage_file_batch_urls(
}


@router.post("/preprocess")
@file_management_runtime_router.post("/preprocess")
async def agent_preprocess_api(
request: Request, query: str = Form(...),
files: List[UploadFile] = File(...),
Expand Down
13 changes: 7 additions & 6 deletions backend/apps/knowledge_summary_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@

from fastapi import APIRouter, Body, Depends, Header, HTTPException, Path, Query, Request
from fastapi.responses import StreamingResponse
from nexent.vector_database.elasticsearch_core import ElasticSearchCore
from nexent.vector_database.base import VectorDatabaseCore

from consts.model import ChangeSummaryRequest
from services.elasticsearch_service import ElasticSearchService, get_es_core
from services.vectordatabase_service import ElasticSearchService, get_vector_db_core
from utils.auth_utils import get_current_user_id, get_current_user_info

router = APIRouter(prefix="/summary")
Expand All @@ -22,7 +22,7 @@ async def auto_summary(
1000, description="Number of documents to retrieve per batch"),
model_id: Optional[int] = Query(
None, description="Model ID to use for summary generation"),
es_core: ElasticSearchCore = Depends(get_es_core),
vdb_core: VectorDatabaseCore = Depends(get_vector_db_core),
authorization: Optional[str] = Header(None)
):
"""Summary Elasticsearch index_name by model"""
Expand All @@ -34,15 +34,16 @@ async def auto_summary(
return await service.summary_index_name(
index_name=index_name,
batch_size=batch_size,
es_core=es_core,
vdb_core=vdb_core,
tenant_id=tenant_id,
language=language,
model_id=model_id
)
except Exception as e:
logger.error("Knowledge base summary generation failed", exc_info=True)
logger.error(
f"Knowledge base summary generation failed: {e}", exc_info=True)
return StreamingResponse(
f"data: {{\"status\": \"error\", \"message\": \"Knowledge base summary generation failed due to an internal error.\"}}\n\n",
"data: {{\"status\": \"error\", \"message\": \"Knowledge base summary generation failed due to an internal error.\"}}\n\n",
media_type="text/event-stream",
status_code=500
)
Expand Down
4 changes: 3 additions & 1 deletion backend/apps/prompt_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ async def generate_and_save_system_prompt_api(
task_description=prompt_request.task_description,
user_id=user_id,
tenant_id=tenant_id,
language=language
language=language,
tool_ids=prompt_request.tool_ids,
sub_agent_ids=prompt_request.sub_agent_ids
), media_type="text/event-stream")
except Exception as e:
logger.exception(f"Error occurred while generating system prompt: {e}")
Expand Down
58 changes: 58 additions & 0 deletions backend/apps/runtime_app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import logging

from fastapi import FastAPI, HTTPException
from fastapi.middleware.cors import CORSMiddleware
from fastapi.responses import JSONResponse

from apps.agent_app import agent_runtime_router as agent_router
from apps.voice_app import voice_runtime_router as voice_router
from apps.conversation_management_app import router as conversation_management_router
from apps.memory_config_app import router as memory_config_router
from apps.file_management_app import file_management_runtime_router as file_management_router

# Import monitoring utilities
from utils.monitoring import monitoring_manager

# Create logger instance
logger = logging.getLogger("runtime_app")
app = FastAPI(root_path="/api")

# Add CORS middleware
app.add_middleware(
CORSMiddleware,
allow_origins=["*"],
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)

app.include_router(agent_router)
app.include_router(conversation_management_router)
app.include_router(memory_config_router)
app.include_router(file_management_router)
app.include_router(voice_router)

# Initialize monitoring for the application
monitoring_manager.setup_fastapi_app(app)


# Global exception handler for HTTP exceptions
@app.exception_handler(HTTPException)
async def http_exception_handler(request, exc):
logger.error(f"HTTPException: {exc.detail}")
return JSONResponse(
status_code=exc.status_code,
content={"message": exc.detail},
)


# Global exception handler for all uncaught exceptions
@app.exception_handler(Exception)
async def generic_exception_handler(request, exc):
logger.error(f"Generic Exception: {exc}")
return JSONResponse(
status_code=500,
content={"message": "Internal server error, please try again later."},
)


Loading
Loading