mirror of
https://github.com/langgenius/dify.git
synced 2026-09-19 10:11:30 +08:00
refactor(dify-agent): download Binding files through Agent Stub (#40143)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
co-authored by
autofix-ci[bot]
parent
c094117ca2
commit
916d7e1c96
@@ -103,14 +103,21 @@ func newFileCommand() *cobra.Command {
|
||||
Short: "Upload or download workflow files through the Agent Stub.",
|
||||
}
|
||||
|
||||
var noDownloadLink bool
|
||||
upload := &cobra.Command{
|
||||
Use: "upload PATH",
|
||||
Short: "Upload one sandbox-local file as a ToolFile output reference.",
|
||||
Args: cobra.ExactArgs(1),
|
||||
RunE: withEnv(func(env *agentcli.Environment, args []string, _ *cobra.Command) error {
|
||||
return agentcli.RunFileUpload(env, args[0])
|
||||
return agentcli.RunFileUpload(env, args[0], noDownloadLink)
|
||||
}),
|
||||
}
|
||||
upload.Flags().BoolVar(
|
||||
&noDownloadLink,
|
||||
"no-download-link",
|
||||
false,
|
||||
"Skip creating a public download link after upload.",
|
||||
)
|
||||
|
||||
var downloadTo string
|
||||
download := &cobra.Command{
|
||||
|
||||
@@ -53,7 +53,12 @@ func TestCommandHelp(t *testing.T) {
|
||||
{
|
||||
name: "file upload",
|
||||
args: []string{"file", "upload", "--help"},
|
||||
want: []string{"dify-agent file upload", "Upload one sandbox-local file"},
|
||||
want: []string{
|
||||
"dify-agent file upload",
|
||||
"Upload one sandbox-local file",
|
||||
"--no-download-link",
|
||||
"Skip creating a public download link after upload.",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "file download",
|
||||
|
||||
Reference in New Issue
Block a user