Execution Options
About
Execution options provide additional control over the request execution.
priority
The priority of the request and the way it should be executed. Applicable only if the EES priority is set to Configurable during EES Wizard. Otherwise, the EES original priority is used.
deduplicationId
Allows preventing the execution of the same request multiple times.
retries
The number of retries. If not provided, the default value from the EES Wizard will be used.
fallback
The service that may be used in case of unsuccessful retries.
callback
The fallback channel in case when EES is asynchronous. If not provided, the default channel from the EES Wizard will be used.
priority
The priority
property determines the execution priority, with options available only if the EES (Elastic Endpoint) priority is set to Configurable during the EES (Elastic Endpoint) Wizard setup.
The system adjusts its load balancing strategy based on the chosen priority options, whether directly selected or configured through the EES (Elastic Endpoint) wizard. Opting for suitable priorities can lead to cost savings on services like AIL (AI Lambda), especially when there's a defined timeframe for execution.
The following options are available:
AT_EASE:
The request will be executed as soon as possible depending on the current load of the system.
PRIORITIZED:
The request will be executed with the highest priority. However, it will be executed only after all INSTANT requests. If the system is overloaded, the request may be delayed.
INSTANT:
Regardless of the system load, the request will be executed immediately.
Use Cases
⭐️ Delayed Execution
When real-time results are not imperative, C4AI offers cost-saving opportunities on processing. For instance, if there's a week-long timeframe to prepare marketing materials, utilizing the AT_EASE
priority can be advantageous.
⭐️ Background Processing
For tasks such as document parsing or preparing design materials (e.g., an Image Library) that can be processed in the background, delaying execution helps in cost reduction. When combined with EES (Elastic Endpoint) ASYNC
mode, this approach facilitates the development of event-oriented data processing workflows with minimal additional effort.
deduplicationId
The deduplicationId
property prevents the execution of duplicate requests. The system will retain only the initial request associated with the deduplicationId
. Subsequent requests will be disregarded until the corresponding C4AI Command Request transitions into either a COMPLETED or FAILED state.
Use Cases
⭐️ Continues Updates
By utilizing the deduplicationId
, you can effectively avoid redundant executions. For instance, if you maintain your database containing product information that administrators can update at any time, you can generate a custom deduplicationId incorporating your product ID. This approach helps minimize the number of requests to the Embeddings API.
retries
The retries
property specifies the number of retries, utilizing the default value from the EES Wizard if not provided.
By adjusting the retry count, you can tailor the handling of unsuccessful executions to your specific needs. The maximum number of retries allowed is set at 10.
💡 Note: If you're looking for more advanced Retry Policies, please contact us via Support Requests in Your C4AI Cloud Console.
Use Cases
⭐️ Instability of AI Providers
In scenarios where the AI provider encounters stability issues, such as maintenance downtime, critical responses may be impacted. In such cases, defining the number of retries can mitigate the impact on user experience.
fallback
The fallback
property specifies a service to use in case of unsuccessful retries.
Fallback Commands offer the flexibility to determine alternative actions in situations where all retries have been exhausted and the command still fails. By supplying an array of alternative commands, you can devise a customized behavior that aligns with your specific requirements.
❗️Note: All commands provided in Array will be executed in the same sequence as they are define during the request
In contrast to callback, fallbacks are triggered on unsuccessful executions. Therefore, even if you submit an ASYNC request without a predefined callback operation, you have the option to define your own behavior using fallbacks.
Use Cases
⭐️ Instability of AI Providers
When you require an alternative AI provider to be utilized in the event of primary provider downtime, you can specify this using an additional command.
⭐️ Background Fail
In scenarios where your requests are in ASYNC mode, you can designate one or more API schemas as callbacks to receive notifications regarding failed executions.
In the example below, the WebHook will be called only in case when both: primary and alternative AI providers fail.
callback
The callback
property specifies a fallback channel in case EES is asynchronous, utilizing the default channel from the EES Wizard if not provided.
With Callback, you can specify one or more channels where data should be posted, effectively functioning as a broadcast mechanism. Consequently, all callback commands provided in an array will be executed regardless of their order, alongside the result of the command execution.
💡 Note: When additional mapping or object destruction is required, leverage the SDK's predefined parameters.
Use Cases
⭐️ Additional Storage
By utilizing callback, you can direct the result to be stored in various storage options such as KDB, CDB, or even as a file within the system, if necessary. In these scenarios, all objects will be utilized. If any transformations are required, the IDTS service can be employed with additional preferences.
⭐️ Alternative Execution Pipeline
When you require additional processing of the result, you have the option to specify another command or request to the AI provider to utilize the result as input. For instance, the first provider may generate questions, and another provider can subsequently answer them using the generated output.
❗️Note: Unlike fallback , callbacks will only be executed upon successful execution of the target command
Last updated