Class AiFeatureRest

java.lang.Object
fr.paris.lutece.plugins.wiki.modules.ai.rs.AbstractRestEndpoint
fr.paris.lutece.plugins.wiki.modules.ai.rs.AiFeatureRest

@RequestScoped @Path("wiki/ai/features") public class AiFeatureRest extends AbstractRestEndpoint
REST endpoint for AI feature operations including streaming responses.
  • Constructor Details

    • AiFeatureRest

      public AiFeatureRest()
  • Method Details

    • getFeatures

      @GET @Produces("application/json") public jakarta.ws.rs.core.Response getFeatures(@QueryParam("type") String strType)
      Retrieves available AI features, optionally filtered by type.
      Parameters:
      strType - optional feature type filter
      Returns:
      response containing the list of features or error details
    • getRateLimitStatus

      @GET @Path("ratelimit") @Produces("application/json") public jakarta.ws.rs.core.Response getRateLimitStatus()
      Retrieves the rate limit status for the current user.
      Returns:
      response containing the rate limit status or error details
    • initStreamingFeature

      @POST @Path("stream/init") @Consumes("application/json") @Produces("application/json") public jakarta.ws.rs.core.Response initStreamingFeature(Map<String,Object> request)
      Initializes a streaming AI feature execution.
      Parameters:
      request - the request containing feature_id and text
      Returns:
      response containing the stream_id or error details
    • initStreamingEdit

      @POST @Path("stream/edit") @Consumes("application/json") @Produces("application/json") public jakarta.ws.rs.core.Response initStreamingEdit(Map<String,Object> request)
      Initializes a streaming AI edit of a selection: a feature or an instruction applied to the selection, then refined step by step.
      Parameters:
      request - the request containing the selected text and the steps, the last one being the request to run
      Returns:
      response containing the stream_id or error details
    • getStreamingFeatureEvents

      @GET @Path("stream/events/{streamId}") @Produces("text/event-stream") public void getStreamingFeatureEvents(@PathParam("streamId") String streamId, @Context jakarta.ws.rs.sse.SseEventSink eventSink, @Context jakarta.ws.rs.sse.Sse sse)
      Establishes an SSE connection for receiving streaming feature events.
      Parameters:
      streamId - the stream identifier
      eventSink - the SSE event sink
      sse - the SSE context