Interface AiRequestService


public interface AiRequestService
Cross-plugin OSGi service for asynchronous AI requests.
Since:
1.13.3
  • Method Details

    • askAi

      AiRequestHandle askAi(String prompt, AiRequestOptions options, AiRequestCallback callback)
      Starts an asynchronous AI request for raw prompt text.

      The supplied options must include a positive timeout and a non-null AiRequestMode. System-message handling is controlled by AiRequestOptions.Builder.systemMessage(String) and AiRequestOptions.Builder.exactSystemMessage(String).

      Parameters:
      prompt - prompt text sent as the user request
      options - request options; must include timeout and mode
      callback - callback invoked with the terminal request result
      Returns:
      non-blocking request handle
    • runAiPrompt

      AiRequestHandle runAiPrompt(String promptName, Duration timeout, AiRequestCallback callback)
      Starts an asynchronous AI request from a saved AI prompt name using the supplied timeout and the saved prompt's stored execution defaults.
      Parameters:
      promptName - saved prompt name
      timeout - positive request timeout
      callback - callback invoked with the terminal request result
      Returns:
      non-blocking request handle
    • runAiPrompt

      AiRequestHandle runAiPrompt(String promptName, AiRequestOptions options, AiRequestCallback callback)
      Starts an asynchronous AI request from a saved AI prompt name using options to override saved-prompt execution defaults.

      Unset option fields inherit from the saved prompt where applicable. Explicit values in AiRequestOptions override saved-prompt values; unset fields inside AiModelConfiguration inherit independently.

      Parameters:
      promptName - saved prompt name
      options - request options; must include a positive timeout
      callback - callback invoked with the terminal request result
      Returns:
      non-blocking request handle