Open andreibondarev opened 1 month ago
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
to_hash()
Langchain::Assistant::Messages::*
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
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-L80Tasks:
to_hash()
methods in all ofLangchain::Assistant::Messages::*
subclasses and split them by role. Similar to https://github.com/patterns-ai-core/langchainrb/blob/main/lib/langchain/assistant/messages/mistral_ai_message.rb#L47-L57.