Interface IPromptExecutionContext
public interface IPromptExecutionContext
Context used during execution of a prompt query. Provides access to needed functionality such as storing binary data
or replacing placeholders. Different implementations may provide different behaviors and defaults for these
functionalities depending on the context where the prompt query is executed (e.g. within a workflow execution, in a
standalone REST API call, or when editing and testing a query in the backend UI).
- Since:
- 8.5.0
-
Method Summary
Modifier and TypeMethodDescriptionGets the file storage that can be used when you need to store binary data during prompt execution.Gets the ID of the form record scope where the query execution was started, if any.Gets the ID of the form record session where the query execution was started, if any.Gets the scope of the form record where the query execution was started, if any.Gets the ID of the project scope where the query execution was started, if any.replacer()Creates a new builder for a replacer that can replace placeholders in strings.tenantId()Gets the ID of the tenant scope where the query execution was started, if any.Gets a stable identifier of the user ora agent on behalf of whom the prompt query is executed.Gets the ID of the workflow version where the query execution was started, if any.
-
Method Details
-
tenantId
Long tenantId()Gets the ID of the tenant scope where the query execution was started, if any.- Returns:
- The tenant ID; or null if no tenant scope is available.
-
fileStorage
IPromptFileStorage fileStorage()Gets the file storage that can be used when you need to store binary data during prompt execution.- Returns:
- The file storage.
-
formRecordId
Long formRecordId()Gets the ID of the form record scope where the query execution was started, if any.- Returns:
- The form record ID; or null if no form record scope is available.
-
formRecordSessionId
String formRecordSessionId()Gets the ID of the form record session where the query execution was started, if any.- Returns:
- The form record session ID; or null if no form record session scope is available.
-
formVersionId
Long formVersionId()Gets the scope of the form record where the query execution was started, if any.- Returns:
- The form record scope; or null if no form record scope is available.
-
projectId
Long projectId()Gets the ID of the project scope where the query execution was started, if any.- Returns:
- The project ID; or null if no project scope is available.
-
replacer
IPromptExecutionReplacer replacer()Creates a new builder for a replacer that can replace placeholders in strings. The defaults of the builder depend on the context where the execution takes places. For example, when the execution takes place within a workflow execution, form placeholders will be replaced by default. When the execution takes place in a standalone REST API context, form placeholders will not be replaced by default.- Returns:
- The new builder.
-
userIdentifier
String userIdentifier()Gets a stable identifier of the user ora agent on behalf of whom the prompt query is executed. May be null if no user or agent 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 be a username or email address, but rather a stable hash or numeric identifier.- Returns:
- The stable identifier of the user on behalf of whom the prompt query is executed, or empty if no user is associated with the execution.
-
workflowVersionId
Long workflowVersionId()Gets the ID of the workflow version where the query execution was started, if any.- Returns:
- The workflow version ID; or null if no workflow version scope is available.
-