Add transitional learning detect with in-dialog mask review.
Senses grow from confirmations instead of a word list, so a later local pipeline can decide homonyms on a short passage. Default stays semantic. Local detect waits longer, and the reverse-proxy timeout is documented so Dev does not 504 first. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
59921fc5b5
commit
fa1c11c33e
29 files changed
+1135
-45
No files matched your search
@@ -5,8 +5,9 @@ from fastapi.responses import FileResponse
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
from auth import require_auth
|
||||
from detect_learning import pending_for_conversation
|
||||
from dialogue_store import StoreError, delete_conversation, get_conversation, list_messages
|
||||
from dialogue_turn import run_turn, visible_for_role
|
||||
from dialogue_turn import continue_turn, run_turn, visible_for_role
|
||||
from privacy_gateway import GatewayRequest, inspect, public_error_detail
|
||||
from engine import EngineError
|
||||
from journal_generate import generate_draft
|
||||
@@ -96,6 +97,11 @@ class TurnWrite(BaseModel):
|
||||
id: str | None = None
|
||||
|
||||
|
||||
class MaskReviewWrite(BaseModel):
|
||||
review_id: str
|
||||
decisions: list[dict] = Field(default_factory=list)
|
||||
|
||||
|
||||
class GenerateWrite(BaseModel):
|
||||
conversation_ids: list[str] | None = None
|
||||
include_existing: bool = False
|
||||
@@ -286,7 +292,11 @@ def remove_conversation(conversation_id: str, session: dict = Depends(require_au
|
||||
def read_conversation(conversation_id: str, session: dict = Depends(require_auth)):
|
||||
try:
|
||||
conv = get_conversation(session["profile_id"], conversation_id)
|
||||
return {"conversation": conv, "messages": list_messages(session["profile_id"], conversation_id)}
|
||||
payload = {"conversation": conv, "messages": list_messages(session["profile_id"], conversation_id)}
|
||||
pending = pending_for_conversation(session["profile_id"], conversation_id)
|
||||
if pending:
|
||||
payload["pending_mask_review"] = pending
|
||||
return payload
|
||||
except StoreError as exc:
|
||||
_http(exc)
|
||||
|
||||
@@ -308,6 +318,17 @@ def conversation_turn(conversation_id: str, body: TurnWrite, session: dict = Dep
|
||||
_http(exc)
|
||||
|
||||
|
||||
@router.post("/conversations/{conversation_id}/turn/review")
|
||||
def conversation_turn_review(conversation_id: str, body: MaskReviewWrite, session: dict = Depends(require_auth)):
|
||||
try:
|
||||
return visible_for_role(
|
||||
continue_turn(session["profile_id"], conversation_id, body.review_id, body.decisions),
|
||||
session.get("role"),
|
||||
)
|
||||
except (StoreError, EngineError) as exc:
|
||||
_http(exc)
|
||||
|
||||
|
||||
@router.get("/generation-settings")
|
||||
def read_generation_settings(session: dict = Depends(require_auth)):
|
||||
return settings_payload(session["profile_id"])
|
||||
|
||||
Reference in new issue
Block a user