patterns-ai-core / langchainrb

Build LLM-powered applications in Ruby
https://rubydoc.info/gems/langchainrb
MIT License
1.18k stars 156 forks source link

fix undefined text completions in anthropic response #653

Closed agomezcampero closed 3 weeks ago

agomezcampero commented 3 weeks ago

Really small bug fix. Anthropic can return only tool_calls, if that is the case then you don't have any text completions and you get an error trying to get the chat_completion

andreibondarev commented 3 weeks ago

@agomezcampero Thank you for the fix!