Agents
Agent
The YeagerAIAgent
class is the core component of YeagerAI's yAgents. It is responsible for orchestrating the execution of tasks by utilizing various modules and interfacing with the Memory and Toolkit. The agent is highly customizable, enabling users to tailor their AI solutions to their specific needs.
To create an instance of YeagerAIAgent
, you need to provide the following parameters:
username
: The user's name.session_id
: A unique identifier for the current session.session_path
: The file path for the current session.model_name
: The name of the GPT-4 model used by the agent.callbacks
: A list of callback functions that will be executed at specific points during the agent's execution.context
: An instance ofYeagerAIContext
that provides access to memory and other shared resources.
Prompt Template
The YeagerAIPromptTemplate
class is responsible for formatting the agent's input prompts, which include conversation history and available tools. This class inherits from BaseChatPromptTemplate
and provides a custom format_messages
method to generate the appropriate prompt.
Output Parser
The YeagerAIOutputParser
class is responsible for parsing the agent's output and determining whether the agent has provided a final answer or needs to take further actions. This class inherits from AgentOutputParser
and provides a custom parse
method to process the agent's output.
Master Template
The MASTER_TEMPLATE
is a string that provides a general format for the agent's input prompts. It includes placeholders for conversation history, available tools, and other relevant information. The YeagerAIPromptTemplate
class uses this template to generate the final input prompt for the agent.
Last updated