Skip to content

Commit

Permalink
fix undeined text completions in anthropic response (#653)
Browse files Browse the repository at this point in the history
Co-authored-by: Andrei Bondarev <andrei@sourcelabs.io>
  • Loading branch information
agomezcampero and andreibondarev committed Jun 3, 2024
1 parent f6d334f commit f3d0bd8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/langchain/llm/response/anthropic_response.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def completion

def chat_completion
chat_completion = chat_completions.find { |h| h["type"] == "text" }
chat_completion.dig("text")
chat_completion&.dig("text")
end

def tool_calls
Expand Down

0 comments on commit f3d0bd8

Please sign in to comment.