6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
# File 'lib/ruby_llm/sequel/message_methods.rb', line 6
def to_llm
cached = columns.include?(:cached_tokens) ? self[:cached_tokens] : nil
cache_creation = columns.include?(:cache_creation_tokens) ? self[:cache_creation_tokens] : nil
thinking_tokens_val = columns.include?(:thinking_tokens) ? self[:thinking_tokens] : nil
::RubyLLM::Message.new(
role: role.to_sym,
content: ,
thinking: ,
tool_calls: ,
tool_call_id: ,
input_tokens: input_tokens,
output_tokens: output_tokens,
cached_tokens: cached,
cache_creation_tokens: cache_creation,
thinking_tokens: thinking_tokens_val,
model_id: model_association&.model_id
)
end
|