Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -1285,6 +1285,17 @@ def marketing_assistance_endpoint():
return jsonify({"status": "success", "message": message})


@app.route('/api/v1/digital-repair/assistance', methods=['POST'])
@require_api_key
def digital_repair_assistance_endpoint():
data = request.get_json()
prompt = data.get('prompt')
if not prompt:
return jsonify({"error": _("Prompt is required")}), 400
message = google_ai.provide_digital_repair_assistance(prompt)
return jsonify({"status": "success", "message": message})


@app.route('/api/v1/translate', methods=['POST'])
@require_api_key
def translate_endpoint():
Expand Down
106 changes: 53 additions & 53 deletions docs/assets/index-DKn7X7kD.js → docs/assets/index-BOE846LJ.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<link rel="icon" type="image/svg+xml" href="./favicon.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Yendoukoa AI - AI Service Marketplace</title>
<script type="module" crossorigin src="./assets/index-DKn7X7kD.js"></script>
<script type="module" crossorigin src="./assets/index-BOE846LJ.js"></script>
<link rel="stylesheet" crossorigin href="./assets/index-Bze3XCEm.css">
</head>
<body>
Expand Down
38 changes: 38 additions & 0 deletions frontend/static/js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -1629,6 +1629,44 @@ document.addEventListener('DOMContentLoaded', () => {
});
}

// --- Digital Repair Assistance ---
const digitalRepairBtn = document.getElementById('digital-repair-btn');
if (digitalRepairBtn) {
digitalRepairBtn.addEventListener('click', async () => {
const input = document.getElementById('digital-repair-input');
const responseContainer = document.getElementById('digital-repair-response');
const apiKey = getApiKey("Please enter your API key to use the Digital Repair Specialist:");

if (!apiKey) {
responseContainer.textContent = 'API key is required.';
return;
}

try {
const response = await fetch('/api/v1/digital-repair/assistance', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-API-Key': apiKey
},
body: JSON.stringify({
prompt: input.value
})
});

if (!response.ok) {
const error = await response.json();
throw new Error(error.error || 'Failed to get a response from the digital repair specialist');
}

const result = await response.json();
responseContainer.textContent = result.message;
} catch (error) {
responseContainer.textContent = `Error: ${error.message}`;
}
});
}

// --- E-shop Assistance ---
const eshopBtn = document.getElementById('eshop-btn');
if (eshopBtn) {
Expand Down
21 changes: 21 additions & 0 deletions frontend/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<div class="logo">Yendoukoa AI</div>
<ul>
<li><a href="#services">{{ _('Services') }}</a></li>
<li><a href="#digital-repair-assistance">{{ _('Digital Repair') }}</a></li>
<li><a href="#maintenance-assistance">{{ _('Maintenance') }}</a></li>
<li><a href="#it-operations-assistance">{{ _('IT Ops') }}</a></li>
<li><a href="#esports-assistance">{{ _('eSports') }}</a></li>
Expand Down Expand Up @@ -210,6 +211,26 @@ <h3>{{ _('Software & Hardware Maintenance') }}</h3>
<h3>{{ _('Digital Marketing & Bot Specialist') }}</h3>
<p>{{ _('Expert assistance for e-mail, SMS, and bot marketing & management, providing strategic and technical guidance.') }}</p>
</div>
<div class="card">
<h3>{{ _('Digital Repair & Troubleshooting') }}</h3>
<p>{{ _('Expert assistance for digital repair and troubleshooting of media, apps, websites, and software.') }}</p>
</div>
</div>
</section>

<!-- Digital Repair Specialist Section -->
<section id="digital-repair-assistance" class="services">
<h2>{{ _('Digital Repair & Troubleshooting Specialist') }}</h2>
<div class="service-cards">
<div class="card">
<h3>{{ _('Digital Repair & Troubleshooting Support') }}</h3>
<p>{{ _('Enter your request for media repair, app troubleshooting, website fixes, or software maintenance below.') }}</p>
<textarea id="digital-repair-input" placeholder="{{ _('Your digital repair request') }}" class="styled-textarea" rows="4"></textarea>
<button id="digital-repair-btn" class="btn">{{ _('Submit') }}</button>
<div class="response-container" id="digital-repair-response-container">
<pre id="digital-repair-response"></pre>
</div>
</div>
</div>
</section>

Expand Down
32 changes: 32 additions & 0 deletions google_ai.py
Original file line number Diff line number Diff line change
Expand Up @@ -1614,3 +1614,35 @@ def provide_marketing_bot_assistance(prompt: str) -> str:
except Exception as e:
print(f"Error providing marketing and bot assistance with Vertex AI: {e}")
return f"Error: {e}"

def provide_digital_repair_assistance(prompt: str) -> str:
"""
Provides digital repair and troubleshooting assistance for media, apps, websites, and software using Vertex AI.
"""
model = GenerativeModel("gemini-1.5-flash")

generation_prompt = f"""
You are an expert Digital Repair and Troubleshooting Specialist.
Your task is to provide high-level technical guidance, troubleshooting steps, and repair advice for digital assets.
Your expertise includes:
- Media Repair: Advising on fixing corrupted video, audio, and image files, as well as format conversion and quality restoration.
- App Troubleshooting: Providing solutions for mobile and desktop application crashes, performance issues, and bugs.
- Website & Web App Repair: Identifying and fixing issues with HTML, CSS, JavaScript, broken links, and server-side errors.
- Software Maintenance: Guiding users through software installation, configuration, updates, and resolving compatibility issues.
- Digital Forensics: Basic guidance on identifying the root cause of digital failures and data recovery techniques.

User Request:
---
{prompt}
---

Provide a professional, technical, and detailed response based on the user's request.
"""

try:
response = model.generate_content(generation_prompt)
return response.text.strip()

except Exception as e:
print(f"Error providing digital repair assistance with Vertex AI: {e}")
return f"Error: {e}"
4 changes: 4 additions & 0 deletions marketplace-frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ const AI_SERVICES: AIService[] = [
{ id: 'education', name: 'Science Educator', category: 'Academic', icon: BookOpen, description: 'Mathematics, physics, and biology education.' },
{ id: 'verification', name: 'Content Verifier', category: 'Security', icon: ShieldCheck, description: 'AI content and fake news detection.' },
{ id: 'maintenance', name: 'Hardware Expert', category: 'Support', icon: Wrench, description: 'Software & hardware troubleshooting.' },
{ id: 'digital-repair', name: 'Digital Repair', category: 'Support', icon: Wrench, description: 'Troubleshooting media, apps, and websites.' },
{ id: 'researcher', name: 'AI Researcher', category: 'Science', icon: Microscope, description: 'State-of-the-art AI methodology research.' },
{ id: 'google-sites', name: 'Google Sites Specialist', category: 'Infrastructure', icon: Layout, description: 'Google Sites & DNS configuration expert.' },
{ id: 'marketing', name: 'Marketing & Bot Specialist', category: 'Business', icon: Mail, description: 'Expert e-mail, SMS, and bot marketing & management.' }
Expand Down Expand Up @@ -136,6 +137,9 @@ const App: React.FC = () => {
case 'marketing':
response = await aiService.getMarketingAssistance(servicePrompt);
break;
case 'digital-repair':
response = await aiService.getDigitalRepairAssistance(servicePrompt);
break;
default:
// Fallback for demo purposes if specific endpoint isn't mapped in aiService yet
response = { data: { message: "This service is currently in demo mode. The full integration is coming soon!" } };
Expand Down
1 change: 1 addition & 0 deletions marketplace-frontend/src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export const aiService = {
getGoogleSitesAssistance: (prompt: string) => apiClient.post('/google-sites/assistance', { prompt }),
getDiagnosticAssistance: (prompt: string) => apiClient.post('/diagnostic/assistance', { prompt }),
getMarketingAssistance: (prompt: string) => apiClient.post('/marketing/assistance', { prompt }),
getDigitalRepairAssistance: (prompt: string) => apiClient.post('/digital-repair/assistance', { prompt }),
};

export const userService = {
Expand Down
11 changes: 11 additions & 0 deletions tests/test_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,14 @@ def test_maintenance_assistance(mock_gen, client, auth_headers):
assert response.status_code == 200
data = json.loads(response.data)
assert data['message'] == 'Mock maintenance response'

@patch('google_ai.provide_digital_repair_assistance')
def test_digital_repair_assistance(mock_gen, client, auth_headers):
mock_gen.return_value = 'Mock digital repair response'
response = client.post('/api/v1/digital-repair/assistance',
data=json.dumps({'prompt': 'test digital repair'}),
content_type='application/json',
headers=auth_headers)
assert response.status_code == 200
data = json.loads(response.data)
assert data['message'] == 'Mock digital repair response'
Loading