mirror of https://github.com/langgenius/dify.git
fix: workflow file add related-id in iteration node (#16255)
Signed-off-by: kenwoodjw <blackxin55+@gmail.com>
This commit is contained in:
parent
d7e00ae691
commit
3306228840
|
|
@ -49,6 +49,7 @@ class FileAttribute(StrEnum):
|
|||
TRANSFER_METHOD = "transfer_method"
|
||||
URL = "url"
|
||||
EXTENSION = "extension"
|
||||
RELATED_ID = "related_id"
|
||||
|
||||
|
||||
class ArrayFileAttribute(StrEnum):
|
||||
|
|
|
|||
|
|
@ -34,6 +34,8 @@ def get_attr(*, file: File, attr: FileAttribute):
|
|||
return file.remote_url
|
||||
case FileAttribute.EXTENSION:
|
||||
return file.extension
|
||||
case FileAttribute.RELATED_ID:
|
||||
return file.related_id
|
||||
|
||||
|
||||
def to_prompt_message_content(
|
||||
|
|
|
|||
|
|
@ -556,6 +556,10 @@ export const FILE_STRUCT: Var[] = [
|
|||
variable: 'url',
|
||||
type: VarType.string,
|
||||
},
|
||||
{
|
||||
variable: 'related_id',
|
||||
type: VarType.string,
|
||||
},
|
||||
]
|
||||
|
||||
export const DEFAULT_FILE_UPLOAD_SETTING = {
|
||||
|
|
|
|||
|
|
@ -100,5 +100,5 @@ export const TRANSFER_METHOD = [
|
|||
{ value: TransferMethod.remote_url, i18nKey: 'url' },
|
||||
]
|
||||
|
||||
export const SUB_VARIABLES = ['type', 'size', 'name', 'url', 'extension', 'mime_type', 'transfer_method']
|
||||
export const SUB_VARIABLES = ['type', 'size', 'name', 'url', 'extension', 'mime_type', 'transfer_method', 'related_id']
|
||||
export const OUTPUT_FILE_SUB_VARIABLES = SUB_VARIABLES.filter(key => key !== 'transfer_method')
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ export const TRANSFER_METHOD = [
|
|||
{ value: TransferMethod.remote_url, i18nKey: 'url' },
|
||||
]
|
||||
|
||||
export const SUB_VARIABLES = ['type', 'size', 'name', 'url', 'extension', 'mime_type', 'transfer_method']
|
||||
export const SUB_VARIABLES = ['type', 'size', 'name', 'url', 'extension', 'mime_type', 'transfer_method', 'related_id']
|
||||
export const OUTPUT_FILE_SUB_VARIABLES = SUB_VARIABLES.filter(key => key !== 'transfer_method')
|
||||
|
||||
export default nodeDefault
|
||||
|
|
|
|||
|
|
@ -339,6 +339,7 @@ export type RunFile = {
|
|||
transfer_method: TransferMethod[]
|
||||
url?: string
|
||||
upload_file_id?: string
|
||||
related_id?: string
|
||||
}
|
||||
|
||||
export type WorkflowRunningData = {
|
||||
|
|
|
|||
Loading…
Reference in New Issue