Package ai.fal.client

Class FalClientImpl

java.lang.Object
ai.fal.client.FalClientImpl
All Implemented Interfaces:
FalClient

public class FalClientImpl extends Object implements FalClient
  • Method Details

    • run

      @Nonnull public <O> Output<O> run(String endpointId, RunOptions<O> options)
      Description copied from interface: FalClient
      Run the specified endpoint with the provided options. This method is only recommended for short-running operations. For long-running operations, consider using the FalClient.subscribe(String, SubscribeOptions) method to subscribe to the endpoint's results via the queue or FalClient.queue() client for specific queue operations. .
      Specified by:
      run in interface FalClient
      Type Parameters:
      O - Output type.
      Parameters:
      endpointId - The endpoint ID to run, e.g. `fal-ai/fast-sdxl`.
      options - The run options.
      Returns:
      The result of the operation.
    • subscribe

      @Nonnull public <O> Output<O> subscribe(String endpointId, SubscribeOptions<O> options)
      Description copied from interface: FalClient
      Subscribe to the specified endpoint with the provided options. This method is recommended for long-running operations. The subscription will return the result once the operation is completed.
      Specified by:
      subscribe in interface FalClient
      Type Parameters:
      O - Output type.
      Parameters:
      endpointId - The endpoint ID to subscribe to, e.g. `fal-ai/fast-sdxl`.
      options - The subscribe options.
      Returns:
      The result of the operation.
      See Also:
    • queue

      public QueueClient queue()
      Description copied from interface: FalClient
      Get the queue client for interacting with the FAL queue.
      Specified by:
      queue in interface FalClient
      Returns:
      The queue client.