diff --git a/flake.lock b/flake.lock index 3457045..33ed694 100644 --- a/flake.lock +++ b/flake.lock @@ -5,11 +5,11 @@ "systems": "systems" }, "locked": { - "lastModified": 1710146030, - "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", "owner": "numtide", "repo": "flake-utils", - "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", "type": "github" }, "original": { @@ -20,11 +20,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1723362943, - "narHash": "sha256-dFZRVSgmJkyM0bkPpaYRtG/kRMRTorUIDj8BxoOt1T4=", + "lastModified": 1737885589, + "narHash": "sha256-Zf0hSrtzaM1DEz8//+Xs51k/wdSajticVrATqDrfQjg=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "a58bc8ad779655e790115244571758e8de055e3d", + "rev": "852ff1d9e153d8875a83602e03fdef8a63f0ecf8", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index bc357f9..79c2745 100644 --- a/flake.nix +++ b/flake.nix @@ -8,17 +8,16 @@ outputs = { self, nixpkgs, flake-utils }: flake-utils.lib.eachDefaultSystem (system: let - pkgs = import nixpkgs { - inherit system; - config.allowUnfree = true; - config.cudaSupport = true; + pkgs = import nixpkgs { + inherit system; }; + beamPackages = pkgs.beam.packages.erlang; + elixir = beamPackages.elixir; in { devShells.default = pkgs.mkShell { buildInputs = with pkgs; ([ - erlang_26 - elixir_1_16 + elixir ]); }; } diff --git a/lib/stubidity/azure_openai/chat_completion.ex b/lib/stubidity/azure_openai/chat_completion.ex index 700ae1c..7fa797e 100644 --- a/lib/stubidity/azure_openai/chat_completion.ex +++ b/lib/stubidity/azure_openai/chat_completion.ex @@ -1,4 +1,5 @@ defmodule Stubidity.AzureOpenAI.ChatCompletion do + require Logger import Plug.Conn def init(_opts), do: nil @@ -110,7 +111,8 @@ defmodule Stubidity.AzureOpenAI.ChatCompletion do {:ok, conn} -> {:cont, conn} - {:error, _reason, conn} -> + {:error, reason} -> + Logger.error("Error chunking response: #{inspect(reason)}") {:halt, conn} end end) diff --git a/lib/stubidity/openai/chat_completion.ex b/lib/stubidity/openai/chat_completion.ex index 5bc168a..f9e42c0 100644 --- a/lib/stubidity/openai/chat_completion.ex +++ b/lib/stubidity/openai/chat_completion.ex @@ -1,4 +1,5 @@ defmodule Stubidity.OpenAI.ChatCompletion do + require Logger import Plug.Conn use OpenApiSpex.ControllerSpecs @@ -136,7 +137,8 @@ defmodule Stubidity.OpenAI.ChatCompletion do {:ok, conn} -> {:cont, conn} - {:error, _reason, conn} -> + {:error, reason} -> + Logger.error("Error chunking response: #{inspect(reason)}") {:halt, conn} end end) diff --git a/lib/stubidity/openai/completion.ex b/lib/stubidity/openai/completion.ex index d8fcac4..d4d03fa 100644 --- a/lib/stubidity/openai/completion.ex +++ b/lib/stubidity/openai/completion.ex @@ -1,4 +1,5 @@ defmodule Stubidity.OpenAI.Completion do + require Logger import Plug.Conn use OpenApiSpex.ControllerSpecs @@ -123,7 +124,8 @@ defmodule Stubidity.OpenAI.Completion do {:ok, conn} -> {:cont, conn} - {:error, _reason, conn} -> + {:error, reason} -> + Logger.error("Error chunking response: #{inspect(reason)}") {:halt, conn} end end)