Interface ChatCompletionsClient

All Known Implementing Classes:
ChatCompletionsHttpClient

public interface ChatCompletionsClient
A client for interacting with OpenAI-compatible chat completions endpoints.

Supports both non-streaming responses (single LlmResponse emission) and streaming Server-Sent Events (SSE) responses (multiple incremental LlmResponse emissions). See the OpenAI Chat Completions API reference for the wire protocol.

  • Method Summary

    Modifier and Type
    Method
    Description
    io.reactivex.rxjava3.core.Flowable<LlmResponse>
    complete(LlmRequest llmRequest, boolean stream)
    Generates a conversational response from the chat completions endpoint based on the provided messages.
  • Method Details

    • complete

      io.reactivex.rxjava3.core.Flowable<LlmResponse> complete(LlmRequest llmRequest, boolean stream)
      Generates a conversational response from the chat completions endpoint based on the provided messages. This encapsulates building the payload, sending the request to the completions endpoint, and initiating the handling of complete calls.
      Parameters:
      llmRequest - The request containing the model, configuration, and sequence of messages.
      stream - Whether to request a streaming response.
      Returns:
      A Flowable emitting the discrete (or combined) LlmResponse objects.