diff --git a/lib/langchain/llm/response/google_gemini_response.rb b/lib/langchain/llm/response/google_gemini_response.rb index 3a974d663..5d8e6c692 100644 --- a/lib/langchain/llm/response/google_gemini_response.rb +++ b/lib/langchain/llm/response/google_gemini_response.rb @@ -15,7 +15,7 @@ def role end def tool_calls - if raw_response.dig("candidates", 0, "content") && raw_response.dig("candidates", 0, "content", "parts", 0).has_key?("functionCall") + if raw_response.dig("candidates", 0, "content", "parts", 0) && raw_response.dig("candidates", 0, "content", "parts", 0).has_key?("functionCall") raw_response.dig("candidates", 0, "content", "parts") else []