zmedelis / bosquet

Tooling to build LLM applications: prompt templating and composition, agents, LLM memory, and other instruments for builders of AI applications.
https://zmedelis.github.io/bosquet/
Eclipse Public License 1.0
280 stars 19 forks source link

NPE when :cohere-api-key is not set #31

Closed behrica closed 1 year ago

behrica commented 1 year ago

https://github.com/zmedelis/bosquet/blob/95d410ae5db8e0b5d544b9f79e6cafabf9f01b7a/src/bosquet/system.clj#L37

fails with NPE, whne ":cohere-api-key" is not given in config.edn. (even when cohere is not used)

I think the config for various LLMs should be full optional

zmedelis commented 1 year ago

I think the config for various LLMs should be full optional

Absolutely! Thanks for spotting this. Fixed with the above commit. Please check, and if I missed something reopen the issue.

Note that Timbre logging will now inform which services are starting

INFO [bosquet.system:49] - Initializing Bosquet resources:
INFO [bosquet.system:43] -  * Cohere API service
INFO [bosquet.system:38] -  * OpenAI API service (openai)

It will start the API service only if the necessary config (API key) is provided.