Skip to content

Commit 3a50f29

Browse files
committed
vcr for anthropic structured output
1 parent f36c37e commit 3a50f29

5 files changed

+269
-4
lines changed

lib/ruby_llm/models.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,8 @@
445445
},
446446
"capabilities": [
447447
"function_calling",
448-
"vision"
448+
"vision",
449+
"structured_output"
449450
],
450451
"pricing": {
451452
"text_tokens": {

spec/fixtures/vcr_cassettes/chat_with_schema_with_anthropic_claude-haiku-4-5_accepts_a_json_schema_and_returns_structured_output.yml

Lines changed: 84 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

spec/fixtures/vcr_cassettes/chat_with_schema_with_anthropic_claude-haiku-4-5_allows_removing_schema_with_nil_mid-conversation.yml

Lines changed: 180 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

spec/ruby_llm/chat_schema_spec.rb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,8 @@
1818
}
1919
end
2020

21-
# Test OpenAI-compatible providers that support structured output
22-
# Note: Only test models that have json_schema support, not just json_object
23-
CHAT_MODELS.select { |model_info| %i[openai].include?(model_info[:provider]) }.each do |model_info|
21+
# Test providers that support JSON Schema structured output
22+
CHAT_MODELS.select { |m| %i[openai anthropic].include?(m[:provider]) }.each do |model_info|
2423
model = model_info[:model]
2524
provider = model_info[:provider]
2625

spec/support/models_to_test.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# frozen_string_literal: true
22

33
CHAT_MODELS = [
4+
{ provider: :anthropic, model: 'claude-haiku-4-5' },
45
{ provider: :openrouter, model: 'claude-haiku-4-5' },
56
{ provider: :bedrock, model: 'claude-3-5-haiku' },
67
{ provider: :deepseek, model: 'deepseek-chat' },

0 commit comments

Comments
 (0)