Repository navigation
feat: JBangGPT -> JBang AI with multiple providers and no-preview - #2324
Conversation
|
Yes, I think it would be a good idea to provide flags. It will also give more attention to this feature when people run |
|
implemented ai arggroup that uses environment/jbang options to look up values - @quintesse did i do that right ? also moved file check to before ai call so you dont wait several seconds to then get rejected.
gives you: 2025-11-22_09-10-58.mp4https://gist.github.com/maxandersen/ad1eed2e9daf1be6285cbab9ce095511 i kinda wish we could come up with a way to detect ollama running locally but just a bit too many variants and models to make it worthwhile...user can always set the --ai-* config or env to make it work though. |
2ca40da to
0fc60db
Compare
|
plan to merge this if tests passes as its isolated change and would like a release out |
5aa1155 to
ff088e8
Compare
|
i commented out providers i haven't had time to verify - just in case. |
|
|
||
| [source,bash] | ||
| ---- | ||
| $ jbang config set default.ai.provider openai |
There was a problem hiding this comment.
Everything looks good, except for this, the default values don't start with "default.". THe fact that in the code you have to do:
defaultValue = "${JBANG_AI_PROVIDER:-${default.ai.provider)}"
is just an internal implementation detail.
Also, special chars are removed from the names. In this case you're using a . in the name, which is not valid. So the actual name becomes: aiprovider. (Although the fqn can also be used, which would be app.init.aiprovider, but in this case that's not very interesting/useful)
| public class AIOptions { | ||
|
|
||
| @CommandLine.Option(names = { | ||
| "--ai-provider" }, description = "Provider to use (openai, openrouter, etc.) when using init with a prompt - if none specified will use the default provider from environment variables", defaultValue = "${JBANG_AI_PROVIDER:-${default.ai.provider)}") |
There was a problem hiding this comment.
You can't do default.ai.provider here, you have to use the fully qualified name (without special chars like I said earlier), so it becomes default.init.aiprovider.
And finally I see you have typos in those lines, you're using a ) instead of as }:
${JBANG_AI_PROVIDER:-${default.ai.provider)}
^
realized i never really used jbanggpt because it was A) behind preview flag B) broken.
this fixes it, removes preview requirement + calls it JBang AI instead of GPT ...and introduce mechanism of picking a key from env and guess potential providers - incl. option of overriding it with
JBANG_AI_*env.should we add jbang config flags for them?
wdyt?