sync: 鍚屾灞€鍩熺綉鏈€鏂颁唬鐮?(source master @ b69568e4)
This commit is contained in:
1 parent
4f7f07504a
commit
8bc8b0e082
1651 files changed
+278599
-11416
No files matched your search
@@ -1,9 +1,9 @@
|
||||
"""Per-user UI preferences (account-bound, follow the user across devices).
|
||||
|
||||
Currently exposes a single toggle: ``hide_admin_prompt_prefix`` — when true the
|
||||
chat input hides the admin-configured prompt-prefix switch so the user only uses
|
||||
their own prompts. Kept as a small key-value (JSON) store so new toggles do not
|
||||
each need a schema change.
|
||||
``hide_admin_prompt_prefix`` hides the admin-configured prompt-prefix switch.
|
||||
``followup_suggestions_enabled`` opts in to recommended questions after answers.
|
||||
Kept as a small key-value (JSON) store so new toggles do not each need a schema
|
||||
change.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
@@ -21,10 +21,12 @@ router = APIRouter(prefix="/api/user-preferences", tags=["user-preferences"])
|
||||
|
||||
class UserPreferencesResponse(BaseModel):
|
||||
hide_admin_prompt_prefix: bool = False
|
||||
followup_suggestions_enabled: bool = False
|
||||
|
||||
|
||||
class UserPreferencesUpdateRequest(BaseModel):
|
||||
hide_admin_prompt_prefix: bool | None = Field(default=None)
|
||||
followup_suggestions_enabled: bool | None = Field(default=None)
|
||||
|
||||
|
||||
def _current_user_id(request: Request) -> str:
|
||||
@@ -44,6 +46,7 @@ def _get_store(request: Request):
|
||||
def _to_response(prefs: dict) -> UserPreferencesResponse:
|
||||
return UserPreferencesResponse(
|
||||
hide_admin_prompt_prefix=bool(prefs.get("hide_admin_prompt_prefix", False)),
|
||||
followup_suggestions_enabled=bool(prefs.get("followup_suggestions_enabled", False)),
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user