From 7c12e28c0235fa05cd13784835b9793fad55e1ec Mon Sep 17 00:00:00 2001 From: Elton Fonseca Date: Mon, 11 Dec 2023 22:06:59 -0300 Subject: [PATCH] fix: remove unecessary api_key from json payload --- lib/chat_models/chat_open_ai.ex | 1 - test/chat_models/chat_open_ai_test.exs | 1 - 2 files changed, 2 deletions(-) diff --git a/lib/chat_models/chat_open_ai.ex b/lib/chat_models/chat_open_ai.ex index 078357df..e4682d82 100644 --- a/lib/chat_models/chat_open_ai.ex +++ b/lib/chat_models/chat_open_ai.ex @@ -131,7 +131,6 @@ defmodule LangChain.ChatModels.ChatOpenAI do def for_api(%ChatOpenAI{} = openai, messages, functions) do %{ model: openai.model, - api_key: openai.api_key, temperature: openai.temperature, frequency_penalty: openai.frequency_penalty, n: openai.n, diff --git a/test/chat_models/chat_open_ai_test.exs b/test/chat_models/chat_open_ai_test.exs index 4305c7ff..bc6fc3c4 100644 --- a/test/chat_models/chat_open_ai_test.exs +++ b/test/chat_models/chat_open_ai_test.exs @@ -56,7 +56,6 @@ defmodule LangChain.ChatModels.ChatOpenAITest do assert data.temperature == 1 assert data.frequency_penalty == 0.5 assert data.response_format == %{"type" => "text"} - assert data.api_key == "api_key" end test "generates a map for an API call with JSON response set to true" do