{% extends 'base.html' %}

{% block title %}Library Operations{% endblock %}

{% block content_title %}Library Operations{% endblock %}
{% block content_description %}Perform operations on the entire library of documents.{% endblock %}
{% block content_class %}<div class="col-xl-12 col-lg-5 col-md-7 mx-auto"></div>{% endblock %}

{% block content %}
<div class="container">
    <form method="POST">
        <div class="form-group mt-3">
            <h2>Create Default RAG Library</h2>
            <p>This function will create a default library setup for RAG purposes. More specifically, it will create:</p>
            <ul>
                <li>A default RAG Catalog</li>
                <li>A Default HTML Processor</li>
                <li>A default RAG Retriever</li>
                <li>A default RAG Specialist</li>
            </ul>
            <p>This enables a quick start-up for standard Ask Eve AI functionality. All elements can be changed later on an individual basis.</p>
            <button type="submit" name="action" value="create_default_rag_library" class="btn btn-danger">Create Default RAG Library</button>

            <h2>Re-Embed Latest Versions</h2>
            <p>This functionality will re-apply embeddings on the latest versions of all documents in the library.
                This is useful only while tuning the embedding parameters, or when changing embedding algorithms.
                As it is an expensive operation and highly impacts the performance of the system in future use,
                use it with caution!
            </p>
            <button type="submit" name="action" value="re_embed_latest_versions" class="btn btn-danger">Re-embed Latest Versions (expensive)</button>

            <h2>Refresh all documents</h2>
            <p>This operation will create new versions of all documents in the library with a URL. Documents that were uploaded directly,
                cannot be automatically refreshed. This is an expensive operation, and impacts the performance of the system in future use.
                Please use it with caution!
            </p>
            <button type="submit" name="action" value="refresh_all_documents" class="btn btn-danger">Refresh All Documents (expensive)</button>
        </div>
    </form>
</div>
{% endblock %}

