Skip to content

Commit 89aa89e

Browse files
committed
fix: workflow file add related-id in iteration node
Signed-off-by: kenwoodjw <[email protected]>
1 parent cade0f6 commit 89aa89e

File tree

6 files changed

+10
-2
lines changed

6 files changed

+10
-2
lines changed

api/core/file/enums.py

+1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ class FileAttribute(StrEnum):
4949
TRANSFER_METHOD = "transfer_method"
5050
URL = "url"
5151
EXTENSION = "extension"
52+
RELATED_ID = "related_id"
5253

5354

5455
class ArrayFileAttribute(StrEnum):

api/core/file/file_manager.py

+2
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ def get_attr(*, file: File, attr: FileAttribute):
3434
return file.remote_url
3535
case FileAttribute.EXTENSION:
3636
return file.extension
37+
case FileAttribute.RELATED_ID:
38+
return file.related_id
3739

3840

3941
def to_prompt_message_content(

web/app/components/workflow/constants.ts

+4
Original file line numberDiff line numberDiff line change
@@ -556,6 +556,10 @@ export const FILE_STRUCT: Var[] = [
556556
variable: 'url',
557557
type: VarType.string,
558558
},
559+
{
560+
variable: 'related_id',
561+
type: VarType.string,
562+
},
559563
]
560564

561565
export const DEFAULT_FILE_UPLOAD_SETTING = {

web/app/components/workflow/nodes/constants.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,5 +100,5 @@ export const TRANSFER_METHOD = [
100100
{ value: TransferMethod.remote_url, i18nKey: 'url' },
101101
]
102102

103-
export const SUB_VARIABLES = ['type', 'size', 'name', 'url', 'extension', 'mime_type', 'transfer_method']
103+
export const SUB_VARIABLES = ['type', 'size', 'name', 'url', 'extension', 'mime_type', 'transfer_method', 'related_id']
104104
export const OUTPUT_FILE_SUB_VARIABLES = SUB_VARIABLES.filter(key => key !== 'transfer_method')

web/app/components/workflow/nodes/loop/default.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ export const TRANSFER_METHOD = [
8383
{ value: TransferMethod.remote_url, i18nKey: 'url' },
8484
]
8585

86-
export const SUB_VARIABLES = ['type', 'size', 'name', 'url', 'extension', 'mime_type', 'transfer_method']
86+
export const SUB_VARIABLES = ['type', 'size', 'name', 'url', 'extension', 'mime_type', 'transfer_method', 'related_id']
8787
export const OUTPUT_FILE_SUB_VARIABLES = SUB_VARIABLES.filter(key => key !== 'transfer_method')
8888

8989
export default nodeDefault

web/app/components/workflow/types.ts

+1
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,7 @@ export type RunFile = {
339339
transfer_method: TransferMethod[]
340340
url?: string
341341
upload_file_id?: string
342+
related_id?: string
342343
}
343344

344345
export type WorkflowRunningData = {

0 commit comments

Comments
 (0)