Class Actor

  • All Implemented Interfaces:
    com.embabel.common.ai.prompt.PromptContributor , com.embabel.common.ai.prompt.PromptElement

    @Validated() 
    public class Actor<T extends PromptContributor>
     implements PromptContributor
                        

    An Actor plays a role: Convenient way to combine a PromptContributor with an LLM and tools. Open to allow subclasses to add tools via @Tool methods

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Constructor Summary

      Constructors 
      Constructor Description
      Actor(String instruction, LlmOptions llm, Set<String> toolGroups) Construct an Actor with a simple instruction as persona.
      Actor(String instruction, LlmOptions llm) Construct an Actor with a simple instruction as persona.
      Actor(T persona, LlmOptions llm, Set<String> toolGroups)
      Actor(T persona, LlmOptions llm)
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final T getPersona()
      final LlmOptions getLlm()
      final Set<String> getToolGroups()
      final PromptRunner promptRunner(Ai ai) Return a PromptRunner configured with this Actor's persona, LLM, and tools.
      final PromptRunner promptRunner(OperationContext context) Return a PromptRunner configured with this Actor's persona, LLM, and tools.
      String toString()
      • Methods inherited from class com.embabel.common.ai.prompt.PromptElement

        getPromptContributionLocation, getRole
      • Methods inherited from class com.embabel.common.ai.prompt.PromptContributor

        contribution, promptContribution
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Actor

        Actor(String instruction, LlmOptions llm, Set<String> toolGroups)
        Construct an Actor with a simple instruction as persona.
      • Actor

        Actor(String instruction, LlmOptions llm)
        Construct an Actor with a simple instruction as persona.
      • Actor

        Actor(T persona, LlmOptions llm, Set<String> toolGroups)
      • Actor

        Actor(T persona, LlmOptions llm)
    • Method Detail

      • getLlm

         final LlmOptions getLlm()
      • promptRunner

         final PromptRunner promptRunner(Ai ai)

        Return a PromptRunner configured with this Actor's persona, LLM, and tools. The caller can continue to customize this PromptRunner before using it to create objects or generate text.

      • promptRunner

         final PromptRunner promptRunner(OperationContext context)

        Return a PromptRunner configured with this Actor's persona, LLM, and tools. The caller can continue to customize this PromptRunner before using it to create objects or generate text.