mirror of
https://github.com/langgenius/dify.git
synced 2026-05-03 17:08:03 +08:00
refactor(api): add UserFrom creator role conversion and reuse in knowledge retrieval
Tests not run (not requested).
This commit is contained in:
@ -12,6 +12,11 @@ class UserFrom(StrEnum):
|
||||
ACCOUNT = "account"
|
||||
END_USER = "end-user"
|
||||
|
||||
def to_creator_user_role(self) -> "CreatorUserRole":
|
||||
if self == UserFrom.ACCOUNT:
|
||||
return CreatorUserRole.ACCOUNT
|
||||
return CreatorUserRole.END_USER
|
||||
|
||||
|
||||
class WorkflowRunTriggeredFrom(StrEnum):
|
||||
DEBUGGING = "debugging"
|
||||
|
||||
Reference in New Issue
Block a user