Skip to content

Commit

Permalink
make content check a little more resilient
Browse files Browse the repository at this point in the history
  • Loading branch information
obie committed Oct 21, 2024
1 parent d5dac09 commit 8809ccb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/raix/message_adapters/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def content(message)
raise ArgumentError, "Invalid message format: #{message.inspect}"
end.tap do |msg|
# convert to anthropic multipart format if model is claude-3 and cache_at is set
if model["anthropic/claude-3"] && cache_at && msg[:content].length > cache_at.to_i
if model.to_s.include?("anthropic/claude-3") && cache_at && msg[:content].to_s.length > cache_at.to_i
msg[:content] = [{ type: "text", text: msg[:content], cache_control: { type: "ephemeral" } }]
end
end
Expand Down

0 comments on commit 8809ccb

Please sign in to comment.