Package com.embabel.agent.prompt.persona
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 PromptContributorAn 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
-
-
Field Summary
Fields Modifier and Type Field Description private final Tpersonaprivate final LlmOptionsllmprivate final Set<String>toolGroupsprivate final PromptContributionLocationpromptContributionLocationprivate final Stringrole
-
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)
-
Method Summary
Modifier and Type Method Description final TgetPersona()final LlmOptionsgetLlm()final Set<String>getToolGroups()final PromptRunnerpromptRunner(Ai ai)Return a PromptRunner configured with this Actor's persona, LLM, and tools. final PromptRunnerpromptRunner(OperationContext context)Return a PromptRunner configured with this Actor's persona, LLM, and tools. StringtoString()-
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
-
-
Method Detail
-
getPersona
final T getPersona()
-
getLlm
final LlmOptions getLlm()
-
getToolGroups
final Set<String> getToolGroups()
-
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.
-
-
-
-