Skip to content

Commit

Permalink
fix openai_key env variables app (#2)
Browse files Browse the repository at this point in the history
* fix open_ai env variables app

* bump minor version
  • Loading branch information
victor23k authored Oct 1, 2024
1 parent 19aadcd commit a1d72fc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ by adding `llm_composer` to your list of dependencies in `mix.exs`:
```elixir
def deps do
[
{:llm_composer, "~> 0.1.0"}
{:llm_composer, "~> 0.2.0"}
]
end
```
Expand All @@ -24,7 +24,7 @@ To create a basic chatbot using LlmComposer, you need to define a module that us


```elixir
Application.put_env(:llm_caller, :openai_key, "<your api key>")
Application.put_env(:llm_composer, :openai_key, "<your api key>")

defmodule MyChat do

Expand Down Expand Up @@ -68,7 +68,7 @@ Make sure to start the Ollama server first.

```elixir
# Set the Ollama URI in the application environment if not already configured
# Application.put_env(:llm_caller, :ollama_uri, "http://localhost:11434")
# Application.put_env(:llm_composer, :ollama_uri, "http://localhost:11434")

defmodule MyChat do

Expand Down Expand Up @@ -115,7 +115,7 @@ You can enhance the bot's capabilities by adding support for external function e


```elixir
Application.put_env(:llm_caller, :openai_key, "<your api key>")
Application.put_env(:llm_composer, :openai_key, "<your api key>")

defmodule MyChat do

Expand Down
2 changes: 1 addition & 1 deletion lib/llm_composer/models/open_ai.ex
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ defmodule LlmComposer.Models.OpenAI do
model = Keyword.get(opts, :model)

headers = [
{"Authorization", "Bearer " <> Application.get_env(:llm_caller, :openai_key)}
{"Authorization", "Bearer " <> Application.get_env(:llm_composer, :openai_key)}
]

if model do
Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ defmodule LlmComposer.MixProject do
def project do
[
app: :llm_composer,
version: "0.1.0",
version: "0.2.0",
elixir: "~> 1.16",
start_permanent: Mix.env() == :prod,
deps: deps(),
Expand Down

0 comments on commit a1d72fc

Please sign in to comment.