Class LLMStreamingGenerator.Builder<T,State extends AgentState>
java.lang.Object
org.bsc.langgraph4j.langchain4j.generators.LLMStreamingGenerator.Builder<T,State>
- Type Parameters:
T- the type of the data being processedState- the type of the state extending AgentState
- Enclosing class:
- LLMStreamingGenerator<T,
State extends AgentState>
Builder class for constructing instances of LLMStreamingGenerator.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds and returns an instance of LLMStreamingGenerator.Sets the mapping function for the builder.queue(BlockingQueue<org.bsc.async.AsyncGenerator.Data<StreamingOutput<State>>> queue) Sets the queue for the builder.startingNode(String node) Sets the starting node for the builder.startingState(State state) Sets the starting state for the builder.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
queue
public LLMStreamingGenerator.Builder<T,State> queue(BlockingQueue<org.bsc.async.AsyncGenerator.Data<StreamingOutput<State>>> queue) Sets the queue for the builder.- Parameters:
queue- the blocking queue for async generator data- Returns:
- the builder instance
-
mapResult
public LLMStreamingGenerator.Builder<T,State> mapResult(Function<dev.langchain4j.model.output.Response<T>, Map<String, Object>> mapResult) Sets the mapping function for the builder.- Parameters:
mapResult- a function to map the response to a result- Returns:
- the builder instance
-
startingNode
Sets the starting node for the builder.- Parameters:
node- the starting node- Returns:
- the builder instance
-
startingState
Sets the starting state for the builder.- Parameters:
state- the initial state- Returns:
- the builder instance
-
build
Builds and returns an instance of LLMStreamingGenerator.- Returns:
- a new instance of LLMStreamingGenerator
-