anthropic 1.16.3 → 1.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (108) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +18 -0
  3. data/README.md +38 -10
  4. data/lib/anthropic/helpers/messages.rb +86 -1
  5. data/lib/anthropic/helpers/streaming/message_stream.rb +54 -29
  6. data/lib/anthropic/models/beta/beta_code_execution_tool_20250522.rb +2 -1
  7. data/lib/anthropic/models/beta/beta_code_execution_tool_20250825.rb +2 -1
  8. data/lib/anthropic/models/beta/beta_memory_tool_20250818.rb +2 -1
  9. data/lib/anthropic/models/beta/beta_output_config.rb +22 -4
  10. data/lib/anthropic/models/beta/beta_server_tool_use_block.rb +25 -25
  11. data/lib/anthropic/models/beta/beta_tool.rb +2 -1
  12. data/lib/anthropic/models/beta/beta_tool_bash_20241022.rb +2 -1
  13. data/lib/anthropic/models/beta/beta_tool_bash_20250124.rb +2 -1
  14. data/lib/anthropic/models/beta/beta_tool_computer_use_20241022.rb +2 -1
  15. data/lib/anthropic/models/beta/beta_tool_computer_use_20250124.rb +2 -1
  16. data/lib/anthropic/models/beta/beta_tool_computer_use_20251124.rb +2 -1
  17. data/lib/anthropic/models/beta/beta_tool_search_tool_bm25_20251119.rb +2 -1
  18. data/lib/anthropic/models/beta/beta_tool_search_tool_regex_20251119.rb +2 -1
  19. data/lib/anthropic/models/beta/beta_tool_text_editor_20241022.rb +2 -1
  20. data/lib/anthropic/models/beta/beta_tool_text_editor_20250124.rb +2 -1
  21. data/lib/anthropic/models/beta/beta_tool_text_editor_20250429.rb +2 -1
  22. data/lib/anthropic/models/beta/beta_tool_text_editor_20250728.rb +2 -1
  23. data/lib/anthropic/models/beta/beta_web_fetch_tool_20250910.rb +2 -1
  24. data/lib/anthropic/models/beta/beta_web_search_tool_20250305.rb +2 -1
  25. data/lib/anthropic/models/beta/beta_web_search_tool_result_error_code.rb +1 -0
  26. data/lib/anthropic/models/beta/message_count_tokens_params.rb +10 -5
  27. data/lib/anthropic/models/beta/message_create_params.rb +10 -5
  28. data/lib/anthropic/models/beta/messages/batch_create_params.rb +10 -5
  29. data/lib/anthropic/models/json_output_format.rb +23 -0
  30. data/lib/anthropic/models/message.rb +12 -0
  31. data/lib/anthropic/models/message_count_tokens_params.rb +9 -1
  32. data/lib/anthropic/models/message_create_params.rb +9 -1
  33. data/lib/anthropic/models/messages/batch_create_params.rb +9 -1
  34. data/lib/anthropic/models/model.rb +6 -0
  35. data/lib/anthropic/models/output_config.rb +20 -0
  36. data/lib/anthropic/models/text_block.rb +8 -0
  37. data/lib/anthropic/models/tool.rb +9 -1
  38. data/lib/anthropic/models/tool_bash_20250124.rb +9 -1
  39. data/lib/anthropic/models/tool_text_editor_20250124.rb +9 -1
  40. data/lib/anthropic/models/tool_text_editor_20250429.rb +9 -1
  41. data/lib/anthropic/models/tool_text_editor_20250728.rb +9 -1
  42. data/lib/anthropic/models/web_search_tool_20250305.rb +9 -1
  43. data/lib/anthropic/models/web_search_tool_request_error.rb +1 -0
  44. data/lib/anthropic/models/web_search_tool_result_error.rb +1 -0
  45. data/lib/anthropic/models.rb +4 -0
  46. data/lib/anthropic/resources/beta/messages.rb +26 -14
  47. data/lib/anthropic/resources/messages.rb +15 -4
  48. data/lib/anthropic/version.rb +1 -1
  49. data/lib/anthropic.rb +2 -0
  50. data/rbi/anthropic/models/beta/beta_code_execution_tool_20250522.rbi +2 -0
  51. data/rbi/anthropic/models/beta/beta_code_execution_tool_20250825.rbi +2 -0
  52. data/rbi/anthropic/models/beta/beta_memory_tool_20250818.rbi +2 -0
  53. data/rbi/anthropic/models/beta/beta_output_config.rbi +32 -6
  54. data/rbi/anthropic/models/beta/beta_server_tool_use_block.rbi +48 -36
  55. data/rbi/anthropic/models/beta/beta_tool.rbi +2 -0
  56. data/rbi/anthropic/models/beta/beta_tool_bash_20241022.rbi +2 -0
  57. data/rbi/anthropic/models/beta/beta_tool_bash_20250124.rbi +2 -0
  58. data/rbi/anthropic/models/beta/beta_tool_computer_use_20241022.rbi +2 -0
  59. data/rbi/anthropic/models/beta/beta_tool_computer_use_20250124.rbi +2 -0
  60. data/rbi/anthropic/models/beta/beta_tool_computer_use_20251124.rbi +2 -0
  61. data/rbi/anthropic/models/beta/beta_tool_search_tool_bm25_20251119.rbi +2 -0
  62. data/rbi/anthropic/models/beta/beta_tool_search_tool_regex_20251119.rbi +2 -0
  63. data/rbi/anthropic/models/beta/beta_tool_text_editor_20241022.rbi +2 -0
  64. data/rbi/anthropic/models/beta/beta_tool_text_editor_20250124.rbi +2 -0
  65. data/rbi/anthropic/models/beta/beta_tool_text_editor_20250429.rbi +2 -0
  66. data/rbi/anthropic/models/beta/beta_tool_text_editor_20250728.rbi +2 -0
  67. data/rbi/anthropic/models/beta/beta_web_fetch_tool_20250910.rbi +2 -0
  68. data/rbi/anthropic/models/beta/beta_web_search_tool_20250305.rbi +2 -0
  69. data/rbi/anthropic/models/beta/beta_web_search_tool_result_error_code.rbi +5 -0
  70. data/rbi/anthropic/models/beta/message_count_tokens_params.rbi +12 -6
  71. data/rbi/anthropic/models/beta/message_create_params.rbi +12 -6
  72. data/rbi/anthropic/models/beta/messages/batch_create_params.rbi +12 -6
  73. data/rbi/anthropic/models/json_output_format.rbi +37 -0
  74. data/rbi/anthropic/models/message.rbi +5 -0
  75. data/rbi/anthropic/models/message_count_tokens_params.rbi +11 -0
  76. data/rbi/anthropic/models/message_create_params.rbi +11 -0
  77. data/rbi/anthropic/models/messages/batch_create_params.rbi +11 -0
  78. data/rbi/anthropic/models/output_config.rbi +40 -0
  79. data/rbi/anthropic/models/tool.rbi +11 -0
  80. data/rbi/anthropic/models/tool_bash_20250124.rbi +12 -1
  81. data/rbi/anthropic/models/tool_text_editor_20250124.rbi +12 -1
  82. data/rbi/anthropic/models/tool_text_editor_20250429.rbi +12 -1
  83. data/rbi/anthropic/models/tool_text_editor_20250728.rbi +12 -1
  84. data/rbi/anthropic/models/web_search_tool_20250305.rbi +11 -0
  85. data/rbi/anthropic/models/web_search_tool_request_error.rbi +5 -0
  86. data/rbi/anthropic/models/web_search_tool_result_error.rbi +5 -0
  87. data/rbi/anthropic/models.rbi +4 -0
  88. data/rbi/anthropic/resources/beta/messages.rbi +21 -9
  89. data/rbi/anthropic/resources/messages.rbi +9 -0
  90. data/sig/anthropic/models/beta/beta_output_config.rbs +10 -3
  91. data/sig/anthropic/models/beta/beta_server_tool_use_block.rbs +21 -17
  92. data/sig/anthropic/models/beta/beta_web_search_tool_result_error_code.rbs +2 -0
  93. data/sig/anthropic/models/json_output_format.rbs +16 -0
  94. data/sig/anthropic/models/message_count_tokens_params.rbs +7 -0
  95. data/sig/anthropic/models/message_create_params.rbs +7 -0
  96. data/sig/anthropic/models/messages/batch_create_params.rbs +9 -0
  97. data/sig/anthropic/models/output_config.rbs +13 -0
  98. data/sig/anthropic/models/tool.rbs +7 -0
  99. data/sig/anthropic/models/tool_bash_20250124.rbs +9 -2
  100. data/sig/anthropic/models/tool_text_editor_20250124.rbs +9 -2
  101. data/sig/anthropic/models/tool_text_editor_20250429.rbs +9 -2
  102. data/sig/anthropic/models/tool_text_editor_20250728.rbs +9 -2
  103. data/sig/anthropic/models/web_search_tool_20250305.rbs +7 -0
  104. data/sig/anthropic/models/web_search_tool_request_error.rbs +2 -0
  105. data/sig/anthropic/models/web_search_tool_result_error.rbs +2 -0
  106. data/sig/anthropic/models.rbs +4 -0
  107. data/sig/anthropic/resources/messages.rbs +3 -0
  108. metadata +22 -2
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: anthropic
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.16.3
4
+ version: 1.17.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anthropic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-01-06 00:00:00.000000000 Z
11
+ date: 2026-01-29 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: cgi
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: connection_pool
15
29
  requirement: !ruby/object:Gem::Requirement
@@ -351,6 +365,7 @@ files:
351
365
  - lib/anthropic/models/image_block_param.rb
352
366
  - lib/anthropic/models/input_json_delta.rb
353
367
  - lib/anthropic/models/invalid_request_error.rb
368
+ - lib/anthropic/models/json_output_format.rb
354
369
  - lib/anthropic/models/message.rb
355
370
  - lib/anthropic/models/message_count_tokens_params.rb
356
371
  - lib/anthropic/models/message_count_tokens_tool.rb
@@ -379,6 +394,7 @@ files:
379
394
  - lib/anthropic/models/model_list_params.rb
380
395
  - lib/anthropic/models/model_retrieve_params.rb
381
396
  - lib/anthropic/models/not_found_error.rb
397
+ - lib/anthropic/models/output_config.rb
382
398
  - lib/anthropic/models/overloaded_error.rb
383
399
  - lib/anthropic/models/permission_error.rb
384
400
  - lib/anthropic/models/plain_text_source.rb
@@ -762,6 +778,7 @@ files:
762
778
  - rbi/anthropic/models/image_block_param.rbi
763
779
  - rbi/anthropic/models/input_json_delta.rbi
764
780
  - rbi/anthropic/models/invalid_request_error.rbi
781
+ - rbi/anthropic/models/json_output_format.rbi
765
782
  - rbi/anthropic/models/message.rbi
766
783
  - rbi/anthropic/models/message_count_tokens_params.rbi
767
784
  - rbi/anthropic/models/message_count_tokens_tool.rbi
@@ -790,6 +807,7 @@ files:
790
807
  - rbi/anthropic/models/model_list_params.rbi
791
808
  - rbi/anthropic/models/model_retrieve_params.rbi
792
809
  - rbi/anthropic/models/not_found_error.rbi
810
+ - rbi/anthropic/models/output_config.rbi
793
811
  - rbi/anthropic/models/overloaded_error.rbi
794
812
  - rbi/anthropic/models/permission_error.rbi
795
813
  - rbi/anthropic/models/plain_text_source.rbi
@@ -1161,6 +1179,7 @@ files:
1161
1179
  - sig/anthropic/models/image_block_param.rbs
1162
1180
  - sig/anthropic/models/input_json_delta.rbs
1163
1181
  - sig/anthropic/models/invalid_request_error.rbs
1182
+ - sig/anthropic/models/json_output_format.rbs
1164
1183
  - sig/anthropic/models/message.rbs
1165
1184
  - sig/anthropic/models/message_count_tokens_params.rbs
1166
1185
  - sig/anthropic/models/message_count_tokens_tool.rbs
@@ -1189,6 +1208,7 @@ files:
1189
1208
  - sig/anthropic/models/model_list_params.rbs
1190
1209
  - sig/anthropic/models/model_retrieve_params.rbs
1191
1210
  - sig/anthropic/models/not_found_error.rbs
1211
+ - sig/anthropic/models/output_config.rbs
1192
1212
  - sig/anthropic/models/overloaded_error.rbs
1193
1213
  - sig/anthropic/models/permission_error.rbs
1194
1214
  - sig/anthropic/models/plain_text_source.rbs