---
type: "Source File"
title: "<section class=\"hero hero-compact\">"
description: "{% extends \"base.html\" %} {% block title %}Ask the Oracle — UK Economic Q&A{% endblock %} {% block meta_description %}Ask the Oracle any question about the UK economy. AI answers grounded in real ONS data, not."
resource: "https://uk.copecheck.com"
tags: ["copecheck", "uk", "source-file", "html"]
timestamp: "2026-05-04T20:10:43Z"
site: "uk"
source_path: "copecheck-uk/templates/ask_oracle.html"
---

# <section class="hero hero-compact">

Source path: `copecheck-uk/templates/ask_oracle.html`  
Index snapshot generated: `2026-11-24T13:42:54Z`  
File modified: `2026-05-04T20:10:43Z`

```html
{% extends "base.html" %}
{% block title %}Ask the Oracle — UK Economic Q&A{% endblock %}
{% block meta_description %}Ask the Oracle any question about the UK economy. AI answers grounded in real ONS data, not political talking points.{% endblock %}
{% block content %}
<section class="hero hero-compact">
    <div class="hero-inner">
        <h1 class="hero-title">Ask the Oracle</h1>
        <p class="hero-subtitle">Ask any question about the UK economy. Powered by Claude Sonnet with real ONS data. No cope. No spin.</p>
    </div>
</section>
<section class="ask-oracle-section">
    <div class="ask-oracle-input">
        <div class="oracle-input-wrapper">
            <textarea id="oracle-question" placeholder="Ask anything about the UK economy...&#10;&#10;Examples:&#10;• Is the UK really creating jobs or just shuffling people into zero-hours contracts?&#10;• What does the vacancy data actually show about labour demand?&#10;• Are wages really growing or is it just inflation trickery?" maxlength="2000" rows="4"></textarea>
            <div class="input-footer">
                <span class="char-count"><span id="char-count">0</span> / 2000</span>
                <button class="btn btn-primary" id="ask-btn" onclick="askOracle()">
                    <span class="ask-text">Ask the Oracle</span>
                    <span class="ask-loading" style="display:none"><span class="spinner"></span> Consulting the data...</span>
                </button>
            </div>
        </div>
        <div class="oracle-info-bar">
            <span class="oracle-info-item"><span class="info-icon">&#x1F4CA;</span> Fed with latest ONS data</span>
            <span class="oracle-info-item"><span class="info-icon">&#x1F916;</span> AI-powered with latest ONS data</span>
            <span class="oracle-info-item"><span class="info-icon">&#x1F6AB;</span> No partisan bias</span>
        </div>
    </div>
    <div id="oracle-error" class="error-panel" style="display:none"></div>
    <div id="oracle-answer" class="oracle-answer-panel" style="display:none">
        <div class="answer-header"><span class="answer-icon">&#x1F52E;</span><span class="answer-title">The Oracle Speaks</span><span class="answer-model" id="answer-model"></span><button class="copy-btn" onclick="copyText(this, '#answer-body')" style="margin-left:auto;"><svg viewBox="0 0 24 24"><rect x="9" y="9" width="13" height="13" rx="2"/><path d="M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1"/></svg> Copy</button></div>
        <div class="answer-question" id="answer-question"></div>
        <div class="answer-body" id="answer-body"></div>
        <div class="answer-footer"><span class="answer-disclaimer">Analysis based on ONS data. AI-generated commentary — not financial advice.</span></div>
    </div>
    {% if recent %}
    <div class="recent-questions">
        <h3 class="recent-title">Recent Questions</h3>
        {% for q in recent %}
        <a href="/ask-oracle/{{ q.id }}" class="recent-question-card" style="text-decoration:none;color:inherit;display:block;">
            <div class="rq-header">
                <span class="rq-icon">&#x2753;</span>
                <span class="rq-text">{{ q.question[:120] }}{% if q.question|length > 120 %}...{% endif %}</span>
                <span class="rq-model">{{ q.model or '' }}</span>
                <span class="rq-toggle">&#x25BC;</span>
            </div>
            <div class="rq-answer" style="position:relative;">
                <div class="rq-answer-text">{{ q.answer[:600] }}{% if q.answer|length > 600 %}...{% endif %}</div>
            </div>
        </a>
        {% endfor %}
    </div>
    {% endif %}
</section>
{% endblock %}
{% block scripts %}
<script>
const textarea = document.getElementById('oracle-question');
const charCount = document.getElementById('char-count');
textarea.addEventListener('input', () => { charCount.textContent = textarea.value.length; });
async function askOracle() {
    const question = textarea.value.trim();
    if (!question) return;
    const btn = document.getElementById('ask-btn');
    const askText = btn.querySelector('.ask-text');
    const askLoading = btn.querySelector('.ask-loading');
    const errorDiv = document.getElementById('oracle-error');
    const answerDiv = document.getElementById('oracle-answer');
    btn.disabled = true; askText.style.display = 'none'; askLoading.style.display = 'inline-flex';
    errorDiv.style.display = 'none'; answerDiv.style.display = 'none';
    try {
        const resp = await fetch('/api/ask-oracle', { method: 'POST', headers: {'Content-Type': 'application/json'}, body: JSON.stringify({ question }) });
        const data = await resp.json();
        if (!resp.ok) { errorDiv.textContent = data.error || 'Something went wrong.'; errorDiv.style.display = 'block'; return; }
        document.getElementById('answer-question').textContent = question;
        document.getElementById('answer-model').textContent = data.model || '';
        const formatted = data.answer.replace(/\n\n/g, '</p><p>').replace(/\n/g, '<br>').replace(/\*\*(.+?)\*\*/g, '<strong>$1</strong>');
        document.getElementById('answer-body').innerHTML = '<p>' + formatted + '</p>';
        answerDiv.style.display = 'block';
        answerDiv.scrollIntoView({ behavior: 'smooth', block: 'start' });
    } catch (err) { errorDiv.textContent = 'Network error. Try again.'; errorDiv.style.display = 'block'; }
    finally { btn.disabled = false; askText.style.display = 'inline'; askLoading.style.display = 'none'; }
}
textarea.addEventListener('keydown', (e) => { if ((e.ctrlKey || e.metaKey) && e.key === 'Enter') { e.preventDefault(); askOracle(); } });
</script>
{% endblock %}
```
