refactor: reorganize memory-service into app/ directory structure
- Move models.py, schemas.py, crud.py, main.py to app/ - Update imports to use app.* prefix - Update README with new structure - Fix uvicorn run command for new structure
This commit is contained in:
@@ -26,11 +26,11 @@ cp .env.example .env
|
||||
## Запуск
|
||||
|
||||
```bash
|
||||
# Development
|
||||
uvicorn main:app --reload --host 0.0.0.0 --port 8000
|
||||
# Development (з кореня services/memory-service/)
|
||||
uvicorn app.main:app --reload --host 0.0.0.0 --port 8000
|
||||
|
||||
# Production
|
||||
uvicorn main:app --host 0.0.0.0 --port 8000 --workers 4
|
||||
uvicorn app.main:app --host 0.0.0.0 --port 8000 --workers 4
|
||||
```
|
||||
|
||||
## API Endpoints
|
||||
|
||||
@@ -7,8 +7,8 @@ from sqlalchemy.orm import Session
|
||||
from sqlalchemy import and_, or_, desc
|
||||
from datetime import datetime
|
||||
|
||||
from models import UserFact, DialogSummary, AgentMemoryEvent, AgentMemoryFactsVector
|
||||
from schemas import (
|
||||
from app.models import UserFact, DialogSummary, AgentMemoryEvent, AgentMemoryFactsVector
|
||||
from app.schemas import (
|
||||
UserFactCreate, UserFactUpdate, UserFactUpsertRequest,
|
||||
DialogSummaryCreate, AgentMemoryEventCreate
|
||||
)
|
||||
@@ -14,14 +14,14 @@ from sqlalchemy.orm import Session
|
||||
from sqlalchemy import create_engine
|
||||
from sqlalchemy.orm import sessionmaker
|
||||
|
||||
from models import Base, UserFact, DialogSummary, AgentMemoryEvent
|
||||
from schemas import (
|
||||
from app.models import Base, UserFact, DialogSummary, AgentMemoryEvent
|
||||
from app.schemas import (
|
||||
UserFactCreate, UserFactUpdate, UserFactResponse, UserFactUpsertRequest, UserFactUpsertResponse,
|
||||
DialogSummaryCreate, DialogSummaryResponse, DialogSummaryListResponse,
|
||||
AgentMemoryEventCreate, AgentMemoryEventResponse, AgentMemoryEventListResponse,
|
||||
TokenGateCheck, TokenGateCheckResponse
|
||||
)
|
||||
from crud import (
|
||||
from app.crud import (
|
||||
get_user_fact, get_user_facts, create_user_fact, update_user_fact,
|
||||
upsert_user_fact, delete_user_fact, get_user_facts_by_token_gate,
|
||||
create_dialog_summary, get_dialog_summaries, get_dialog_summary, delete_dialog_summary,
|
||||
@@ -410,5 +410,5 @@ async def check_token_gate_endpoint(
|
||||
|
||||
if __name__ == "__main__":
|
||||
import uvicorn
|
||||
uvicorn.run(app, host="0.0.0.0", port=8000)
|
||||
uvicorn.run("app.main:app", host="0.0.0.0", port=8000, reload=True)
|
||||
|
||||
Reference in New Issue
Block a user