MVP 1.0
This commit is contained in:
1 parent
be11f82f84
commit
e42f751fdc
47 files changed
+3359
-301
No files matched your search
@@ -7,7 +7,7 @@ from pydantic import BaseModel, Field
|
||||
from auth import require_auth
|
||||
from dialogue_store import StoreError, delete_conversation, get_conversation, list_messages
|
||||
from dialogue_turn import run_turn, visible_for_role
|
||||
from privacy_gateway import GatewayRequest, inspect
|
||||
from privacy_gateway import GatewayRequest, inspect, public_error_detail
|
||||
from engine import EngineError
|
||||
from journal_generate import generate_draft
|
||||
from journal_generation_policy import settings_payload
|
||||
@@ -76,11 +76,7 @@ router = APIRouter(prefix="/api/journal", tags=["journal"])
|
||||
|
||||
|
||||
def _http(exc: StoreError | PolicyError | EngineError):
|
||||
detail = {"code": exc.code, "message": exc.message}
|
||||
extra = getattr(exc, "diagnostics", None)
|
||||
if extra:
|
||||
detail["diagnostics"] = extra
|
||||
raise HTTPException(status_code=exc.status_code, detail=detail) from exc
|
||||
raise HTTPException(status_code=exc.status_code, detail=public_error_detail(exc)) from exc
|
||||
|
||||
|
||||
class SpaceWrite(BaseModel):
|
||||
|
||||
Reference in new issue
Block a user