ai agent creator

This commit is contained in:
Flatlogic Bot 2025-12-17 04:34:43 +00:00
parent ba76b0e25d
commit 551b959be1
9 changed files with 614 additions and 159 deletions

View File

@ -14,12 +14,16 @@
<meta property="twitter:image" content="{{ project_image_url }}">
{% endif %}
{% load static %}
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&family=Roboto:wght@400;500;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="{% static 'css/custom.css' %}?v={{ deployment_timestamp }}">
{% block head %}{% endblock %}
</head>
<body>
{% block content %}{% endblock %}
{% block extra_js %}{% endblock %}
</body>
</html>

View File

@ -0,0 +1,79 @@
{% extends 'base.html' %}
{% load static %}
{% block title %}Create New AI Agent{% endblock %}
{% block content %}
<div class="container-fluid h-100">
<div class="row h-100">
<main class="col-12 h-100" style="padding-top: 60px;">
<div class="chat-container h-100 d-flex flex-column">
<div class="chat-messages flex-grow-1 overflow-auto">
<div class="message-bubble received">
<p>Hello! I'm here to help you create a new AI agent. What is the agent's purpose?</p>
</div>
</div>
<div class="chat-input-container">
{% csrf_token %}
<div class="input-group">
<input type="text" id="userInput" class="form-control" placeholder="Describe your agent...">
<button class="btn btn-primary" id="sendButton">Send</button>
</div>
</div>
</div>
</main>
</div>
</div>
{% endblock %}
{% block extra_js %}
<script>
document.addEventListener('DOMContentLoaded', function() {
const sendButton = document.getElementById('sendButton');
const userInput = document.getElementById('userInput');
const chatMessages = document.querySelector('.chat-messages');
sendButton.addEventListener('click', sendMessage);
userInput.addEventListener('keypress', function(e) {
if (e.key === 'Enter') {
sendMessage();
}
});
function sendMessage() {
const messageText = userInput.value.trim();
if (messageText === '') return;
// Display user's message
const userMessageBubble = document.createElement('div');
userMessageBubble.className = 'message-bubble sent';
userMessageBubble.innerHTML = `<p>${messageText}</p>`;
chatMessages.appendChild(userMessageBubble);
userInput.value = '';
chatMessages.scrollTop = chatMessages.scrollHeight;
// Get CSRF token
const csrftoken = document.querySelector('[name=csrfmiddlewaretoken]').value;
// Send message to server and get response
fetch('{% url 'create_agent' %}', {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'X-CSRFToken': csrftoken
},
body: `message=${encodeURIComponent(messageText)}`
})
.then(response => response.json())
.then(data => {
const botMessageBubble = document.createElement('div');
botMessageBubble.className = 'message-bubble received';
botMessageBubble.innerHTML = `<p>${data.message}</p>`;
chatMessages.appendChild(botMessageBubble);
chatMessages.scrollTop = chatMessages.scrollHeight;
});
}
});
</script>
{% endblock %}

View File

@ -1,145 +1,54 @@
{% extends "base.html" %}
{% extends 'base.html' %}
{% load static %}
{% block title %}{{ project_name }}{% endblock %}
{% block title %}AI Agent Studio - Build & Deploy AI Agents{% endblock %}
{% block head %}
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap" rel="stylesheet">
<style>
:root {
--bg-color-start: #6a11cb;
--bg-color-end: #2575fc;
--text-color: #ffffff;
--card-bg-color: rgba(255, 255, 255, 0.01);
--card-border-color: rgba(255, 255, 255, 0.1);
}
* {
box-sizing: border-box;
}
body {
margin: 0;
font-family: 'Inter', sans-serif;
background: linear-gradient(45deg, var(--bg-color-start), var(--bg-color-end));
color: var(--text-color);
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
text-align: center;
overflow: hidden;
position: relative;
}
body::before {
content: '';
position: absolute;
inset: 0;
background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 100 100'><path d='M-10 10L110 10M10 -10L10 110' stroke-width='1' stroke='rgba(255,255,255,0.05)'/></svg>");
animation: bg-pan 20s linear infinite;
z-index: -1;
}
@keyframes bg-pan {
0% {
background-position: 0% 0%;
}
100% {
background-position: 100% 100%;
}
}
main {
padding: 2rem;
}
.card {
background: var(--card-bg-color);
border: 1px solid var(--card-border-color);
border-radius: 16px;
padding: 2.5rem 2rem;
backdrop-filter: blur(20px);
-webkit-backdrop-filter: blur(20px);
box-shadow: 0 12px 36px rgba(0, 0, 0, 0.25);
}
h1 {
font-size: clamp(2.2rem, 3vw + 1.2rem, 3.2rem);
font-weight: 700;
margin: 0 0 1.2rem;
letter-spacing: -0.02em;
}
p {
margin: 0.5rem 0;
font-size: 1.1rem;
opacity: 0.92;
}
.loader {
margin: 1.5rem auto;
width: 56px;
height: 56px;
border: 4px solid rgba(255, 255, 255, 0.25);
border-top-color: #fff;
border-radius: 50%;
animation: spin 1s linear infinite;
}
@keyframes spin {
to {
transform: rotate(360deg);
}
}
.runtime code {
background: rgba(0, 0, 0, 0.25);
padding: 0.15rem 0.45rem;
border-radius: 4px;
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.sr-only {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
border: 0;
}
footer {
position: absolute;
bottom: 1rem;
width: 100%;
text-align: center;
font-size: 0.85rem;
opacity: 0.75;
}
</style>
<meta name="description" content="A collaborative platform to design, test, and run high-end AI agents with unlimited usage.">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
{% endblock %}
{% block content %}
<main>
<div class="card">
<h1>Analyzing your requirements and generating your app…</h1>
<div class="loader" role="status" aria-live="polite" aria-label="Applying initial changes">
<span class="sr-only">Loading…</span>
<div class="hero">
<div class="container">
<h1>Welcome to AI Agent Studio</h1>
<p>The open-source platform to design, test, and deploy powerful AI agents. No limits, no pricing tiers.</p>
<a href="{% url 'create_agent' %}" class="btn btn-primary btn-lg">Start Building Your First Agent</a>
</div>
<p class="hint">AppWizzy AI is collecting your requirements and applying the first changes.</p>
<p class="hint">This page will refresh automatically as the plan is implemented.</p>
<p class="runtime">
Runtime: Django <code>{{ django_version }}</code> · Python <code>{{ python_version }}</code>
— UTC <code>{{ current_time|date:"Y-m-d H:i:s" }}</code>
</p>
</div>
</main>
<footer>
Page updated: {{ current_time|date:"Y-m-d H:i:s" }} (UTC)
</footer>
</div>
<div class="container agent-showcase">
<div class="text-center mb-5">
<h2>Explore What You Can Build</h2>
<p class="lead">These examples are just the beginning. Your imagination is the only limit.</p>
</div>
<div class="agent-grid">
<!-- Sample Agent 1 -->
<div class="agent-card">
<div class="icon"><i class="fas fa-robot"></i></div>
<h3>Customer Support Bot</h3>
<p>An intelligent bot that handles common customer queries, freeing up your team for complex issues.</p>
</div>
<!-- Sample Agent 2 -->
<div class="agent-card">
<div class="icon"><i class="fas fa-chart-line"></i></div>
<h3>Data Analyst Agent</h3>
<p>Connect your data sources and let this agent find trends, generate reports, and provide insights.</p>
</div>
<!-- Sample Agent 3 -->
<div class="agent-card">
<div class="icon"><i class="fas fa-code"></i></div>
<h3>Code Generation Assistant</h3>
<p>Describe a function or component, and this agent will generate the boilerplate code for you in any language.</p>
</div>
</div>
<div class="text-center mt-5">
<a href="{% url 'create_agent' %}" class="btn btn-primary btn-lg">Create a New Agent</a>
</div>
</div>
{% endblock %}

View File

@ -1,7 +1,8 @@
from django.urls import path
from .views import home
from .views import home, create_agent
urlpatterns = [
path("", home, name="home"),
path("create-agent/", create_agent, name="create_agent"),
]

View File

@ -3,9 +3,9 @@ import platform
from django import get_version as django_version
from django.shortcuts import render
from django.http import JsonResponse
from django.utils import timezone
def home(request):
"""Render the landing screen with loader and environment details."""
host_name = request.get_host().lower()
@ -23,3 +23,12 @@ def home(request):
"project_image_url": os.getenv("PROJECT_IMAGE_URL", ""),
}
return render(request, "core/index.html", context)
def create_agent(request):
# This is the agent creation view
if request.method == 'POST':
message = request.POST.get('message', '')
# Simple echo response for now
response_message = f"This is a simulated response to: '{message}'"
return JsonResponse({'message': response_message})
return render(request, "core/create_agent.html")

View File

@ -1,4 +1,239 @@
/* Custom styles for the application */
body {
font-family: system-ui, -apple-system, sans-serif;
/* static/css/custom.css */
/* Core Palette & Typography */
:root {
--primary-color: #1A237E; /* Dark Blue */
--secondary-color: #F5F5F5; /* Light Gray */
--accent-color: #2962FF; /* Bright Blue */
--text-dark: #212121;
--text-light: #FFFFFF;
--font-headings: 'Poppins', sans-serif;
--font-body: 'Roboto', sans-serif;
}
body {
font-family: var(--font-body);
color: var(--text-dark);
background-color: var(--secondary-color);
line-height: 1.6;
}
h1, h2, h3, h4, h5, h6 {
font-family: var(--font-headings);
font-weight: 600;
color: var(--primary-color);
}
a {
color: var(--accent-color);
text-decoration: none;
transition: color 0.3s ease;
}
a:hover {
color: var(--primary-color);
text-decoration: underline;
}
.btn-primary {
background-color: var(--accent-color);
border-color: var(--accent-color);
font-family: var(--font-headings);
font-weight: 500;
padding: 0.75rem 1.5rem;
border-radius: 50px; /* Pill-shaped buttons */
transition: all 0.3s ease;
}
.btn-primary:hover {
background-color: var(--primary-color);
border-color: var(--primary-color);
transform: translateY(-2px);
box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
/* Hero Section */
.hero {
background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
color: var(--text-light);
padding: 6rem 1rem;
text-align: center;
margin-bottom: 4rem;
}
.hero h1 {
font-size: 3.5rem;
font-weight: 700;
color: var(--text-light);
margin-bottom: 1rem;
}
.hero p {
font-size: 1.25rem;
max-width: 600px;
margin: 0 auto 2rem;
opacity: 0.9;
}
/* Agent Showcase */
.agent-showcase {
padding-bottom: 4rem;
}
.agent-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
gap: 2rem;
}
.agent-card {
background: #fff;
border-radius: 12px;
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05);
padding: 2rem;
text-align: center;
transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.agent-card:hover {
transform: translateY(-5px);
box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
}
.agent-card .icon {
font-size: 3rem;
margin-bottom: 1rem;
/* Using a simple emoji as a placeholder */
/* In a real app, this would be an image or SVG icon */
}
.agent-card h3 {
font-size: 1.5rem;
margin-bottom: 0.5rem;
}
.agent-card p {
color: #6c757d;
font-size: 1rem;
}
/* Chat Interface */
.chat-container {
max-width: 800px;
margin: 0 auto;
background-color: #fff;
border-radius: 12px;
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05);
overflow: hidden;
}
.chat-messages {
padding: 2rem;
overflow-y: auto;
}
.message-bubble {
padding: 0.75rem 1.25rem;
border-radius: 20px;
margin-bottom: 1rem;
max-width: 80%;
line-height: 1.5;
}
.message-bubble.sent {
background-color: var(--accent-color);
color: var(--text-light);
margin-left: auto;
border-bottom-right-radius: 5px;
}
.message-bubble.received {
background-color: var(--secondary-color);
color: var(--text-dark);
margin-right: auto;
border-bottom-left-radius: 5px;
}
.chat-input-container {
padding: 1rem 2rem;
background-color: #fff;
border-top: 1px solid #eee;
}
.chat-input-container .form-control {
border-radius: 50px;
border-color: #ced4da;
padding: 0.75rem 1.25rem;
}
.chat-input-container .form-control:focus {
box-shadow: none;
border-color: var(--accent-color);
}
.chat-input-container .btn {
border-radius: 50px;
}

View File

@ -1,21 +1,239 @@
/* static/css/custom.css */
/* Core Palette & Typography */
:root {
--bg-color-start: #6a11cb;
--bg-color-end: #2575fc;
--text-color: #ffffff;
--card-bg-color: rgba(255, 255, 255, 0.01);
--card-border-color: rgba(255, 255, 255, 0.1);
--primary-color: #1A237E; /* Dark Blue */
--secondary-color: #F5F5F5; /* Light Gray */
--accent-color: #2962FF; /* Bright Blue */
--text-dark: #212121;
--text-light: #FFFFFF;
--font-headings: 'Poppins', sans-serif;
--font-body: 'Roboto', sans-serif;
}
body {
margin: 0;
font-family: 'Inter', sans-serif;
background: linear-gradient(45deg, var(--bg-color-start), var(--bg-color-end));
color: var(--text-color);
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
text-align: center;
overflow: hidden;
position: relative;
font-family: var(--font-body);
color: var(--text-dark);
background-color: var(--secondary-color);
line-height: 1.6;
}
h1, h2, h3, h4, h5, h6 {
font-family: var(--font-headings);
font-weight: 600;
color: var(--primary-color);
}
a {
color: var(--accent-color);
text-decoration: none;
transition: color 0.3s ease;
}
a:hover {
color: var(--primary-color);
text-decoration: underline;
}
.btn-primary {
background-color: var(--accent-color);
border-color: var(--accent-color);
font-family: var(--font-headings);
font-weight: 500;
padding: 0.75rem 1.5rem;
border-radius: 50px; /* Pill-shaped buttons */
transition: all 0.3s ease;
}
.btn-primary:hover {
background-color: var(--primary-color);
border-color: var(--primary-color);
transform: translateY(-2px);
box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
/* Hero Section */
.hero {
background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
color: var(--text-light);
padding: 6rem 1rem;
text-align: center;
margin-bottom: 4rem;
}
.hero h1 {
font-size: 3.5rem;
font-weight: 700;
color: var(--text-light);
margin-bottom: 1rem;
}
.hero p {
font-size: 1.25rem;
max-width: 600px;
margin: 0 auto 2rem;
opacity: 0.9;
}
/* Agent Showcase */
.agent-showcase {
padding-bottom: 4rem;
}
.agent-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
gap: 2rem;
}
.agent-card {
background: #fff;
border-radius: 12px;
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05);
padding: 2rem;
text-align: center;
transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.agent-card:hover {
transform: translateY(-5px);
box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
}
.agent-card .icon {
font-size: 3rem;
margin-bottom: 1rem;
/* Using a simple emoji as a placeholder */
/* In a real app, this would be an image or SVG icon */
}
.agent-card h3 {
font-size: 1.5rem;
margin-bottom: 0.5rem;
}
.agent-card p {
color: #6c757d;
font-size: 1rem;
}
/* Chat Interface */
.chat-container {
max-width: 800px;
margin: 0 auto;
background-color: #fff;
border-radius: 12px;
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05);
overflow: hidden;
}
.chat-messages {
padding: 2rem;
overflow-y: auto;
}
.message-bubble {
padding: 0.75rem 1.25rem;
border-radius: 20px;
margin-bottom: 1rem;
max-width: 80%;
line-height: 1.5;
}
.message-bubble.sent {
background-color: var(--accent-color);
color: var(--text-light);
margin-left: auto;
border-bottom-right-radius: 5px;
}
.message-bubble.received {
background-color: var(--secondary-color);
color: var(--text-dark);
margin-right: auto;
border-bottom-left-radius: 5px;
}
.chat-input-container {
padding: 1rem 2rem;
background-color: #fff;
border-top: 1px solid #eee;
}
.chat-input-container .form-control {
border-radius: 50px;
border-color: #ced4da;
padding: 0.75rem 1.25rem;
}
.chat-input-container .form-control:focus {
box-shadow: none;
border-color: var(--accent-color);
}
.chat-input-container .btn {
border-radius: 50px;
}