Interface IPromptExecutionResolveFilesBuilder
public interface IPromptExecutionResolveFilesBuilder
Builder for resolving a files configuration into actual files.
Given a list of file set parameters and/or a list of configured
static files, resolves those files into the actual binary data.
For dynamic files (file set parameters), this method reads the files from the provided request object.
- Since:
- 8.5.0
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Resolves all files according to the current settings of this builder, and returns those files.Resolves all files according to the current settings of this builder, and returns those files as a flat list.dynamicFiles(List<PromptFileSetParameter> files) Sets the list of dynamic files (file parameters) to resolve, by reading them from the request object.files(IPromptQueryConfig_Files files) Sets the files to resolve.files(PromptFiles files) Sets the files to resolve.Sets the prefix to apply when extracting dynamic files from the request object.requestObject(IPromptQueryRequestObject requestObject) Sets the request object from which to read dynamic files (file parameters).staticFiles(List<PromptConfigFile> files) Sets the list of static files to resolve.
-
Method Details
-
build
Resolves all files according to the current settings of this builder, and returns those files.- Throws:
PromptExecutionException- If an error occurs while resolving the files, e.g. when an I/O error occurs while reading a file; or when a required file is missing.
-
buildFlat
Resolves all files according to the current settings of this builder, and returns those files as a flat list. Static files appear first in the returned list, dynamic files afterward.- Returns:
- The resolved files.
- Throws:
PromptExecutionException- If an error occurs while resolving the files, e.g. when an I/O error occurs while reading a file; or when a required file is missing.
-
dynamicFiles
@CanIgnoreReturnValue IPromptExecutionResolveFilesBuilder dynamicFiles(List<PromptFileSetParameter> files) Sets the list of dynamic files (file parameters) to resolve, by reading them from the request object.- Parameters:
files- The dynamic files.- Returns:
- This builder for chaining method calls.
-
files
Sets the files to resolve.- Parameters:
files- The files.- Returns:
- This builder for chaining method calls.
-
files
Sets the files to resolve.- Parameters:
files- The files.- Returns:
- This builder for chaining method calls.
-
keyPrefix
Sets the prefix to apply when extracting dynamic files from the request object. This prefix is added to thekeyof eachfile parameter(with a trailing dot), then that combined key is used to look up the file in the request object'sfiles map.Defaults to
"files", which is suitable for the main set of input files of a query. If you have a secondary set of files (such as a mask for an image inpainting task), you need to configure the key prefix accordingly (e.g. "mask").- Parameters:
keyPrefix- The key prefix, without a trailing dot.- Returns:
- This builder for chaining method calls.
-
requestObject
@CanIgnoreReturnValue IPromptExecutionResolveFilesBuilder requestObject(IPromptQueryRequestObject requestObject) Sets the request object from which to read dynamic files (file parameters).- Parameters:
requestObject- The request object to read the files from.- Returns:
- This builder for chaining method calls.
-
staticFiles
Sets the list of static files to resolve.- Parameters:
files- The static files.- Returns:
- This builder for chaining method calls.
-