Interface for AI service events, exposing invocation context and event type for observability.
// Source: https://github.com/langchain4j/langchain4j | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
// Provided via justclaw.it.com; keep this notice with the code.
package dev.langchain4j.observability.api.event;
import dev.langchain4j.invocation.InvocationContext;
public interface AiServiceEvent {
/**
* Retrieves the invocation context, containing general information
* about where and how the invocation originated.
*/
InvocationContext invocationContext();
/**
* Retrieves the class type of the event, representing the specific category
* of the AI Service invocation event.
*/
// Implementation note: I implemented it this way on purpose (rather than defining an enum of "Event Types")
// So
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key