Interface OllamaRestApi
@Path("")
@Consumes("application/json")
@Produces("application/json")
@RegisterProvider(OllamaRestApiReaderInterceptor.class) @RegisterProvider(OpenAiRestApiWriterInterceptor.class)
public interface OllamaRestApi
This Microprofile REST client is used as the building block of all the API calls to HuggingFace.
The implementation is provided by the Reactive REST Client in Quarkus.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classIntroduce a custom logger as the stock one logs at the DEBUG level by default...static classThis is needed because for some reason Vert.x is not giving us the entire content of the last chunk and this results in a json parsing exception.static classThe point of this is to properly set thestreamvalue of the request so users don't have to remember to set it manually -
Method Summary
Modifier and TypeMethodDescriptionchat(ChatRequest request) embeddings(EmbeddingRequest request) static com.fasterxml.jackson.databind.ObjectMapperobjectMapper(com.fasterxml.jackson.databind.ObjectMapper defaultObjectMapper) io.smallrye.mutiny.Multi<ChatResponse>streamingChat(ChatRequest request)
-
Method Details
-
chat
-
streamingChat
@Path("/api/chat") @POST @RestStreamElementType("application/json") io.smallrye.mutiny.Multi<ChatResponse> streamingChat(ChatRequest request) -
embeddings
-
objectMapper
static com.fasterxml.jackson.databind.ObjectMapper objectMapper(com.fasterxml.jackson.databind.ObjectMapper defaultObjectMapper)
-