From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Philip Kaludercic Newsgroups: gmane.emacs.devel Subject: Re: Add plz-media-type and plz-event-source to GNU ELPA when stabilized Date: Sat, 27 Apr 2024 13:43:50 +0000 Message-ID: <87frv6q5t5.fsf@posteo.net> References: <87h6fnmb4b.fsf@burningswell.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38075"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org, ahyatt@gmail.com To: Roman Scherer Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Apr 27 15:44:19 2024 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1s0iLj-0009k6-CJ for ged-emacs-devel@m.gmane-mx.org; Sat, 27 Apr 2024 15:44:19 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s0iLN-0005oD-LW; Sat, 27 Apr 2024 09:43:57 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s0iLM-0005o3-MF for emacs-devel@gnu.org; Sat, 27 Apr 2024 09:43:56 -0400 Original-Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s0iLK-0004E8-9d for emacs-devel@gnu.org; Sat, 27 Apr 2024 09:43:56 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id E2806240105 for ; Sat, 27 Apr 2024 15:43:51 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1714225431; bh=c1pcLuXbM/DVV1E+6XuRsdNavIdSJCvdZYcTThRTvOo=; h=From:To:Cc:Subject:OpenPGP:Date:Message-ID:MIME-Version: Content-Type:From; b=Vw16WVoHLRAOLtM7gbfRa4st5q2bvt6lBCsHmaQiByzvvMlUQjD/uUAtdU4boZZ+N alNIn0y0e3FWsYZgC4tCY457YcL8Qyg7coST9tBpSsJUxP8uiN7fImeO7Qx4qlCDqG YE9VGmty4PDrg5kK2ej0QOGzN+CVd2ZnUQQQAChZfLcWSoYlvXoeWrcPg0cKBviBIx qykmR74tDkBXxoTjKXwox1mi0qw4QIX/XTdWyD35ntQ56UUnpQmI9DcgfzHbe3qjHH OWUyrCqOBjq7AZU+nysMouR4qEHzgk15b+12+bjrCgkx/kETa/jX1tzhwb8mwUrPys WGeGwugitqnvQ== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4VRW5g0wTqz6tvk; Sat, 27 Apr 2024 15:43:51 +0200 (CEST) In-Reply-To: <87h6fnmb4b.fsf@burningswell.com> (Roman Scherer's message of "Sat, 27 Apr 2024 11:02:44 +0200") OpenPGP: id=7126E1DE2F0CE35C770BED01F2C3CC513DB89F66; url="https://keys.openpgp.org/vks/v1/by-fingerprint/7126E1DE2F0CE35C770BED01F2C3CC513DB89F66"; preference=signencrypt Received-SPF: pass client-ip=185.67.36.66; envelope-from=philipk@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:318202 Archived-At: Roman Scherer writes: > Hello Emacs Developers, > > I am writing you to ask if we could include the ~plz-media-type~ [1] > and the ~plz-event-source~ [2] libraries to GNU ELPA, once Andrew > Hyatt and I declare them as releasable. We can add the libraries to ELPA right now, if you mark the package version as something that shouldn't be released. This appears to be the case right now, as the versions end in -pre. As soon as you change this, the packages would be released on ELPA. The only question I have, from a very superficial understanding, is why you don't want to upstream these into the library called "plz" itself? Is that unfeasible or did Adam reject the changes? Quickly scanning the code made it seem OK, all I would suggest not using the README for both the repository README file and the manual. Also, if possible I'd avoid tracking the generated .info file in the repository itself. > At the moment those 2 libraries are "vendored" (we copied 2 files) in > the llm [3] library. Andrew and I would like to ship them via the llm > library to users for now, and once we are confident there are no > serious issues we would like to release them to GNU ELPA. We plan to > do so in Q4 of 2024. > > These libraries are designed to handle HTTP responses based on the > content type header and process the response in a way specific to the > media type. One example of this is to process a HTTP response in the > text/event-stream format (aka server sent events) and handle the > events as they arrive. > > Both libraries use Adam Porter's plz library and I wrote them to > support Andrew Hyatt in his work on the llm library. We are planning > to add support to the llm library to make HTTP requests with > curl. This should solve reliability issues that Andrew saw, and allows > me to use the llm library with LLMs that sit behind the proxy of my > employer, who supported my work on this. > > They also simplified the code in the llm library that handles the > various response formats that are in use by all those LLMs deployed > out there. The libraries are designed to be extendable and could be > used by Emacs packages that, as of today, implement their own way to > handle for example, server sent events in a streaming way. > > *plz-media-type:* > > This library builds upon the ~plz.el~ HTTP library and provides a > mechanism to process responses based on their content type headers. It > defines classes for parsing and processing the HTTP body of some > standard MIME types like JSON, XML, HTML. It also contains classes > that can handle formats like newline delimited JSON, or JSON arrays in > a streaming way. Those last formats are often used by LLMs. The > library is designed to be extendable (you can replace and bring your > own media type class) and frees users from writing their own process > filter functions. > > *plz-event-source:* > > This library provides a media type class, parser, and event source > implementation for the Server-Sent Events (SSE) protocol. The media > type class can be used with the ~plz-media-type~ library. We use it in > the llm library to process HTTP responses for LLMs that return a MIME > type of text/event-stream. > > I won't spend any significant time on re-designing the API (we went > through many iterations) or making it compatible with url-retrieve > right now, in case someone is suggesting this. This project was partly > sponsored by my employer while I was on a 3 month working group and we > want to use the llm library with curl. My time on this is reaching an > end I would like to bring it over the finish line. I am committed to > support Andrew should any bugs or significant issues come up. > > Andrew Hyatt asked me to write to you to get the green light for > publishing those libraries to GNU ELPA, once we think they are > stable. We plan to do this in about half a year. > > If you agree on eventually releasing those libraries to GNU ELPA, we > plan to merge the "plz" branch of the llm library into master soon and > release it to a wider audience. One package that would immediately > benefit is Ellama [4] which I thoroughly tested while working on this. > > My employer and I already did the copyright assignment paperwork, > which has been completed a month ago. > > Wdyt? > > Thanks, Roman. > > [1] https://github.com/r0man/plz-media-type > [2] https://github.com/r0man/plz-event-source > [3] https://github.com/ahyatt/llm/tree/plz > [4] https://github.com/s-kostyaev/ellama > -- Philip Kaludercic on peregrine