Package config in Livebook notebook

Hi!

I was going to play with the package openai [1] in a livebook notebook.

In the setup I added:

Mix.install([
  {:openai, "~> 0.1.1"}
])

However, I don’t know how/where to add the config (API key):

use Mix.Config

config :openai,
  api_key: "your-api-key",
  organization_key: "your-organization-key

Where should I place the package config (API key) so I can use it in a livebook notebook?
Thanks!

[1] GitHub - mgallo/openai.ex: OpenAI API Wrapper written in Elixir.

Mix — Mix v1.13.4 see the second example

2 Likes

I missed that, thank you @LostKobrakai!

As a reference, I added this and it worked:

Mix.install(
  [{:openai, "~> 0.1.1"}],
  config: [
    openai: [
      api_key: "...",
      organisation_key: "...",
    ]
  ]
)
1 Like

thanks for the tip!