Interface Model

All Known Subinterfaces:
StreamingModel
All Known Implementing Classes:
OpenAIModel

public interface Model
This interface is used for when a backend dose not supports streaming responses, otherwise use StreamingModel
  • Method Details

    • qurryModel

      CompletableFuture<Message> qurryModel(ChatObject obj, List<Tool> tools)
      Sends the given chat context to the model and requests the next response.
      Parameters:
      obj - the chat context, containing the conversation history to send to the model
      tools - the tools available to the model for this request, or an empty list if none
      Returns:
      a future resolving to the model's reply as a Message
    • singleFire

      CompletableFuture<Message> singleFire(Message msg)
      Sends a single, standalone message to the model, without any prior conversation context.
      Parameters:
      msg - the message to send
      Returns:
      a future resolving to the model's reply as a Message
    • singleFire

      CompletableFuture<Message> singleFire(Message msg, List<Tool> tools)
      Sends a single, standalone message to the model with tool support, without any prior conversation context.
      Parameters:
      msg - the message to send
      tools - the tools available to the model for this request
      Returns:
      a future resolving to the model's reply as a Message
    • getToolSerializer

      ToolSerializer getToolSerializer()
      Returns:
      this backend's ToolSerializer, used to convert Tools into the JSON shape this backend expects. Each backend instance owns its own — this is not shared across the JVM.