onFinish(execution): Called when execution is finished.
Non-Streaming Execution
For non-streaming, background execution, omit the onEvent and onFinish callbacks. The method returns immediately with an execution ID.
Using agent.executeMultipart
The executeMultipart method allows you to upload a file and use it as an agent input in the same request, eliminating the need to upload it separately.
Parameters:
inputs: Agent input parameters.
stream: Set to true for streaming execution.
File inputs: An object where keys are parameter names and values are Blob objects.
Note: This method simplifies the process of using files as inputs by combining upload and execution into one step.
Notes
Streaming vs. Non-Streaming Execution:
Streaming Execution: Use stream: true and provide onEvent and onFinish callbacks to receive real-time updates.
Non-Streaming Execution: Omit stream, onEvent, and onFinish to execute in the background and receive an execution ID immediately.