aboutsummaryrefslogtreecommitdiff
path: root/gn2/wqflask/templates/gnqa.html
blob: 31a04aaca7c4a38e63703342b0cecf13487b0cdf (plain)
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
{% extends "base.html" %}
{% block title %}GNQA{% endblock %}

{% block css %}
<style>

 .htmx-indicator{
     display:none;
     opacity: 0;
     transition: opacity 500ms ease-in;
     width: 50px;
 }

 .htmx-request .htmx-indicator, .htmx-request.htmx-indicator {
     opacity: 1;
     display: block;
     position: fixed;
     left: 50vw;
     top: 50vh;
     z-index: 19;
 }

 .search-header {
     font-size: 3.5em;
     color:#808080;
     font-family: sans serif;
 }

 .search-header small {
     font-size: 14px;
 }

 .search-header sup {
     top: -2em;
 }

 .gnqa-copy p {
     font-size: 16px;
     line-height: 1.5;
 }

 #gnqna_search_home .form-group {
     margin: 3em auto;
 }

 #gnqna_search_home_input {
     border-radius: 16px;
 }

 #gnqna_search_home button {
     margin-right: 10px;
     width: fit-content;
 }
 .answers {
     width: 75%;
 }

 details > summary {
     padding: 2px 6px;
     width: 15em;
     background-color: #ddd;
     border: none;
     box-shadow: 3px 3px 4px black;
     cursor: pointer;
 }

 details > p {
     border-radius: 0 0 10px 10px;
     background-color: #ddd;
     padding: 2px 6px;
     margin: 0;
     box-shadow: 3px 3px 4px black;
 }

 details[open] > summary {
     background-color: #ccf;
 }

</style>
{% endblock %}

{% block search %}{% endblock %}

<div class="modal fade  bd-example-modal-lg " id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-lg" role="document" >
	<div class="modal-content">
            <div class="modal-header">
		<h2 class="modal-title" id="exampleModalLabel">Your Search History</h2>

            </div>
            <div class="modal-body">
		<div>
                    {% if prev_queries %}
                    <div>
			{% for search in prev_queries[:8] %}
			<div class="search-hist-btn" style="display:flex;justify-content: space-between;align-items: center;">
                            <form  class="search-hist-btn-form" method="GET" data-link="{{search}}">
				<a  class="search-hist-btn-link" data-link="{{search}}">{{search}}</a>
                            </form>
			</div>
			{% endfor %}
                    </div>
                    {% endif %}
		</div>
            </div>
            <div class="modal-footer">
		<button type="button" class="btn btn-danger " style="color:white" >Delete All</button>
		<button type="button" class="btn btn-primary" data-dismiss="modal" style="color:white">Cancel</button>
            </div>
	</div>
    </div>
</div>

{% block content %} <!-- Start of body -->
<section class="container-fluid">
    <header class="row">
	<h1 class="col-sm-12 text-center search-header">
	    AI Search
	    <small>
		<sup><a href="#">[Search History]</a></sup>
	    </small>
	</h1>
    </header>
    <form class="row form-horizontal" id="gnqna_search_home"
	  action="/gnqna" method="POST">
	<!--- init gnqa codebase here -->
	<div class="form-group form-group-lg col col-xs-12 col-sm-6 col-sm-offset-3">
	    <button class="btn btn-default btn-sm col-xs-1 col-sm-1 col-sm-offset-3"
		    hx-post="/gnqna"
		    hx-target="#swap"
		    hx-swap="innerHTML"
		    hx-indicator="#indicator">
		<i class="fa fa-search fa-3x" aria-hidden="true" title="Search"></i>
		<img id="indicator" class="htmx-indicator" src="/static/gif/loader.gif"/>
	    </button>
            <input
		class="text-left input-lg col-sm-5"
		       id="gnqna_search_home_input"
		       type="text" autocomplete="on"
		       required
		placeholder="Ask More Questions or Topics (E.g Genes)"
		       value=''
		name="querygnqa"
		       hx-post="/gnqna"
		hx-target="#swap
		hx-swap="innerHTML"
		hx-indicator="#indicator"
	    />
	</div>
    </form>
    <article id="swap" class="row">
	<div class="row gnqa-copy">
	    <p class="col-sm-10 col-sm-offset-1 col-md-offset-3 col-md-6">
		Welcome to the GeneNetwork Question and Answer (GNQA)system. We utilize a large language model and 3000 scientific publications to make GNQA a subject matter expert in three areas: <b><a href="/">GeneNetwork.org </a></b>, <b>genomics/genetics with regards to diabetes</b> and <b>genomics/genetics with regards to agin.</b>.
	    </p>
	    <p class="col-sm-11 col-md-offset-3 col-md-6">At the moment when you ask GNQA something it will attempt to return a sensible answer with <q>real</q> references. To this end we aim to reduce hallucinations and provide a knowledge launchpad for a researcher to enhance their knowledge on the relevant subject matter.</p>
	    <p class="col-sm-11 col-md-offset-3 col-md-6">
		GNQA is not a finished product as we are working diligently to improve it daily.
	    </p>
	    <p class="col-sm-11 col-md-offset-3 col-md-6"><b>Thanks for using GNQA!</b> </p>

	</div>
    </article>


</section>

{% endblock %}

{% block js %}
<script src="{{ url_for('js', filename='jquery/jquery.min.js') }}" type="text/javascript"></script>

<script language="javascript" type="text/javascript" src="{{ url_for('js', filename='jquery-ui/jquery-ui.min.js') }}"></script>

<script language="javascript" type="text/javascript" src="{{ url_for('js', filename='htmx.min.js') }}"></script>

<script type="text/javascript">
 document.addEventListener('DOMContentLoaded', function() {
     $('footer').hide()
 });
</script>
{% endblock %}