Class OpenAiRestApi.OpenAiRestApiReaderInterceptor

java.lang.Object
io.quarkiverse.langchain4j.openai.OpenAiRestApi.OpenAiRestApiReaderInterceptor
All Implemented Interfaces:
jakarta.ws.rs.ext.ReaderInterceptor
Enclosing interface:
OpenAiRestApi

@Provider @ConstrainedTo(CLIENT) public static class OpenAiRestApi.OpenAiRestApiReaderInterceptor extends Object implements jakarta.ws.rs.ext.ReaderInterceptor
This method does two things:

First, it returns null instead of throwing an exception when last streaming API result comes back and. This result is a "[DONE]" message, so it cannot map onto the domain. Second, it validates that the response is not empty, which happens when the API returns an error object

  • Constructor Details

    • OpenAiRestApiReaderInterceptor

      public OpenAiRestApiReaderInterceptor()
  • Method Details

    • aroundReadFrom

      public Object aroundReadFrom(jakarta.ws.rs.ext.ReaderInterceptorContext context) throws IOException, jakarta.ws.rs.WebApplicationException
      Specified by:
      aroundReadFrom in interface jakarta.ws.rs.ext.ReaderInterceptor
      Throws:
      IOException
      jakarta.ws.rs.WebApplicationException