From a1d72fcbf5317a46ff41d50dd8fecc0aa526af6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Fern=C3=A1ndez?= Date: Tue, 1 Oct 2024 16:02:45 +0200 Subject: [PATCH] fix openai_key env variables app (#2) * fix open_ai env variables app * bump minor version --- README.md | 8 ++++---- lib/llm_composer/models/open_ai.ex | 2 +- mix.exs | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 1365700..689571e 100644 --- a/README.md +++ b/README.md @@ -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 ``` @@ -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, "") +Application.put_env(:llm_composer, :openai_key, "") defmodule MyChat do @@ -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 @@ -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, "") +Application.put_env(:llm_composer, :openai_key, "") defmodule MyChat do diff --git a/lib/llm_composer/models/open_ai.ex b/lib/llm_composer/models/open_ai.ex index 5977351..7c452ea 100644 --- a/lib/llm_composer/models/open_ai.ex +++ b/lib/llm_composer/models/open_ai.ex @@ -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 diff --git a/mix.exs b/mix.exs index 532b22d..8f74511 100644 --- a/mix.exs +++ b/mix.exs @@ -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(),