Hacker News new | ask | show | jobs
by Flux159 599 days ago
This seems like it can be super useful - lot to go over but want to focus on running commands in containers. Having a clean and elegant way of executing LLM commands in a containerized environment is definitely better than running on a single VM/machine. I do wonder how something like this would run in a containerized application though - can you define the "host" to be a kubernetes control plane?

Note that the container link on the homepage to https://microsoft.github.io/genaiscript/referenc/scripts/con... seems to be broken.

Edit: Okay, taking a deeper look - this seems to be a separate runtime on top of node - "$" seems to be global and files are defined as .genai.mjs and run through VSCode. I see that there's a way to run via CLI as well: `npx genaiscript run proofreader path/to/files*.md`, but I wonder what the rationale around these design decisions are. It seems like it's tying these files to a different runtime - can I use them directly in Node or Bun as part of an API? Something like "import {templateStr as $, def} from 'genaiscript'", then use it normally in Node?

1 comments

One of the early ideas was to make the scripting syntax as lightweight as possible. Thus not requiring to install or import anythying to start writing a prompt (the project evolved). Definitely inspired from google/zx.
Ah thanks for clarifying. I understand the focus on being a scripting syntax first after looking at google/zx & rereading the docs.

Also had some more time to look at the code, seems like the CLI is using https://github.com/microsoft/genaiscript/blob/main/packages/... to execute scripts which uses promptrunner in core https://github.com/microsoft/genaiscript/blob/main/packages/... - it looks like it's not trivial to use directly from JS or decouple the runtime? Unless that's on the roadmap somewhere to be able to call the scripts in the same process as a Node app.