Bugzilla – Attachment 180133 Details for
Bug 39506
Have Koha entering the 21st century through AI
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 39506: Have Koha entering the 21st century through LLMs
Bug-39506-Have-Koha-entering-the-21st-century-thro.patch (text/plain), 5.96 KB, created by
Baptiste Wojtkowski (bwoj)
on 2025-04-01 11:38:28 UTC
(
hide
)
Description:
Bug 39506: Have Koha entering the 21st century through LLMs
Filename:
MIME Type:
Creator:
Baptiste Wojtkowski (bwoj)
Created:
2025-04-01 11:38:28 UTC
Size:
5.96 KB
patch
obsolete
>From 08d1317fde53fdca7ba522582e022d97626b3a51 Mon Sep 17 00:00:00 2001 >From: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com> >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 >--- > 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 00000000..20611060 >--- /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 <http://www.gnu.org/licenses>. >+ >+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 00000000..25a79aa3 >--- /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' %] >+<title >+ >[% FILTER collapse %] >+ [% t("Koha staff interface") | html %] >+ [% END %]</title >+> >+[% Asset.css("css/mainpage.css") | $raw %] >+[% INCLUDE 'doc-head-close.inc' %] >+</head> >+ >+<body id="main_intranet-main" class="intranet-main"> >+[% WRAPPER 'header.inc' %] >+ [% INCLUDE 'home-search.inc' %] >+[% END %] >+ >+[% WRAPPER 'sub-header.inc' %] >+ [% WRAPPER breadcrumbs %] >+ [% END #/ WRAPPER breadcrumbs %] >+[% END %] >+ >+<div id="container-main" class="container-fluid"> >+ <div class="row"> >+ <div class="col-md-3"></div> >+ <div class="col-md-9"> >+ <h1>According to our AI Assistant... You should</h1> >+ [% IF is_superlibrarian %] >+ <p >+ >Consider augmenting the amount of contracts you have with your technical support partner >+ <i id="info_added" data-bs-toggle="tooltip" title="This answer is AI" data-bs-placement="right" class="fa fa-info-circle"></i> >+ </p> >+ [% ELSIF hour < 17 %] >+ <p >+ >Fake working as a librarian while thinking about how to end capitalism >+ <i id="info_added" data-bs-toggle="tooltip" title="This answer is AI" data-bs-placement="right" class="fa fa-info-circle"></i> >+ </p> >+ [% ELSE %] >+ <p >+ >Have a drink somewhere in Marseille, ask @fsomers for more documentation on the process >+ <i id="info_added" data-bs-toggle="tooltip" title="This answer is AI" data-bs-placement="right" class="fa fa-info-circle"></i> >+ </p> >+ [% END %] >+ </div> >+ </div> >+</div> >+[% 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 91172dac..b2ca8790 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 @@ > <!-- /.col-sm-2 --> > <div class="col-md-9 order-md-2"> > <div class="row"> >+ <ul class="biglinks-list"> >+ <li> >+ <a class="icon_general icon_circulation" href="/cgi-bin/koha/important-question.pl"><i class="fa fa-fw fa-robot"></i>What should I do ? (Powered by AI) </a> >+ </li> >+ </ul> > <div class="col-sm-6"> > <ul class="biglinks-list"> > [% IF ( CAN_user_circulate_circulate_remaining_permissions ) %] >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 39506
:
180133
|
180134
|
180152
|
180179
|
180211
|
180247