patterns-ai-core / langchainrb

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

Refactor `Langchain::Assistant::Messages::*#to_hash` methods and split by roles #856

Open andreibondarev opened 1 month ago

andreibondarev commented 1 month ago

Description

The current to_hash() method is lengthy and has too much logic in it. Example: https://github.com/patterns-ai-core/langchainrb/blob/main/lib/langchain/assistant/messages/openai_message.rb#L52-L80

Tasks:

rishirajkumar97 commented 3 weeks ago

Hi Andrei, I am currently working on this in this draft PR - https://github.com/patterns-ai-core/langchainrb/pull/867 Please do lemme know if theres a update on this issue.

Regards, Rishi J