Class ChatModelCall

java.lang.Object
dev.langchain4j.test.service.ModelCall
dev.langchain4j.test.service.ChatModelCall

@Experimental public final class ChatModelCall extends ModelCall
A call to a chat model made during an AI Service invocation (see ModelCall). The calls the AI Service makes to its own chat model are marked with isOwn().
  • Method Details

    • request

      public ChatRequest request()
      Returns the request sent to the chat model.
      Specified by:
      request in class ModelCall
    • response

      public ChatResponse response()
      Returns the response of the chat model, or null if the call failed or had not ended when the invocation finished.
      Specified by:
      response in class ModelCall
    • isOwn

      public boolean isOwn()
      Returns whether the AI Service made this call itself, to its own chat model (see AiServiceInvocation.ownChatModelCalls()), rather than a component it runs. A call that returned a response is the AI Service's own when the AI Service received that response. A call that failed is the AI Service's own when the AI Service sent a request with the same messages: in the rare case where a component sends exactly the same messages to a chat model and that call fails, it is also reported as the AI Service's own.
    • toString

      public String toString()
      Overrides:
      toString in class ModelCall