AI Agent
import logging
from gunicorn.app.base import BaseApplication
from app_init import create_initialized_flask_app
# Flask app creation should be done by create_initialized_flask_app to avoid circular dependency problems.
app = create_initialized_flask_app()
# Setup logging
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
class StandaloneApplication(BaseApplication):
def __init__(self, app, options=None):
self.application = app
self.options = options or {}
super().__init__()
def load_config(self):
# Apply configuration to Gunicorn
for key, value in self.options.items():
if key in self.cfg.settings and value is not None:
self.cfg.set(key.lower(), value)
def load(self):
Created: | Last Updated:
Here's a step-by-step guide on how to use the AI Agent template:
Introduction to the AI Agent Template
The AI Agent template allows you to create and manage your own AI-powered chatbot. You can customize the agent's behavior, choose from different AI models, and control who has access to the system. This template is ideal for businesses looking to implement an AI assistant with team management capabilities.
Getting Started
To begin using the AI Agent template, follow these steps:
-
Click "Start with this Template" to initialize the project in the Lazy Builder interface.
-
Press the "Test" button to deploy the application and launch the Lazy CLI.
Setting Up Your AI Agent
Once the application is deployed, you'll need to configure your AI Agent:
-
Access the home page of your AI Agent application.
-
Look for the "Chatbot Settings" section on the dashboard.
-
Customize your AI Agent by adjusting the following settings:
- Chatbot Instructions: Enter specific guidelines for your AI's behavior.
- AI Model Selection: Choose from options like GPT-4, Claude, or Gemini.
-
AI Response Temperature: Adjust the creativity level of the AI's responses.
-
Click "Save Changes" to apply your settings.
Managing Team Access
To control who can access and configure your AI Agent:
-
Navigate to the "Team" page in your application.
-
Add Domain Access:
- Click "Add New Email Ending" to allow all users with a specific email domain.
-
Enter the domain (e.g., "example.com") and click "Allow Domain".
-
Add Individual Admins:
- Click "Add New Admin" to grant access to specific email addresses.
-
Enter the full email address and click "Add Admin".
-
Manage Existing Access:
- Use the "Block" or "Unblock" buttons to control access for specific admins.
- Use the "Delete" button to remove domain access or individual admins.
Testing Your AI Agent
To simulate conversations with your AI Agent:
-
Go to the "AI Chat Simulator" page.
-
Type a message in the chat input and press Enter or click the send button.
-
Observe how the AI responds based on your configured settings.
-
Use this feature to refine your chatbot instructions and ensure the AI behaves as expected.
Using the AI Agent
Your AI Agent is now set up and ready to use. You can:
- Continue testing and refining the AI's responses using the simulator.
- Integrate the AI Agent into your existing customer support systems or websites (Note: This template doesn't provide direct integration instructions, as it's a standalone web application).
- Share the application link with your team members who have been granted access.
Remember to regularly review and update your AI Agent's settings and team access to maintain optimal performance and security.
Template Benefits
-
Customizable AI Chatbot: Create a tailored AI assistant that aligns with your brand voice and specific business needs by providing custom instructions and selecting from various AI models.
-
Team Collaboration: Facilitate teamwork by allowing multiple administrators to access and configure the AI agent, with granular control over user permissions through email domain and individual user management.
-
Real-time Testing: Utilize the built-in simulator to test and refine your AI agent's responses, ensuring it performs as expected before deployment to end-users.
-
Flexible AI Model Selection: Choose from a range of cutting-edge AI models (GPT-4, Claude, Gemini) to find the best fit for your use case, balancing performance and cost-effectiveness.
-
Enhanced Customer Support: Deploy the AI agent as a first-line customer support tool, handling routine inquiries 24/7 and freeing up human agents to focus on more complex issues, ultimately improving response times and customer satisfaction.