Package com.google.genkit
Class ReflectionServer
java.lang.Object
com.google.genkit.ReflectionServer
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 Summary
ConstructorsConstructorDescriptionReflectionServer(Registry registry, int port) Creates a new ReflectionServer. -
Method Summary
Modifier and TypeMethodDescriptionGets the runtime ID.static TraceDataGets a trace by ID from the in-memory store.voidstart()Starts the reflection server.voidstop()Stops the reflection server.static voidstoreTrace(TraceData trace) Stores a trace in the in-memory trace store for Dev UI access.
-
Constructor Details
-
ReflectionServer
Creates a new ReflectionServer.- Parameters:
registry- the Genkit registryport- the port to listen on
-
-
Method Details
-
getRuntimeId
Gets the runtime ID. -
start
Starts the reflection server.- Throws:
Exception- if the server fails to start
-
stop
Stops the reflection server.- Throws:
Exception- if the server fails to stop
-
storeTrace
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
Gets a trace by ID from the in-memory store.- Parameters:
traceId- the trace ID- Returns:
- the trace data, or null if not found
-