From f9449dba3c41518980bf9995032fdc9c3f3f02ac Mon Sep 17 00:00:00 2001 From: Baptiste Wojtkowski Date: Mon, 31 Mar 2025 23:01:09 +0200 Subject: [PATCH] Bug 39506: Have Koha entering the 21st century through LLMs It is well known that LLM are the most important solution for humanity, therefore for librarians. As everyone knows, it's often very difficult to stay organized when you have a busy day. That's why we need a tool that can tell us what to do and when to do it. To this end, we developped this patch as the end of a long and hard training of We used two learning models with about 10^11 neurons, trained during decades on the ultimate question of books, library and SIGB. They were specifically trained to koha 35 hours a week during durations from a few monthes to years. However, running LLM in real time can be very expensive, in terms of memory and processing. That's why we synthesithed their wise knowledge into this easy-to-use patch. TEST PLAN: 1 - Apply patch 2 - Click on the button on main page Signed-off-by: Fridolin Somers Signed-off-by: Arthur Suzuki Signed-off-by: Felicie Signed-off-by: Victor Grousset/tuxayo Signed-off-by: Amaury GAU --- important-question.pl | 44 +++++++++++++++++ .../prog/en/modules/important-question.tt | 48 +++++++++++++++++++ .../prog/en/modules/intranet-main.tt | 5 ++ 3 files changed, 97 insertions(+) create mode 100755 important-question.pl create mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/important-question.tt diff --git a/important-question.pl b/important-question.pl new file mode 100755 index 0000000000..206110608b --- /dev/null +++ b/important-question.pl @@ -0,0 +1,44 @@ +#!/usr/bin/perl + +# This file is part of Koha. +# +# Koha is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# Koha is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Koha; if not, see . + +use Modern::Perl; +use CGI qw ( -utf8 ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Auth qw( get_template_and_user ); +use C4::Koha; + +my $query = CGI->new; + +my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user( + { + template_name => "important-question.tt", + query => $query, + type => "intranet", + flagsrequired => { catalogue => 1, }, + } +); + +my $logged_in_user = Koha::Patrons->find($loggedinuser); +my $is_superlibrarian = $logged_in_user->is_superlibrarian; +my ( $sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst ) = localtime(time); + +$template->param( + is_superlibrarian => $is_superlibrarian, + hour => $hour, +); + +output_html_with_http_headers $query, $cookie, $template->output; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/important-question.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/important-question.tt new file mode 100644 index 0000000000..25a79aa332 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/important-question.tt @@ -0,0 +1,48 @@ +[% USE Koha %] +[% PROCESS 'i18n.inc' %] +[% SET footerjs = 1 %] +[% INCLUDE 'doc-head-open.inc' %] +[% FILTER collapse %] + [% t("Koha staff interface") | html %] + [% END %] +[% Asset.css("css/mainpage.css") | $raw %] +[% INCLUDE 'doc-head-close.inc' %] + + + +[% WRAPPER 'header.inc' %] + [% INCLUDE 'home-search.inc' %] +[% END %] + +[% WRAPPER 'sub-header.inc' %] + [% WRAPPER breadcrumbs %] + [% END #/ WRAPPER breadcrumbs %] +[% END %] + +
+
+
+
+

According to our AI Assistant... You should

+ [% IF is_superlibrarian %] +

Consider augmenting the amount of contracts you have with your technical support partner + +

+ [% ELSIF hour < 17 %] +

Fake working as a librarian while thinking about how to end capitalism + +

+ [% ELSE %] +

Have a drink somewhere in Marseille, ask @fsomers for more documentation on the process + +

+ [% END %] +
+
+
+[% INCLUDE 'intranet-bottom.inc' %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt index 91172dac2a..b2ca879075 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt @@ -59,6 +59,11 @@
+