Interface StreamingPromptRunner

  • All Implemented Interfaces:
    com.embabel.agent.api.common.PromptRunner , com.embabel.agent.api.common.PromptRunnerOperations , com.embabel.agent.api.tool.agentic.ToolChaining , 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 interface StreamingPromptRunner.Streaming

      Fluent 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.

    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      Boolean supportsStreaming() StreamingPromptRunner implementations always support streaming.
      abstract StreamingPromptRunner.Streaming streaming() 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, withId, withImage, withImages, withImages, withInteractionId, withLlm, withMessage, withMessages, withMessages, withPromptContributor, withPromptContributors, withPromptElements, withPropertyFilter, withReference, withReferences, withReferences, withSystemPrompt, withTemplate, withThinking, withTool, withToolGroup, withToolGroup, withToolGroup, withToolGroups, withToolGroups, withToolObject, withToolObject, withToolObjectInstances, withToolObjects, withToolObjects, withTools, 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.api.tool.agentic.ToolChaining

        withToolChainingFrom, withToolChainingFrom, withToolChainingFromAny
      • 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