mirror of
https://github.com/thecyberlearn/quantum-ai-v3.git
synced 2026-08-18 20:52:58 +00:00
🚀 Major improvements to agent system: ## Wallet Management ✅ - Move wallet deduction to AFTER successful processing (not before) - Add real-time wallet balance updates in frontend - Prevent users from losing money on failed requests - Update both data_analyzer and weather_reporter processors ## Data Analyzer Agent 📊 - Fix N8N integration to handle array response format - Add binary PDF file upload (multipart/form-data) - Implement real-time AJAX results display below form - Add wallet balance updates after successful processing - Support continuous workflow with "Analyze Another File" ## Weather Reporter Agent 🌤️ - Update price from 2.5 AED to 2.0 AED - Fix results display (was using page reload, now AJAX) - Add real-time wallet balance updates - Implement dynamic results rendering below form - Add "Get Another Report" functionality ## Template System 🎨 - Update agent generator templates with correct wallet flow - Add data-wallet-balance attributes for easy targeting - Fix JavaScript querySelector errors - Implement proper error handling and logging ## Documentation 📚 - Update CLAUDE.md with wallet best practices - Add examples of current production agents - Document required JavaScript functions - Update pricing information and modern agent features - Add gitignore entries for nextjs/ and netcop-ai-hub/ ## Frontend JavaScript 💻 - Add updateWalletBalance() function for real-time updates - Implement displayResults() for dynamic content rendering - Add proper error handling with user-friendly messages - Support continuous workflow without page refresh 🎉 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
35 lines
1.1 KiB
Python
35 lines
1.1 KiB
Python
from django.db import models
|
|
from decimal import Decimal
|
|
from agent_base.models import BaseAgentRequest, BaseAgentResponse
|
|
|
|
|
|
class {{ agent_name_camel }}Request(BaseAgentRequest):
|
|
"""{{ agent_name }} request tracking"""
|
|
|
|
# Agent-specific request fields
|
|
{% for field in request_fields %}{{ field.name }} = models.{{ field.type }}({{ field.args }})
|
|
{% endfor %}
|
|
|
|
class Meta:
|
|
db_table = '{{ agent_slug_underscore }}_requests'
|
|
verbose_name = '{{ agent_name }} Request'
|
|
verbose_name_plural = '{{ agent_name }} Requests'
|
|
|
|
|
|
class {{ agent_name_camel }}Response(BaseAgentResponse):
|
|
"""{{ agent_name }} response storage"""
|
|
|
|
request = models.OneToOneField(
|
|
{{ agent_name_camel }}Request,
|
|
on_delete=models.CASCADE,
|
|
related_name='response'
|
|
)
|
|
|
|
# Agent-specific response fields
|
|
{% for field in response_fields %}{{ field.name }} = models.{{ field.type }}({{ field.args }})
|
|
{% endfor %}
|
|
|
|
class Meta:
|
|
db_table = '{{ agent_slug_underscore }}_responses'
|
|
verbose_name = '{{ agent_name }} Response'
|
|
verbose_name_plural = '{{ agent_name }} Responses' |