Class DefaultPromptExecutionContext.Builder
java.lang.Object
de.xima.fc.prompt.service.defaults.DefaultPromptExecutionContext.Builder
- Enclosing class:
DefaultPromptExecutionContext
A builder for a
IPromptExecutionContext.- Since:
- 8.5.0
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds the execution context with the current settings of this builder.fileStorage(IPromptFileStorage fileStorage) Sets the file storage to use for storing binary data during prompt execution.formRecordId(Long formRecordId) Sets the ID of the form record scope where the query execution was started, if any.formRecordSessionId(String formRecordSessionId) Sets the ID of the form record session scope where the query execution was started, if any.formVersionId(Long formVersionId) Sets the ID of the form version scope where the query execution was started, if any.Sets the ID of the project scope where the query execution was started, if any.replacer(IPromptExecutionReplacer replacer) Sets the replacer to use for replacing placeholders in prompts.Sets the ID of the tenant scope where the query execution was started, if any.userIdentifier(String userIdentifier) Sets a stable identifier of the user on behalf of whom the prompt query is executed.workflowVersionId(Long workflowVersionId) Sets the ID of the workflow version scope where the query execution was started, if any.
-
Method Details
-
build
Builds the execution context with the current settings of this builder.- Returns:
- The execution context.
-
tenantId
Sets the ID of the tenant scope where the query execution was started, if any.- Parameters:
tenantId- The tenant ID; or null if no tenant scope is available.- Returns:
- This builder for chaining method calls.
-
fileStorage
@CanIgnoreReturnValue public DefaultPromptExecutionContext.Builder fileStorage(IPromptFileStorage fileStorage) Sets the file storage to use for storing binary data during prompt execution. If you do not set a file storage, a default in-memory file storage will be used. It is strongly recommended to set a file storage that is appropriate for your environment, e.g. a file storage that stores files on disk. Otherwise, you risk running out of memory when storing large files.- Parameters:
fileStorage- The file storage.- Returns:
- This builder for chaining method calls.
-
formRecordId
Sets the ID of the form record scope where the query execution was started, if any.- Parameters:
formRecordId- The form record ID; or null if no form record context is available.- Returns:
- This builder for chaining method calls.
-
formRecordSessionId
@CanIgnoreReturnValue public DefaultPromptExecutionContext.Builder formRecordSessionId(String formRecordSessionId) Sets the ID of the form record session scope where the query execution was started, if any.- Parameters:
formRecordSessionId- The form record session ID; or null if no form record session scope is available.- Returns:
- This builder for chaining method calls.
-
formVersionId
@CanIgnoreReturnValue public DefaultPromptExecutionContext.Builder formVersionId(Long formVersionId) Sets the ID of the form version scope where the query execution was started, if any.- Parameters:
formVersionId- The form version ID; or null if no form version context is available.- Returns:
- This builder for chaining method calls.
-
projectId
Sets the ID of the project scope where the query execution was started, if any.- Parameters:
projectId- The project ID; or null if no project context is available.- Returns:
- This builder for chaining method calls.
-
replacer
@CanIgnoreReturnValue public DefaultPromptExecutionContext.Builder replacer(IPromptExecutionReplacer replacer) Sets the replacer to use for replacing placeholders in prompts. When no replacer is set, a no-op replacer is used that does not replace any placeholders.- Parameters:
replacer- The replacer.- Returns:
- This builder for chaining method calls.
-
userIdentifier
@CanIgnoreReturnValue public DefaultPromptExecutionContext.Builder userIdentifier(String userIdentifier) Sets a stable identifier of the user on behalf of whom the prompt query is executed. May be null if no user is associated with the execution. This stable identifier can be used, for example, to help detect users that may be violating the prompt services usage policies. Note: For privacy reasons, this identifier will should not be the user's name or email address, but rather a stable hash or numeric identifier.- Parameters:
userIdentifier- The stable identifier of the user on behalf of whom the prompt query is executed, or null if no user is associated with the execution.- Returns:
- This builder for chaining method calls.
-
workflowVersionId
@CanIgnoreReturnValue public DefaultPromptExecutionContext.Builder workflowVersionId(Long workflowVersionId) Sets the ID of the workflow version scope where the query execution was started, if any.- Parameters:
workflowVersionId- The workflow version ID; or null if no workflow version context is available.- Returns:
- This builder for chaining method calls.
-