mirror of
https://github.com/basicmachines-co/basic-memory
synced 2026-06-21 13:47:35 +00:00
add get_entity_types endpoint
This commit is contained in:
@@ -5,6 +5,7 @@ from loguru import logger
|
||||
|
||||
from .routers import documents
|
||||
from .routers import knowledge
|
||||
from .routers import discovery
|
||||
|
||||
# Initialize FastAPI app
|
||||
app = FastAPI(
|
||||
@@ -14,6 +15,7 @@ app = FastAPI(
|
||||
# Include routers
|
||||
app.include_router(knowledge.router)
|
||||
app.include_router(documents.router)
|
||||
app.include_router(discovery.router)
|
||||
|
||||
|
||||
# Add startup event
|
||||
|
||||
@@ -2,5 +2,6 @@
|
||||
|
||||
from . import knowledge_router as knowledge
|
||||
from . import documents_router as documents
|
||||
from . import discovery_router as discovery
|
||||
|
||||
__all__ = ["knowledge", "documents"]
|
||||
__all__ = ["knowledge", "documents", "discovery"]
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
"""Router for knowledge discovery and analytics operations."""
|
||||
|
||||
from fastapi import APIRouter
|
||||
from loguru import logger
|
||||
|
||||
from basic_memory.deps import EntityServiceDep
|
||||
from basic_memory.schemas import EntityTypeList, ObservationCategoryList
|
||||
|
||||
router = APIRouter(prefix="/discovery", tags=["discovery"])
|
||||
|
||||
|
||||
@router.get("/entity-types", response_model=EntityTypeList)
|
||||
async def get_entity_types(entity_service: EntityServiceDep) -> EntityTypeList:
|
||||
"""Get list of all unique entity types in the system."""
|
||||
logger.debug("Getting all entity types")
|
||||
types = await entity_service.get_entity_types()
|
||||
return EntityTypeList(types=types)
|
||||
Reference in New Issue
Block a user