File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
Source/Chatbook/PromptGenerators Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -429,8 +429,22 @@ cleanupLegacyVectorDBFiles // endDefinition;
429
429
(* ::Subsubsection::Closed:: *)
430
430
(*getDownloadSize*)
431
431
getDownloadSize // beginDefinition ;
432
+
432
433
getDownloadSize [ url_ String ] := getDownloadSize @ CloudObject @ url ;
433
- getDownloadSize [ obj : $$cloudObject ] := FileByteCount @ obj ;
434
+ getDownloadSize [ obj : $$cloudObject ] := getDownloadSize [ obj , FileByteCount @ obj ];
435
+ getDownloadSize [ obj_ , size_ Integer ] := size ;
436
+
437
+ getDownloadSize [ obj_ , $Failed ] := throwFailureToChatOutput @ Failure [
438
+ "CloudDownloadError" ,
439
+ < |
440
+ "MessageTemplate" :> Chatbook ::CloudDownloadError ,
441
+ "MessageParameters" -> { },
442
+ "CloudObject" -> obj ,
443
+ "Evaluation" -> HoldForm @ FileByteCount @ obj ,
444
+ "Results" -> $Failed
445
+ |>
446
+ ];
447
+
434
448
getDownloadSize // endDefinition ;
435
449
436
450
(* ::**************************************************************************************************************:: *)
You can’t perform that action at this time.
0 commit comments