File size: 1,471 Bytes
3ba239b
7beacaa
 
3ba239b
7beacaa
629069a
3ba239b
 
 
 
 
 
629069a
7beacaa
4ecb059
629069a
 
 
 
 
4ecb059
3ba239b
629069a
 
 
 
3ba239b
 
629069a
7beacaa
4ecb059
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<h2>Prompt</h2>
Below is the prompt that is given to the model. <hr>
<h2>Instructions</h2>
<span style="color: #FF00FF;">Use the following pieces of context to answer the question at the end.<br>If you don't know the answer, just say that you don't know, <span style="color: #FF00FF; font-weight: bold;">don't try to make up an answer.</span></span><br>
<h2>Context</h2>
{% for doc in documents %}
    <details class="doc-box">
        <summary>
            <b>Doc {{ loop.index }}:</b> <span class="doc-short">{{ doc.content[:100] }}...</span>
        </summary>
        <div class="doc-full">{{ doc.content }}</div>
    </details>
{% endfor %}

<h2>Query</h2> <span style="color: #801616;">{{ query }}</span>

<style>
    .doc-box {
        padding: 10px;
        margin-top: 10px;
        background-color: #48a3ff;
        border: none;
    }
    .doc-short, .doc-full {
        color: white;
    }
    summary::-webkit-details-marker {
        color: white;
    }
</style>

<script>
document.addEventListener("DOMContentLoaded", function() {
    const detailsElements = document.querySelectorAll('.doc-box');

    detailsElements.forEach(detail => {
        detail.addEventListener('toggle', function() {
            const docShort = this.querySelector('.doc-short');
            if (this.open) {
                docShort.style.display = 'none';
            } else {
                docShort.style.display = 'inline';
            }
        });
    });
});
</script>