cablehead / nu_plugin_from_sse

Nushell plugin to parse a stream of HTTP server sent events
MIT License
8 stars 1 forks source link

Porting functionality in upstream http commands #3

Open 1412031 opened 5 months ago

1412031 commented 5 months ago

Greetings, I've wrote a couple of wrappers around APIs like OpenAI and Anthropic and I've spent considerable amounts of time hacking around parsing sse when streaming.

At some point I would like to share them in nushell_scripts for others to use and your plugin is perfect for parsing the response.

I've been wondering, is there anything (apart from time and effort) stopping one from incorporating the parser in nushell instead of using it separately like a plugin?

SSE have become quite a thing lastly and having them handled without any external dependencies could be quite useful in many cases.

In any case, thanks for authoring this!

cablehead commented 5 months ago

Hi! I'd love to see your wrappers. Those type of APIs are just the thing I'm hoping from sse can support.

My understanding is that the nu community is generally looking to move things from builtins towards plugins (the dataframe builtins have been moved to a polars plugin). I'm not certain what the consensus is for http related things. My personal preference would be to move the current builtin http commands out to a plugin: https://github.com/cablehead/nu_plugin_http If that http plugin pans out, I'll merge from sse with it.

Want to swing by the nushell discord to discuss in the #plugins channel?