Class ReflectionServer

java.lang.Object
com.google.genkit.ReflectionServer

public class ReflectionServer extends Object
ReflectionServer provides an HTTP API for the Genkit Developer UI to interact with. It exposes endpoints for listing actions, running actions, querying traces, and evaluation.
  • Constructor Details

    • ReflectionServer

      public ReflectionServer(Registry registry, int port)
      Creates a new ReflectionServer.
      Parameters:
      registry - the Genkit registry
      port - the port to listen on
  • Method Details

    • getRuntimeId

      public String getRuntimeId()
      Gets the runtime ID.
    • start

      public void start() throws Exception
      Starts the reflection server.
      Throws:
      Exception - if the server fails to start
    • stop

      public void stop() throws Exception
      Stops the reflection server.
      Throws:
      Exception - if the server fails to stop
    • storeTrace

      public static void storeTrace(TraceData trace)
      Stores a trace in the in-memory trace store for Dev UI access. This is called by the LocalTelemetryStore span processor.
      Parameters:
      trace - the trace to store
    • getTrace

      public static TraceData getTrace(String traceId)
      Gets a trace by ID from the in-memory store.
      Parameters:
      traceId - the trace ID
      Returns:
      the trace data, or null if not found