Class InvocationRegistry

java.lang.Object
dev.langchain4j.test.service.internal.InvocationRegistry

public final class InvocationRegistry extends Object
Assigns AI Service events to recordings. An invocation belongs to a recording when it starts on a thread that is recording, or when it was started by an invocation that belongs to it. All later events of the invocation are matched by its invocation id.
  • Method Details

    • isListening

      public static boolean isListening()
      Returns whether the recording listeners were registered with at least one AI Service in this JVM.
    • startRecordingThread

      public static RecordingSession startRecordingThread(RecordingSession recording)
      Starts a recording on the current thread.
      Returns:
      the recording that was active on this thread before, to be passed to stopRecordingThread(RecordingSession)
    • stopRecordingThread

      public static void stopRecordingThread(RecordingSession previous)
    • newSession

      public static RecordingSession newSession()
    • close

      public static void close(RecordingSession recording)
      Stops matching events to the invocations of the given recording.