anthropic 1.4.1 → 1.6.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 (52) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +29 -0
  3. data/README.md +1 -1
  4. data/lib/anthropic/helpers/bedrock/client.rb +55 -2
  5. data/lib/anthropic/internal/transport/base_client.rb +1 -1
  6. data/lib/anthropic/internal/type/array_of.rb +1 -0
  7. data/lib/anthropic/internal/type/base_model.rb +3 -1
  8. data/lib/anthropic/internal/type/converter.rb +27 -0
  9. data/lib/anthropic/internal/type/hash_of.rb +1 -0
  10. data/lib/anthropic/internal/type/union.rb +9 -7
  11. data/lib/anthropic/models/anthropic_beta.rb +3 -0
  12. data/lib/anthropic/models/citation_search_result_location_param.rb +51 -0
  13. data/lib/anthropic/models/citations_delta.rb +5 -3
  14. data/lib/anthropic/models/citations_search_result_location.rb +51 -0
  15. data/lib/anthropic/models/content_block_param.rb +4 -1
  16. data/lib/anthropic/models/message_param.rb +3 -3
  17. data/lib/anthropic/models/search_result_block_param.rb +51 -0
  18. data/lib/anthropic/models/text_block.rb +2 -2
  19. data/lib/anthropic/models/text_block_param.rb +2 -2
  20. data/lib/anthropic/models/text_citation.rb +3 -1
  21. data/lib/anthropic/models/text_citation_param.rb +3 -1
  22. data/lib/anthropic/models/tool_result_block_param.rb +6 -4
  23. data/lib/anthropic/models.rb +6 -0
  24. data/lib/anthropic/version.rb +1 -1
  25. data/lib/anthropic.rb +3 -0
  26. data/rbi/anthropic/internal/type/converter.rbi +54 -0
  27. data/rbi/anthropic/internal/type/union.rbi +9 -2
  28. data/rbi/anthropic/models/anthropic_beta.rbi +2 -0
  29. data/rbi/anthropic/models/citation_search_result_location_param.rbi +74 -0
  30. data/rbi/anthropic/models/citations_delta.rbi +4 -2
  31. data/rbi/anthropic/models/citations_search_result_location.rbi +74 -0
  32. data/rbi/anthropic/models/content_block_param.rbi +1 -0
  33. data/rbi/anthropic/models/search_result_block_param.rbi +77 -0
  34. data/rbi/anthropic/models/text_block.rbi +2 -1
  35. data/rbi/anthropic/models/text_block_param.rbi +6 -3
  36. data/rbi/anthropic/models/text_citation.rbi +2 -1
  37. data/rbi/anthropic/models/text_citation_param.rbi +2 -1
  38. data/rbi/anthropic/models/tool_result_block_param.rbi +5 -1
  39. data/rbi/anthropic/models.rbi +8 -0
  40. data/sig/anthropic/internal/type/converter.rbs +17 -0
  41. data/sig/anthropic/internal/type/union.rbs +2 -2
  42. data/sig/anthropic/models/anthropic_beta.rbs +2 -0
  43. data/sig/anthropic/models/citation_search_result_location_param.rbs +50 -0
  44. data/sig/anthropic/models/citations_delta.rbs +1 -0
  45. data/sig/anthropic/models/citations_search_result_location.rbs +50 -0
  46. data/sig/anthropic/models/content_block_param.rbs +1 -0
  47. data/sig/anthropic/models/search_result_block_param.rbs +49 -0
  48. data/sig/anthropic/models/text_citation.rbs +1 -0
  49. data/sig/anthropic/models/text_citation_param.rbs +1 -0
  50. data/sig/anthropic/models/tool_result_block_param.rbs +4 -1
  51. data/sig/anthropic/models.rbs +6 -0
  52. metadata +11 -2
@@ -0,0 +1,49 @@
1
+ module Anthropic
2
+ module Models
3
+ type search_result_block_param =
4
+ {
5
+ content: ::Array[Anthropic::TextBlockParam],
6
+ source: String,
7
+ title: String,
8
+ type: :search_result,
9
+ cache_control: Anthropic::CacheControlEphemeral?,
10
+ citations: Anthropic::CitationsConfigParam
11
+ }
12
+
13
+ class SearchResultBlockParam < Anthropic::Internal::Type::BaseModel
14
+ attr_accessor content: ::Array[Anthropic::TextBlockParam]
15
+
16
+ attr_accessor source: String
17
+
18
+ attr_accessor title: String
19
+
20
+ attr_accessor type: :search_result
21
+
22
+ attr_accessor cache_control: Anthropic::CacheControlEphemeral?
23
+
24
+ attr_reader citations: Anthropic::CitationsConfigParam?
25
+
26
+ def citations=: (
27
+ Anthropic::CitationsConfigParam
28
+ ) -> Anthropic::CitationsConfigParam
29
+
30
+ def initialize: (
31
+ content: ::Array[Anthropic::TextBlockParam],
32
+ source: String,
33
+ title: String,
34
+ ?cache_control: Anthropic::CacheControlEphemeral?,
35
+ ?citations: Anthropic::CitationsConfigParam,
36
+ ?type: :search_result
37
+ ) -> void
38
+
39
+ def to_hash: -> {
40
+ content: ::Array[Anthropic::TextBlockParam],
41
+ source: String,
42
+ title: String,
43
+ type: :search_result,
44
+ cache_control: Anthropic::CacheControlEphemeral?,
45
+ citations: Anthropic::CitationsConfigParam
46
+ }
47
+ end
48
+ end
49
+ end
@@ -5,6 +5,7 @@ module Anthropic
5
5
  | Anthropic::CitationPageLocation
6
6
  | Anthropic::CitationContentBlockLocation
7
7
  | Anthropic::CitationsWebSearchResultLocation
8
+ | Anthropic::CitationsSearchResultLocation
8
9
 
9
10
  module TextCitation
10
11
  extend Anthropic::Internal::Type::Union
@@ -5,6 +5,7 @@ module Anthropic
5
5
  | Anthropic::CitationPageLocationParam
6
6
  | Anthropic::CitationContentBlockLocationParam
7
7
  | Anthropic::CitationWebSearchResultLocationParam
8
+ | Anthropic::CitationSearchResultLocationParam
8
9
 
9
10
  module TextCitationParam
10
11
  extend Anthropic::Internal::Type::Union
@@ -49,7 +49,10 @@ module Anthropic
49
49
  module Content
50
50
  extend Anthropic::Internal::Type::Union
51
51
 
52
- type content = Anthropic::TextBlockParam | Anthropic::ImageBlockParam
52
+ type content =
53
+ Anthropic::TextBlockParam
54
+ | Anthropic::ImageBlockParam
55
+ | Anthropic::SearchResultBlockParam
53
56
 
54
57
  module Content
55
58
  extend Anthropic::Internal::Type::Union
@@ -53,6 +53,10 @@ module Anthropic
53
53
 
54
54
  class CitationsDelta = Anthropic::Models::CitationsDelta
55
55
 
56
+ class CitationSearchResultLocationParam = Anthropic::Models::CitationSearchResultLocationParam
57
+
58
+ class CitationsSearchResultLocation = Anthropic::Models::CitationsSearchResultLocation
59
+
56
60
  class CitationsWebSearchResultLocation = Anthropic::Models::CitationsWebSearchResultLocation
57
61
 
58
62
  class CitationWebSearchResultLocationParam = Anthropic::Models::CitationWebSearchResultLocationParam
@@ -139,6 +143,8 @@ module Anthropic
139
143
 
140
144
  class RedactedThinkingBlockParam = Anthropic::Models::RedactedThinkingBlockParam
141
145
 
146
+ class SearchResultBlockParam = Anthropic::Models::SearchResultBlockParam
147
+
142
148
  class ServerToolUsage = Anthropic::Models::ServerToolUsage
143
149
 
144
150
  class ServerToolUseBlock = Anthropic::Models::ServerToolUseBlock
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: anthropic
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.1
4
+ version: 1.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anthropic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-08-07 00:00:00.000000000 Z
11
+ date: 2025-08-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: connection_pool
@@ -227,9 +227,11 @@ files:
227
227
  - lib/anthropic/models/citation_content_block_location_param.rb
228
228
  - lib/anthropic/models/citation_page_location.rb
229
229
  - lib/anthropic/models/citation_page_location_param.rb
230
+ - lib/anthropic/models/citation_search_result_location_param.rb
230
231
  - lib/anthropic/models/citation_web_search_result_location_param.rb
231
232
  - lib/anthropic/models/citations_config_param.rb
232
233
  - lib/anthropic/models/citations_delta.rb
234
+ - lib/anthropic/models/citations_search_result_location.rb
233
235
  - lib/anthropic/models/citations_web_search_result_location.rb
234
236
  - lib/anthropic/models/completion.rb
235
237
  - lib/anthropic/models/completion_create_params.rb
@@ -286,6 +288,7 @@ files:
286
288
  - lib/anthropic/models/raw_message_stream_event.rb
287
289
  - lib/anthropic/models/redacted_thinking_block.rb
288
290
  - lib/anthropic/models/redacted_thinking_block_param.rb
291
+ - lib/anthropic/models/search_result_block_param.rb
289
292
  - lib/anthropic/models/server_tool_usage.rb
290
293
  - lib/anthropic/models/server_tool_use_block.rb
291
294
  - lib/anthropic/models/server_tool_use_block_param.rb
@@ -532,9 +535,11 @@ files:
532
535
  - rbi/anthropic/models/citation_content_block_location_param.rbi
533
536
  - rbi/anthropic/models/citation_page_location.rbi
534
537
  - rbi/anthropic/models/citation_page_location_param.rbi
538
+ - rbi/anthropic/models/citation_search_result_location_param.rbi
535
539
  - rbi/anthropic/models/citation_web_search_result_location_param.rbi
536
540
  - rbi/anthropic/models/citations_config_param.rbi
537
541
  - rbi/anthropic/models/citations_delta.rbi
542
+ - rbi/anthropic/models/citations_search_result_location.rbi
538
543
  - rbi/anthropic/models/citations_web_search_result_location.rbi
539
544
  - rbi/anthropic/models/completion.rbi
540
545
  - rbi/anthropic/models/completion_create_params.rbi
@@ -591,6 +596,7 @@ files:
591
596
  - rbi/anthropic/models/raw_message_stream_event.rbi
592
597
  - rbi/anthropic/models/redacted_thinking_block.rbi
593
598
  - rbi/anthropic/models/redacted_thinking_block_param.rbi
599
+ - rbi/anthropic/models/search_result_block_param.rbi
594
600
  - rbi/anthropic/models/server_tool_usage.rbi
595
601
  - rbi/anthropic/models/server_tool_use_block.rbi
596
602
  - rbi/anthropic/models/server_tool_use_block_param.rbi
@@ -836,9 +842,11 @@ files:
836
842
  - sig/anthropic/models/citation_content_block_location_param.rbs
837
843
  - sig/anthropic/models/citation_page_location.rbs
838
844
  - sig/anthropic/models/citation_page_location_param.rbs
845
+ - sig/anthropic/models/citation_search_result_location_param.rbs
839
846
  - sig/anthropic/models/citation_web_search_result_location_param.rbs
840
847
  - sig/anthropic/models/citations_config_param.rbs
841
848
  - sig/anthropic/models/citations_delta.rbs
849
+ - sig/anthropic/models/citations_search_result_location.rbs
842
850
  - sig/anthropic/models/citations_web_search_result_location.rbs
843
851
  - sig/anthropic/models/completion.rbs
844
852
  - sig/anthropic/models/completion_create_params.rbs
@@ -895,6 +903,7 @@ files:
895
903
  - sig/anthropic/models/raw_message_stream_event.rbs
896
904
  - sig/anthropic/models/redacted_thinking_block.rbs
897
905
  - sig/anthropic/models/redacted_thinking_block_param.rbs
906
+ - sig/anthropic/models/search_result_block_param.rbs
898
907
  - sig/anthropic/models/server_tool_usage.rbs
899
908
  - sig/anthropic/models/server_tool_use_block.rbs
900
909
  - sig/anthropic/models/server_tool_use_block_param.rbs