Interfaces
Interfaces in YeagerAI are the communication channels through which users interact with their AI agents. These can include command-line interfaces (CLI), web-based interfaces, and integrations with popular platforms like Discord. Interfaces enable seamless interaction between users and their AI agents, allowing for real-time collaboration and management. The code provided above demonstrates the implementation of a command-line interface (CLI) for YeagerAI.
CLI - Command Line Interface
The CLI allows you to communicate with your YeagerAI agent via the terminal. The provided code demonstrates how to create a CLI for YeagerAI using the click
library. The main
function initializes the chat interface, while the chat_interface
function prompts the user to enter their commands or questions. This continues in a loop until the user decides to quit by typing :q
.
The GitLocalRepoCallbackHandler
is a custom callback handler that commits changes to a local Git repository upon completion of the agent's tasks. This allows you to track your agent's work and maintain a version history of its output.
To use this CLI, simply run the provided script:
GitLocalRepoCallbackHandler
The GitLocalRepoCallbackHandler
is a custom callback handler that creates a local Git repository and commits changes made by the AI agent. It is initialized with the user's name and the session path.
Upon the completion of the agent's tasks (on_agent_finish
), the handler checks if the repository is dirty (i.e., contains uncommitted changes). If it is, it calls the _get_gpt_commit_message
function to generate a commit message using the GPT model. The handler then commits the changes with the generated message and the user's information as the author and committer.
This callback handler allows you to track the AI agent's work in a version-controlled manner, making it easier to review, share, and collaborate on the generated output.
Extending Interfaces
You can extend the functionality of YeagerAI by creating custom interfaces for other platforms or communication channels. This can be done by implementing your own callback handlers or adapting the provided GitLocalRepoCallbackHandler
to suit your needs. By extending the interfaces, you can create a more personalized and flexible interaction with your AI agents, tailoring the experience to your specific use cases and preferences.
Last updated