From 63de4403b6e2186c5758443ec9163fc57b8a012f Mon Sep 17 00:00:00 2001 From: John Nduli Date: Thu, 12 Sep 2024 16:59:52 +0300 Subject: fix: stop extending gnqa_answer.html gnqa_answer.html is used by htmx to return a post result. I revert my change and include this in `gnqa.html` instead, to load results from a GET request. --- gn2/wqflask/templates/gnqa.html | 72 +++++++++++++++++++-------------- gn2/wqflask/templates/gnqa_answer.html | 22 +++------- gn2/wqflask/templates/gsearch_gene.html | 9 +++++ gn2/wqflask/views.py | 2 +- 4 files changed, 56 insertions(+), 49 deletions(-) (limited to 'gn2') diff --git a/gn2/wqflask/templates/gnqa.html b/gn2/wqflask/templates/gnqa.html index 158b0b4e..371ad7b3 100644 --- a/gn2/wqflask/templates/gnqa.html +++ b/gn2/wqflask/templates/gnqa.html @@ -80,10 +80,15 @@ background-color: #ccf; } +.linux-libertine-font{ + font-family: 'Linux Libertine','Georgia','Times','Source Serif Pro', 'serif' +} + {% endblock %} {% block search %}{% endblock %} {% block content %} +
@@ -119,39 +124,44 @@ autocomplete="on" required placeholder="Ask More Questions or Topics (E.g Genes)" + {% if query %} + value='{{ query }}' + {% else %} value='' + {% endif %} name="querygnqa" />
-
-
-

- 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: GeneNetwork.org, genomics/genetics with regards to diabetes and genomics/genetics with regards to agin.. -

-

- At the moment when you ask GNQA something it will attempt to return a sensible answer with real 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. -

-

GNQA is not a finished product as we are working diligently to improve it daily.

-

- Thanks for using GNQA! -

-
-
-
- {% endblock %} - {% block js %} - - - - - {% endblock %} + {% if answer %} + {% include 'gnqa_answer.html' %} + {% else %} + +
+
+

+ 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: GeneNetwork.org, genomics/genetics with regards to diabetes and genomics/genetics with regards to agin.. +

+

+ At the moment when you ask GNQA something it will attempt to return a sensible answer with real 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. +

+

GNQA is not a finished product as we are working diligently to improve it daily.

+

+ Thanks for using GNQA! +

+
+
+ {% endif %} + + + {% endblock %} + {% block js %} + + + + + {% endblock %} diff --git a/gn2/wqflask/templates/gnqa_answer.html b/gn2/wqflask/templates/gnqa_answer.html index e2e39956..2e182375 100644 --- a/gn2/wqflask/templates/gnqa_answer.html +++ b/gn2/wqflask/templates/gnqa_answer.html @@ -1,15 +1,3 @@ -{% extends "base.html" %} - -{% block css %} - -{% endblock %} - -{% block content %} -

@@ -155,9 +143,9 @@

-{% endblock %} -{% block js %} - -{% endblock %} +}) + diff --git a/gn2/wqflask/templates/gsearch_gene.html b/gn2/wqflask/templates/gsearch_gene.html index 091cc435..80ed8b47 100644 --- a/gn2/wqflask/templates/gsearch_gene.html +++ b/gn2/wqflask/templates/gsearch_gene.html @@ -16,8 +16,14 @@ + + {% if do_ai_search %}
+
+ +
+ {% endif %}

To study a record, click on its Record ID below.
Check records below and click Add button to add to selection.

@@ -306,6 +312,9 @@ success: function(result) { let ai_div = ai_content_div(result.search_term, result.search_result, result.search_url) $("#ai_result").append(ai_div); + }, + complete: function() { + $("#spinner").hide(); } }) }) diff --git a/gn2/wqflask/views.py b/gn2/wqflask/views.py index e695b0d8..aaf40d41 100644 --- a/gn2/wqflask/views.py +++ b/gn2/wqflask/views.py @@ -324,7 +324,7 @@ def gnqna(): "search_url": f"/gnqna?{safe_query}", } return jsonify(ai_result) - return render_template("gnqa_answer.html", **search_result) + return render_template("gnqa.html", **search_result) else: return render_template("gnqa.html") if request.method == "POST": -- cgit v1.2.3