Interface StreamingPromptRunner
-
- All Implemented Interfaces:
-
com.embabel.agent.api.common.PromptRunner,com.embabel.agent.api.common.PromptRunnerOperations,com.embabel.agent.core.ToolGroupConsumer,com.embabel.agent.core.support.LlmUse,com.embabel.common.ai.prompt.PromptContributorConsumer
public interface StreamingPromptRunner implements PromptRunner
Extension of PromptRunner that provides streaming capabilities for progressive LLM response processing. Enables real-time object creation and thinking streams.
Implementations of this interface guarantee streaming support and override the base PromptRunner behavior to provide real streaming operations.
Usage:
val streamingRunner = context.ai().withAutoLlm() as StreamingPromptRunner val restaurantStream = streamingRunner.stream() .withPrompt("Find 5 restaurants in Paris") .createObjectStream(Restaurant::class.java)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceStreamingPromptRunner.StreamingFluent interface for reactive streaming operations from LLM responses. Provides configuration options for:
Streaming object creation
Streaming with thinking content
Instances are obtained via StreamingPromptRunner.streaming.
-
Method Summary
Modifier and Type Method Description BooleansupportsStreaming()StreamingPromptRunner implementations always support streaming. abstract StreamingPromptRunner.Streamingstreaming()Return a StreamingPromptRunner.Streaming for reactive streaming operations. -
Methods inherited from class com.embabel.agent.api.common.PromptRunner
creating, getImages, getMessages, getToolObjects, rendering, respond, stream, supportsThinking, thinking, withContextualPromptContributor, withContextualPromptContributors, withFunctionTools, withGenerateExamples, withGuardRails, withHandoffs, withId, withImage, withImages, withImages, withInteractionId, withLlm, withMessage, withMessages, withMessages, withPromptContributor, withPromptContributors, withPromptElements, withPropertyFilter, withReference, withReferences, withReferences, withSubagents, withSystemPrompt, withTemplate, withThinking, withTool, withToolGroup, withToolGroup, withToolGroup, withToolGroups, withToolObject, withToolObject, withToolObjectInstances, withToolObjects, withTools, withTools, withValidation -
Methods inherited from class com.embabel.agent.api.common.PromptRunnerOperations
createObject, createObject, createObject, createObjectIfPossible, createObjectIfPossible, createObjectIfPossible, evaluateCondition, generateText, generateText, respond -
Methods inherited from class com.embabel.agent.core.support.LlmUse
getGenerateExamples, getLlm, getPropertyFilter, getValidation -
Methods inherited from class com.embabel.common.ai.prompt.PromptContributorConsumer
getPromptContributors -
Methods inherited from class com.embabel.agent.core.ToolGroupConsumer
getToolGroups -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
supportsStreaming
Boolean supportsStreaming()
StreamingPromptRunner implementations always support streaming. Overrides the base PromptRunner default of false.
-
streaming
abstract StreamingPromptRunner.Streaming streaming()
Return a StreamingPromptRunner.Streaming for reactive streaming operations.
- Returns:
streaming operations for reactive object and text generation
-
-
-
-