Skip to content

Commit

Permalink
Pass api_key to request if present in chat
Browse files Browse the repository at this point in the history
  • Loading branch information
michalwarda committed Dec 3, 2023
1 parent 1c2dac9 commit cc8404d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/chat_models/chat_open_ai.ex
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ defmodule LangChain.ChatModels.ChatOpenAI do
Req.new(
url: openai.endpoint,
json: for_api(openai, messages, functions),
auth: {:bearer, get_api_key()},
auth: {:bearer, openai.api_key || get_api_key()},
receive_timeout: openai.receive_timeout,
retry: :transient,
max_retries: 3,
Expand Down

0 comments on commit cc8404d

Please sign in to comment.