mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-06-02 19:55:18 +02:00
refactor: anonymous/free chat experience
- Enhanced lambda function formatting in `_after_commit` for better clarity. - Simplified generator expression in `_match_condition` for improved readability. - Streamlined function signature in `_eligible` for consistency. - Updated imports and refactored anonymous chat routes to use a new agent creation method. - Added a new function `_load_anon_document` to handle document loading from Redis. - Improved UI components by replacing legacy structures with modern alternatives, including alerts and separators. - Refactored quota-related components to utilize new alert structures for better user feedback. - Cleaned up unused variables and optimized component states for performance.
This commit is contained in:
parent
0cce9b7e64
commit
0f2e3c7655
17 changed files with 493 additions and 278 deletions
|
|
@ -65,8 +65,7 @@ def _match_condition(condition: Any, actual: Any) -> bool:
|
|||
return False
|
||||
if isinstance(condition, dict):
|
||||
return all(
|
||||
_apply_operator(op, operand, actual)
|
||||
for op, operand in condition.items()
|
||||
_apply_operator(op, operand, actual) for op, operand in condition.items()
|
||||
)
|
||||
return actual == condition
|
||||
|
||||
|
|
|
|||
|
|
@ -41,9 +41,7 @@ async def _select_and_start(event_dict: dict[str, Any]) -> None:
|
|||
await _start_one(session, trigger=trigger, event=event)
|
||||
|
||||
|
||||
async def _eligible(
|
||||
session: AsyncSession, *, event: Event
|
||||
) -> list[AutomationTrigger]:
|
||||
async def _eligible(session: AsyncSession, *, event: Event) -> list[AutomationTrigger]:
|
||||
"""Enabled ``event`` triggers for this event type whose filter matches."""
|
||||
stmt = select(AutomationTrigger).where(
|
||||
AutomationTrigger.type == TriggerType.EVENT,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue