Skip to content

Commit

Permalink
Remove handling of Azure special case.
Browse files Browse the repository at this point in the history
  • Loading branch information
raulchedrese committed Jun 3, 2024
1 parent c25ca9f commit f6dcb69
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions lib/chains/llm_chain.ex
Original file line number Diff line number Diff line change
Expand Up @@ -226,18 +226,6 @@ defmodule LangChain.Chains.LLMChain do

{:ok, updated_chain}

# When calling the latest OpenAI models through Azure it sometimes returns an empty list
# as the first element of a list of MessageDeltas. This is a workaround to handle that.
# It would likely be better to handle this in ChatOpenAI instead.
{:ok, [[] | _] = deltas} ->
if chain.verbose_deltas, do: IO.inspect(deltas, label: "DELTA MESSAGE LIST RESPONSE")
updated_chain = apply_deltas(chain, deltas)

if chain.verbose,
do: IO.inspect(updated_chain.last_message, label: "COMBINED DELTA MESSAGE RESPONSE")

{:ok, updated_chain}

{:ok, [[%MessageDelta{} | _] | _] = deltas} ->
if chain.verbose_deltas, do: IO.inspect(deltas, label: "DELTA MESSAGE LIST RESPONSE")
updated_chain = apply_deltas(chain, deltas)
Expand Down

0 comments on commit f6dcb69

Please sign in to comment.