Module: LLM::Session::Deserializer Private
- Included in:
- LLM::Session
- Defined in:
- lib/llm/session/deserializer.rb
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Instance Method Summary collapse
Instance Method Details
#deserialize_message(payload) ⇒ LLM::Message
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
10 11 12 13 14 15 16 17 |
# File 'lib/llm/session/deserializer.rb', line 10 def (payload) tool_calls = deserialize_tool_calls(payload["tools"]) returns = deserialize_returns(payload["content"]) if returns.nil? original_tool_calls = payload["original_tool_calls"] extra = {tool_calls:, original_tool_calls:}.compact content = returns.nil? ? payload["content"] : returns LLM::Message.new(payload["role"], content, extra) end |