anthropic 1.8.0 → 1.9.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 (82) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +14 -0
  3. data/README.md +1 -1
  4. data/lib/anthropic/internal/util.rb +1 -1
  5. data/lib/anthropic/models/beta/beta_citation_config.rb +19 -0
  6. data/lib/anthropic/models/beta/beta_content_block.rb +3 -1
  7. data/lib/anthropic/models/beta/beta_content_block_param.rb +3 -1
  8. data/lib/anthropic/models/beta/beta_document_block.rb +56 -0
  9. data/lib/anthropic/models/beta/beta_message.rb +2 -2
  10. data/lib/anthropic/models/beta/beta_message_param.rb +3 -3
  11. data/lib/anthropic/models/beta/beta_raw_content_block_start_event.rb +5 -3
  12. data/lib/anthropic/models/beta/beta_request_document_block.rb +2 -2
  13. data/lib/anthropic/models/beta/beta_server_tool_usage.rb +9 -1
  14. data/lib/anthropic/models/beta/beta_server_tool_use_block.rb +1 -0
  15. data/lib/anthropic/models/beta/beta_server_tool_use_block_param.rb +1 -0
  16. data/lib/anthropic/models/beta/beta_tool_result_block_param.rb +6 -4
  17. data/lib/anthropic/models/beta/beta_tool_union.rb +3 -1
  18. data/lib/anthropic/models/beta/beta_web_fetch_block.rb +42 -0
  19. data/lib/anthropic/models/beta/beta_web_fetch_block_param.rb +42 -0
  20. data/lib/anthropic/models/beta/beta_web_fetch_tool_20250910.rb +82 -0
  21. data/lib/anthropic/models/beta/beta_web_fetch_tool_result_block.rb +43 -0
  22. data/lib/anthropic/models/beta/beta_web_fetch_tool_result_block_param.rb +53 -0
  23. data/lib/anthropic/models/beta/beta_web_fetch_tool_result_error_block.rb +25 -0
  24. data/lib/anthropic/models/beta/beta_web_fetch_tool_result_error_block_param.rb +25 -0
  25. data/lib/anthropic/models/beta/beta_web_fetch_tool_result_error_code.rb +25 -0
  26. data/lib/anthropic/models/beta/message_count_tokens_params.rb +5 -3
  27. data/lib/anthropic/models/beta/message_create_params.rb +2 -2
  28. data/lib/anthropic/models/beta/messages/batch_create_params.rb +2 -2
  29. data/lib/anthropic/models/document_block_param.rb +2 -2
  30. data/lib/anthropic/models/tool_result_block_param.rb +6 -4
  31. data/lib/anthropic/resources/beta/messages.rb +3 -3
  32. data/lib/anthropic/version.rb +1 -1
  33. data/lib/anthropic.rb +10 -0
  34. data/rbi/anthropic/models/beta/beta_citation_config.rbi +30 -0
  35. data/rbi/anthropic/models/beta/beta_content_block.rbi +1 -0
  36. data/rbi/anthropic/models/beta/beta_content_block_param.rbi +1 -0
  37. data/rbi/anthropic/models/beta/beta_document_block.rbi +95 -0
  38. data/rbi/anthropic/models/beta/beta_message.rbi +1 -0
  39. data/rbi/anthropic/models/beta/beta_raw_content_block_start_event.rbi +2 -0
  40. data/rbi/anthropic/models/beta/beta_request_document_block.rbi +5 -3
  41. data/rbi/anthropic/models/beta/beta_server_tool_usage.rbi +17 -2
  42. data/rbi/anthropic/models/beta/beta_server_tool_use_block.rbi +5 -0
  43. data/rbi/anthropic/models/beta/beta_server_tool_use_block_param.rbi +5 -0
  44. data/rbi/anthropic/models/beta/beta_tool_result_block_param.rbi +2 -1
  45. data/rbi/anthropic/models/beta/beta_tool_union.rbi +2 -1
  46. data/rbi/anthropic/models/beta/beta_web_fetch_block.rbi +67 -0
  47. data/rbi/anthropic/models/beta/beta_web_fetch_block_param.rbi +71 -0
  48. data/rbi/anthropic/models/beta/beta_web_fetch_tool_20250910.rbi +125 -0
  49. data/rbi/anthropic/models/beta/beta_web_fetch_tool_result_block.rbi +81 -0
  50. data/rbi/anthropic/models/beta/beta_web_fetch_tool_result_block_param.rbi +109 -0
  51. data/rbi/anthropic/models/beta/beta_web_fetch_tool_result_error_block.rbi +51 -0
  52. data/rbi/anthropic/models/beta/beta_web_fetch_tool_result_error_block_param.rbi +50 -0
  53. data/rbi/anthropic/models/beta/beta_web_fetch_tool_result_error_code.rbi +70 -0
  54. data/rbi/anthropic/models/beta/message_count_tokens_params.rbi +10 -5
  55. data/rbi/anthropic/models/beta/message_create_params.rbi +8 -4
  56. data/rbi/anthropic/models/beta/messages/batch_create_params.rbi +8 -4
  57. data/rbi/anthropic/models/document_block_param.rbi +7 -3
  58. data/rbi/anthropic/models/tool_result_block_param.rbi +2 -1
  59. data/rbi/anthropic/resources/beta/messages.rbi +6 -3
  60. data/sig/anthropic/models/beta/beta_citation_config.rbs +17 -0
  61. data/sig/anthropic/models/beta/beta_content_block.rbs +1 -0
  62. data/sig/anthropic/models/beta/beta_content_block_param.rbs +1 -0
  63. data/sig/anthropic/models/beta/beta_document_block.rbs +49 -0
  64. data/sig/anthropic/models/beta/beta_raw_content_block_start_event.rbs +1 -0
  65. data/sig/anthropic/models/beta/beta_request_document_block.rbs +4 -8
  66. data/sig/anthropic/models/beta/beta_server_tool_usage.rbs +12 -3
  67. data/sig/anthropic/models/beta/beta_server_tool_use_block.rbs +2 -0
  68. data/sig/anthropic/models/beta/beta_server_tool_use_block_param.rbs +2 -0
  69. data/sig/anthropic/models/beta/beta_tool_result_block_param.rbs +1 -0
  70. data/sig/anthropic/models/beta/beta_tool_union.rbs +1 -0
  71. data/sig/anthropic/models/beta/beta_web_fetch_block.rbs +39 -0
  72. data/sig/anthropic/models/beta/beta_web_fetch_block_param.rbs +39 -0
  73. data/sig/anthropic/models/beta/beta_web_fetch_tool_20250910.rbs +59 -0
  74. data/sig/anthropic/models/beta/beta_web_fetch_tool_result_block.rbs +44 -0
  75. data/sig/anthropic/models/beta/beta_web_fetch_tool_result_block_param.rbs +49 -0
  76. data/sig/anthropic/models/beta/beta_web_fetch_tool_result_error_block.rbs +29 -0
  77. data/sig/anthropic/models/beta/beta_web_fetch_tool_result_error_block_param.rbs +29 -0
  78. data/sig/anthropic/models/beta/beta_web_fetch_tool_result_error_code.rbs +32 -0
  79. data/sig/anthropic/models/beta/message_count_tokens_params.rbs +1 -0
  80. data/sig/anthropic/models/document_block_param.rbs +4 -8
  81. data/sig/anthropic/models/tool_result_block_param.rbs +1 -0
  82. metadata +32 -2
@@ -37,7 +37,11 @@ module Anthropic
37
37
  sig { returns(T.nilable(Anthropic::CitationsConfigParam)) }
38
38
  attr_reader :citations
39
39
 
40
- sig { params(citations: Anthropic::CitationsConfigParam::OrHash).void }
40
+ sig do
41
+ params(
42
+ citations: T.nilable(Anthropic::CitationsConfigParam::OrHash)
43
+ ).void
44
+ end
41
45
  attr_writer :citations
42
46
 
43
47
  sig { returns(T.nilable(String)) }
@@ -56,7 +60,7 @@ module Anthropic
56
60
  Anthropic::URLPDFSource::OrHash
57
61
  ),
58
62
  cache_control: T.nilable(Anthropic::CacheControlEphemeral::OrHash),
59
- citations: Anthropic::CitationsConfigParam::OrHash,
63
+ citations: T.nilable(Anthropic::CitationsConfigParam::OrHash),
60
64
  context: T.nilable(String),
61
65
  title: T.nilable(String),
62
66
  type: Symbol
@@ -85,7 +89,7 @@ module Anthropic
85
89
  ),
86
90
  type: Symbol,
87
91
  cache_control: T.nilable(Anthropic::CacheControlEphemeral),
88
- citations: Anthropic::CitationsConfigParam,
92
+ citations: T.nilable(Anthropic::CitationsConfigParam),
89
93
  context: T.nilable(String),
90
94
  title: T.nilable(String)
91
95
  }
@@ -95,7 +95,8 @@ module Anthropic
95
95
  T.any(
96
96
  Anthropic::TextBlockParam,
97
97
  Anthropic::ImageBlockParam,
98
- Anthropic::SearchResultBlockParam
98
+ Anthropic::SearchResultBlockParam,
99
+ Anthropic::DocumentBlockParam
99
100
  )
100
101
  end
101
102
 
@@ -58,7 +58,8 @@ module Anthropic
58
58
  Anthropic::Beta::BetaToolTextEditor20250124::OrHash,
59
59
  Anthropic::Beta::BetaToolTextEditor20250429::OrHash,
60
60
  Anthropic::Beta::BetaToolTextEditor20250728::OrHash,
61
- Anthropic::Beta::BetaWebSearchTool20250305::OrHash
61
+ Anthropic::Beta::BetaWebSearchTool20250305::OrHash,
62
+ Anthropic::Beta::BetaWebFetchTool20250910::OrHash
62
63
  )
63
64
  ],
64
65
  top_k: Integer,
@@ -351,7 +352,8 @@ module Anthropic
351
352
  Anthropic::Beta::BetaToolTextEditor20250124::OrHash,
352
353
  Anthropic::Beta::BetaToolTextEditor20250429::OrHash,
353
354
  Anthropic::Beta::BetaToolTextEditor20250728::OrHash,
354
- Anthropic::Beta::BetaWebSearchTool20250305::OrHash
355
+ Anthropic::Beta::BetaWebSearchTool20250305::OrHash,
356
+ Anthropic::Beta::BetaWebFetchTool20250910::OrHash
355
357
  )
356
358
  ],
357
359
  top_k: Integer,
@@ -640,7 +642,8 @@ module Anthropic
640
642
  Anthropic::Beta::BetaToolTextEditor20250124::OrHash,
641
643
  Anthropic::Beta::BetaToolTextEditor20250429::OrHash,
642
644
  Anthropic::Beta::BetaToolTextEditor20250728::OrHash,
643
- Anthropic::Beta::BetaWebSearchTool20250305::OrHash
645
+ Anthropic::Beta::BetaWebSearchTool20250305::OrHash,
646
+ Anthropic::Beta::BetaWebFetchTool20250910::OrHash
644
647
  )
645
648
  ],
646
649
  betas: T::Array[T.any(String, Anthropic::AnthropicBeta::OrSymbol)],
@@ -0,0 +1,17 @@
1
+ module Anthropic
2
+ module Models
3
+ class BetaCitationConfig = Beta::BetaCitationConfig
4
+
5
+ module Beta
6
+ type beta_citation_config = { enabled: bool }
7
+
8
+ class BetaCitationConfig < Anthropic::Internal::Type::BaseModel
9
+ attr_accessor enabled: bool
10
+
11
+ def initialize: (enabled: bool) -> void
12
+
13
+ def to_hash: -> { enabled: bool }
14
+ end
15
+ end
16
+ end
17
+ end
@@ -10,6 +10,7 @@ module Anthropic
10
10
  | Anthropic::Beta::BetaToolUseBlock
11
11
  | Anthropic::Beta::BetaServerToolUseBlock
12
12
  | Anthropic::Beta::BetaWebSearchToolResultBlock
13
+ | Anthropic::Beta::BetaWebFetchToolResultBlock
13
14
  | Anthropic::Beta::BetaCodeExecutionToolResultBlock
14
15
  | Anthropic::Beta::BetaBashCodeExecutionToolResultBlock
15
16
  | Anthropic::Beta::BetaTextEditorCodeExecutionToolResultBlock
@@ -14,6 +14,7 @@ module Anthropic
14
14
  | Anthropic::Beta::BetaToolResultBlockParam
15
15
  | Anthropic::Beta::BetaServerToolUseBlockParam
16
16
  | Anthropic::Beta::BetaWebSearchToolResultBlockParam
17
+ | Anthropic::Beta::BetaWebFetchToolResultBlockParam
17
18
  | Anthropic::Beta::BetaCodeExecutionToolResultBlockParam
18
19
  | Anthropic::Beta::BetaBashCodeExecutionToolResultBlockParam
19
20
  | Anthropic::Beta::BetaTextEditorCodeExecutionToolResultBlockParam
@@ -0,0 +1,49 @@
1
+ module Anthropic
2
+ module Models
3
+ class BetaDocumentBlock = Beta::BetaDocumentBlock
4
+
5
+ module Beta
6
+ type beta_document_block =
7
+ {
8
+ citations: Anthropic::Beta::BetaCitationConfig?,
9
+ source: Anthropic::Models::Beta::BetaDocumentBlock::source,
10
+ title: String?,
11
+ type: :document
12
+ }
13
+
14
+ class BetaDocumentBlock < Anthropic::Internal::Type::BaseModel
15
+ attr_accessor citations: Anthropic::Beta::BetaCitationConfig?
16
+
17
+ attr_accessor source: Anthropic::Models::Beta::BetaDocumentBlock::source
18
+
19
+ attr_accessor title: String?
20
+
21
+ attr_accessor type: :document
22
+
23
+ def initialize: (
24
+ citations: Anthropic::Beta::BetaCitationConfig?,
25
+ source: Anthropic::Models::Beta::BetaDocumentBlock::source,
26
+ title: String?,
27
+ ?type: :document
28
+ ) -> void
29
+
30
+ def to_hash: -> {
31
+ citations: Anthropic::Beta::BetaCitationConfig?,
32
+ source: Anthropic::Models::Beta::BetaDocumentBlock::source,
33
+ title: String?,
34
+ type: :document
35
+ }
36
+
37
+ type source =
38
+ Anthropic::Beta::BetaBase64PDFSource
39
+ | Anthropic::Beta::BetaPlainTextSource
40
+
41
+ module Source
42
+ extend Anthropic::Internal::Type::Union
43
+
44
+ def self?.variants: -> ::Array[Anthropic::Models::Beta::BetaDocumentBlock::source]
45
+ end
46
+ end
47
+ end
48
+ end
49
+ end
@@ -36,6 +36,7 @@ module Anthropic
36
36
  | Anthropic::Beta::BetaToolUseBlock
37
37
  | Anthropic::Beta::BetaServerToolUseBlock
38
38
  | Anthropic::Beta::BetaWebSearchToolResultBlock
39
+ | Anthropic::Beta::BetaWebFetchToolResultBlock
39
40
  | Anthropic::Beta::BetaCodeExecutionToolResultBlock
40
41
  | Anthropic::Beta::BetaBashCodeExecutionToolResultBlock
41
42
  | Anthropic::Beta::BetaTextEditorCodeExecutionToolResultBlock
@@ -8,7 +8,7 @@ module Anthropic
8
8
  source: Anthropic::Models::Beta::BetaRequestDocumentBlock::source,
9
9
  type: :document,
10
10
  cache_control: Anthropic::Beta::BetaCacheControlEphemeral?,
11
- citations: Anthropic::Beta::BetaCitationsConfigParam,
11
+ citations: Anthropic::Beta::BetaCitationsConfigParam?,
12
12
  context: String?,
13
13
  title: String?
14
14
  }
@@ -20,11 +20,7 @@ module Anthropic
20
20
 
21
21
  attr_accessor cache_control: Anthropic::Beta::BetaCacheControlEphemeral?
22
22
 
23
- attr_reader citations: Anthropic::Beta::BetaCitationsConfigParam?
24
-
25
- def citations=: (
26
- Anthropic::Beta::BetaCitationsConfigParam
27
- ) -> Anthropic::Beta::BetaCitationsConfigParam
23
+ attr_accessor citations: Anthropic::Beta::BetaCitationsConfigParam?
28
24
 
29
25
  attr_accessor context: String?
30
26
 
@@ -33,7 +29,7 @@ module Anthropic
33
29
  def initialize: (
34
30
  source: Anthropic::Models::Beta::BetaRequestDocumentBlock::source,
35
31
  ?cache_control: Anthropic::Beta::BetaCacheControlEphemeral?,
36
- ?citations: Anthropic::Beta::BetaCitationsConfigParam,
32
+ ?citations: Anthropic::Beta::BetaCitationsConfigParam?,
37
33
  ?context: String?,
38
34
  ?title: String?,
39
35
  ?type: :document
@@ -43,7 +39,7 @@ module Anthropic
43
39
  source: Anthropic::Models::Beta::BetaRequestDocumentBlock::source,
44
40
  type: :document,
45
41
  cache_control: Anthropic::Beta::BetaCacheControlEphemeral?,
46
- citations: Anthropic::Beta::BetaCitationsConfigParam,
42
+ citations: Anthropic::Beta::BetaCitationsConfigParam?,
47
43
  context: String?,
48
44
  title: String?
49
45
  }
@@ -3,14 +3,23 @@ module Anthropic
3
3
  class BetaServerToolUsage = Beta::BetaServerToolUsage
4
4
 
5
5
  module Beta
6
- type beta_server_tool_usage = { web_search_requests: Integer }
6
+ type beta_server_tool_usage =
7
+ { web_fetch_requests: Integer, web_search_requests: Integer }
7
8
 
8
9
  class BetaServerToolUsage < Anthropic::Internal::Type::BaseModel
10
+ attr_accessor web_fetch_requests: Integer
11
+
9
12
  attr_accessor web_search_requests: Integer
10
13
 
11
- def initialize: (web_search_requests: Integer) -> void
14
+ def initialize: (
15
+ web_fetch_requests: Integer,
16
+ web_search_requests: Integer
17
+ ) -> void
12
18
 
13
- def to_hash: -> { web_search_requests: Integer }
19
+ def to_hash: -> {
20
+ web_fetch_requests: Integer,
21
+ web_search_requests: Integer
22
+ }
14
23
  end
15
24
  end
16
25
  end
@@ -36,6 +36,7 @@ module Anthropic
36
36
 
37
37
  type name_ =
38
38
  :web_search
39
+ | :web_fetch
39
40
  | :code_execution
40
41
  | :bash_code_execution
41
42
  | :text_editor_code_execution
@@ -44,6 +45,7 @@ module Anthropic
44
45
  extend Anthropic::Internal::Type::Enum
45
46
 
46
47
  WEB_SEARCH: :web_search
48
+ WEB_FETCH: :web_fetch
47
49
  CODE_EXECUTION: :code_execution
48
50
  BASH_CODE_EXECUTION: :bash_code_execution
49
51
  TEXT_EDITOR_CODE_EXECUTION: :text_editor_code_execution
@@ -41,6 +41,7 @@ module Anthropic
41
41
 
42
42
  type name_ =
43
43
  :web_search
44
+ | :web_fetch
44
45
  | :code_execution
45
46
  | :bash_code_execution
46
47
  | :text_editor_code_execution
@@ -49,6 +50,7 @@ module Anthropic
49
50
  extend Anthropic::Internal::Type::Enum
50
51
 
51
52
  WEB_SEARCH: :web_search
53
+ WEB_FETCH: :web_fetch
52
54
  CODE_EXECUTION: :code_execution
53
55
  BASH_CODE_EXECUTION: :bash_code_execution
54
56
  TEXT_EDITOR_CODE_EXECUTION: :text_editor_code_execution
@@ -56,6 +56,7 @@ module Anthropic
56
56
  Anthropic::Beta::BetaTextBlockParam
57
57
  | Anthropic::Beta::BetaImageBlockParam
58
58
  | Anthropic::Beta::BetaSearchResultBlockParam
59
+ | Anthropic::Beta::BetaRequestDocumentBlock
59
60
 
60
61
  module Content
61
62
  extend Anthropic::Internal::Type::Union
@@ -16,6 +16,7 @@ module Anthropic
16
16
  | Anthropic::Beta::BetaToolTextEditor20250429
17
17
  | Anthropic::Beta::BetaToolTextEditor20250728
18
18
  | Anthropic::Beta::BetaWebSearchTool20250305
19
+ | Anthropic::Beta::BetaWebFetchTool20250910
19
20
 
20
21
  module BetaToolUnion
21
22
  extend Anthropic::Internal::Type::Union
@@ -0,0 +1,39 @@
1
+ module Anthropic
2
+ module Models
3
+ class BetaWebFetchBlock = Beta::BetaWebFetchBlock
4
+
5
+ module Beta
6
+ type beta_web_fetch_block =
7
+ {
8
+ content: Anthropic::Beta::BetaDocumentBlock,
9
+ retrieved_at: String?,
10
+ type: :web_fetch_result,
11
+ url: String
12
+ }
13
+
14
+ class BetaWebFetchBlock < Anthropic::Internal::Type::BaseModel
15
+ attr_accessor content: Anthropic::Beta::BetaDocumentBlock
16
+
17
+ attr_accessor retrieved_at: String?
18
+
19
+ attr_accessor type: :web_fetch_result
20
+
21
+ attr_accessor url: String
22
+
23
+ def initialize: (
24
+ content: Anthropic::Beta::BetaDocumentBlock,
25
+ retrieved_at: String?,
26
+ url: String,
27
+ ?type: :web_fetch_result
28
+ ) -> void
29
+
30
+ def to_hash: -> {
31
+ content: Anthropic::Beta::BetaDocumentBlock,
32
+ retrieved_at: String?,
33
+ type: :web_fetch_result,
34
+ url: String
35
+ }
36
+ end
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,39 @@
1
+ module Anthropic
2
+ module Models
3
+ class BetaWebFetchBlockParam = Beta::BetaWebFetchBlockParam
4
+
5
+ module Beta
6
+ type beta_web_fetch_block_param =
7
+ {
8
+ content: Anthropic::Beta::BetaRequestDocumentBlock,
9
+ type: :web_fetch_result,
10
+ url: String,
11
+ retrieved_at: String?
12
+ }
13
+
14
+ class BetaWebFetchBlockParam < Anthropic::Internal::Type::BaseModel
15
+ attr_accessor content: Anthropic::Beta::BetaRequestDocumentBlock
16
+
17
+ attr_accessor type: :web_fetch_result
18
+
19
+ attr_accessor url: String
20
+
21
+ attr_accessor retrieved_at: String?
22
+
23
+ def initialize: (
24
+ content: Anthropic::Beta::BetaRequestDocumentBlock,
25
+ url: String,
26
+ ?retrieved_at: String?,
27
+ ?type: :web_fetch_result
28
+ ) -> void
29
+
30
+ def to_hash: -> {
31
+ content: Anthropic::Beta::BetaRequestDocumentBlock,
32
+ type: :web_fetch_result,
33
+ url: String,
34
+ retrieved_at: String?
35
+ }
36
+ end
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,59 @@
1
+ module Anthropic
2
+ module Models
3
+ class BetaWebFetchTool20250910 = Beta::BetaWebFetchTool20250910
4
+
5
+ module Beta
6
+ type beta_web_fetch_tool20250910 =
7
+ {
8
+ name: :web_fetch,
9
+ type: :web_fetch_20250910,
10
+ allowed_domains: ::Array[String]?,
11
+ blocked_domains: ::Array[String]?,
12
+ cache_control: Anthropic::Beta::BetaCacheControlEphemeral?,
13
+ citations: Anthropic::Beta::BetaCitationsConfigParam?,
14
+ max_content_tokens: Integer?,
15
+ max_uses: Integer?
16
+ }
17
+
18
+ class BetaWebFetchTool20250910 < Anthropic::Internal::Type::BaseModel
19
+ attr_accessor name: :web_fetch
20
+
21
+ attr_accessor type: :web_fetch_20250910
22
+
23
+ attr_accessor allowed_domains: ::Array[String]?
24
+
25
+ attr_accessor blocked_domains: ::Array[String]?
26
+
27
+ attr_accessor cache_control: Anthropic::Beta::BetaCacheControlEphemeral?
28
+
29
+ attr_accessor citations: Anthropic::Beta::BetaCitationsConfigParam?
30
+
31
+ attr_accessor max_content_tokens: Integer?
32
+
33
+ attr_accessor max_uses: Integer?
34
+
35
+ def initialize: (
36
+ ?allowed_domains: ::Array[String]?,
37
+ ?blocked_domains: ::Array[String]?,
38
+ ?cache_control: Anthropic::Beta::BetaCacheControlEphemeral?,
39
+ ?citations: Anthropic::Beta::BetaCitationsConfigParam?,
40
+ ?max_content_tokens: Integer?,
41
+ ?max_uses: Integer?,
42
+ ?name: :web_fetch,
43
+ ?type: :web_fetch_20250910
44
+ ) -> void
45
+
46
+ def to_hash: -> {
47
+ name: :web_fetch,
48
+ type: :web_fetch_20250910,
49
+ allowed_domains: ::Array[String]?,
50
+ blocked_domains: ::Array[String]?,
51
+ cache_control: Anthropic::Beta::BetaCacheControlEphemeral?,
52
+ citations: Anthropic::Beta::BetaCitationsConfigParam?,
53
+ max_content_tokens: Integer?,
54
+ max_uses: Integer?
55
+ }
56
+ end
57
+ end
58
+ end
59
+ end
@@ -0,0 +1,44 @@
1
+ module Anthropic
2
+ module Models
3
+ class BetaWebFetchToolResultBlock = Beta::BetaWebFetchToolResultBlock
4
+
5
+ module Beta
6
+ type beta_web_fetch_tool_result_block =
7
+ {
8
+ content: Anthropic::Models::Beta::BetaWebFetchToolResultBlock::content,
9
+ tool_use_id: String,
10
+ type: :web_fetch_tool_result
11
+ }
12
+
13
+ class BetaWebFetchToolResultBlock < Anthropic::Internal::Type::BaseModel
14
+ attr_accessor content: Anthropic::Models::Beta::BetaWebFetchToolResultBlock::content
15
+
16
+ attr_accessor tool_use_id: String
17
+
18
+ attr_accessor type: :web_fetch_tool_result
19
+
20
+ def initialize: (
21
+ content: Anthropic::Models::Beta::BetaWebFetchToolResultBlock::content,
22
+ tool_use_id: String,
23
+ ?type: :web_fetch_tool_result
24
+ ) -> void
25
+
26
+ def to_hash: -> {
27
+ content: Anthropic::Models::Beta::BetaWebFetchToolResultBlock::content,
28
+ tool_use_id: String,
29
+ type: :web_fetch_tool_result
30
+ }
31
+
32
+ type content =
33
+ Anthropic::Beta::BetaWebFetchToolResultErrorBlock
34
+ | Anthropic::Beta::BetaWebFetchBlock
35
+
36
+ module Content
37
+ extend Anthropic::Internal::Type::Union
38
+
39
+ def self?.variants: -> ::Array[Anthropic::Models::Beta::BetaWebFetchToolResultBlock::content]
40
+ end
41
+ end
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,49 @@
1
+ module Anthropic
2
+ module Models
3
+ class BetaWebFetchToolResultBlockParam = Beta::BetaWebFetchToolResultBlockParam
4
+
5
+ module Beta
6
+ type beta_web_fetch_tool_result_block_param =
7
+ {
8
+ content: Anthropic::Models::Beta::BetaWebFetchToolResultBlockParam::content,
9
+ tool_use_id: String,
10
+ type: :web_fetch_tool_result,
11
+ cache_control: Anthropic::Beta::BetaCacheControlEphemeral?
12
+ }
13
+
14
+ class BetaWebFetchToolResultBlockParam < Anthropic::Internal::Type::BaseModel
15
+ attr_accessor content: Anthropic::Models::Beta::BetaWebFetchToolResultBlockParam::content
16
+
17
+ attr_accessor tool_use_id: String
18
+
19
+ attr_accessor type: :web_fetch_tool_result
20
+
21
+ attr_accessor cache_control: Anthropic::Beta::BetaCacheControlEphemeral?
22
+
23
+ def initialize: (
24
+ content: Anthropic::Models::Beta::BetaWebFetchToolResultBlockParam::content,
25
+ tool_use_id: String,
26
+ ?cache_control: Anthropic::Beta::BetaCacheControlEphemeral?,
27
+ ?type: :web_fetch_tool_result
28
+ ) -> void
29
+
30
+ def to_hash: -> {
31
+ content: Anthropic::Models::Beta::BetaWebFetchToolResultBlockParam::content,
32
+ tool_use_id: String,
33
+ type: :web_fetch_tool_result,
34
+ cache_control: Anthropic::Beta::BetaCacheControlEphemeral?
35
+ }
36
+
37
+ type content =
38
+ Anthropic::Beta::BetaWebFetchToolResultErrorBlockParam
39
+ | Anthropic::Beta::BetaWebFetchBlockParam
40
+
41
+ module Content
42
+ extend Anthropic::Internal::Type::Union
43
+
44
+ def self?.variants: -> ::Array[Anthropic::Models::Beta::BetaWebFetchToolResultBlockParam::content]
45
+ end
46
+ end
47
+ end
48
+ end
49
+ end
@@ -0,0 +1,29 @@
1
+ module Anthropic
2
+ module Models
3
+ class BetaWebFetchToolResultErrorBlock = Beta::BetaWebFetchToolResultErrorBlock
4
+
5
+ module Beta
6
+ type beta_web_fetch_tool_result_error_block =
7
+ {
8
+ error_code: Anthropic::Models::Beta::beta_web_fetch_tool_result_error_code,
9
+ type: :web_fetch_tool_result_error
10
+ }
11
+
12
+ class BetaWebFetchToolResultErrorBlock < Anthropic::Internal::Type::BaseModel
13
+ attr_accessor error_code: Anthropic::Models::Beta::beta_web_fetch_tool_result_error_code
14
+
15
+ attr_accessor type: :web_fetch_tool_result_error
16
+
17
+ def initialize: (
18
+ error_code: Anthropic::Models::Beta::beta_web_fetch_tool_result_error_code,
19
+ ?type: :web_fetch_tool_result_error
20
+ ) -> void
21
+
22
+ def to_hash: -> {
23
+ error_code: Anthropic::Models::Beta::beta_web_fetch_tool_result_error_code,
24
+ type: :web_fetch_tool_result_error
25
+ }
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,29 @@
1
+ module Anthropic
2
+ module Models
3
+ class BetaWebFetchToolResultErrorBlockParam = Beta::BetaWebFetchToolResultErrorBlockParam
4
+
5
+ module Beta
6
+ type beta_web_fetch_tool_result_error_block_param =
7
+ {
8
+ error_code: Anthropic::Models::Beta::beta_web_fetch_tool_result_error_code,
9
+ type: :web_fetch_tool_result_error
10
+ }
11
+
12
+ class BetaWebFetchToolResultErrorBlockParam < Anthropic::Internal::Type::BaseModel
13
+ attr_accessor error_code: Anthropic::Models::Beta::beta_web_fetch_tool_result_error_code
14
+
15
+ attr_accessor type: :web_fetch_tool_result_error
16
+
17
+ def initialize: (
18
+ error_code: Anthropic::Models::Beta::beta_web_fetch_tool_result_error_code,
19
+ ?type: :web_fetch_tool_result_error
20
+ ) -> void
21
+
22
+ def to_hash: -> {
23
+ error_code: Anthropic::Models::Beta::beta_web_fetch_tool_result_error_code,
24
+ type: :web_fetch_tool_result_error
25
+ }
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,32 @@
1
+ module Anthropic
2
+ module Models
3
+ module BetaWebFetchToolResultErrorCode = Beta::BetaWebFetchToolResultErrorCode
4
+
5
+ module Beta
6
+ type beta_web_fetch_tool_result_error_code =
7
+ :invalid_tool_input
8
+ | :url_too_long
9
+ | :url_not_allowed
10
+ | :url_not_accessible
11
+ | :unsupported_content_type
12
+ | :too_many_requests
13
+ | :max_uses_exceeded
14
+ | :unavailable
15
+
16
+ module BetaWebFetchToolResultErrorCode
17
+ extend Anthropic::Internal::Type::Enum
18
+
19
+ INVALID_TOOL_INPUT: :invalid_tool_input
20
+ URL_TOO_LONG: :url_too_long
21
+ URL_NOT_ALLOWED: :url_not_allowed
22
+ URL_NOT_ACCESSIBLE: :url_not_accessible
23
+ UNSUPPORTED_CONTENT_TYPE: :unsupported_content_type
24
+ TOO_MANY_REQUESTS: :too_many_requests
25
+ MAX_USES_EXCEEDED: :max_uses_exceeded
26
+ UNAVAILABLE: :unavailable
27
+
28
+ def self?.values: -> ::Array[Anthropic::Models::Beta::beta_web_fetch_tool_result_error_code]
29
+ end
30
+ end
31
+ end
32
+ end
@@ -105,6 +105,7 @@ module Anthropic
105
105
  | Anthropic::Beta::BetaToolTextEditor20250429
106
106
  | Anthropic::Beta::BetaToolTextEditor20250728
107
107
  | Anthropic::Beta::BetaWebSearchTool20250305
108
+ | Anthropic::Beta::BetaWebFetchTool20250910
108
109
 
109
110
  module Tool
110
111
  extend Anthropic::Internal::Type::Union
@@ -5,7 +5,7 @@ module Anthropic
5
5
  source: Anthropic::Models::DocumentBlockParam::source,
6
6
  type: :document,
7
7
  cache_control: Anthropic::CacheControlEphemeral?,
8
- citations: Anthropic::CitationsConfigParam,
8
+ citations: Anthropic::CitationsConfigParam?,
9
9
  context: String?,
10
10
  title: String?
11
11
  }
@@ -17,11 +17,7 @@ module Anthropic
17
17
 
18
18
  attr_accessor cache_control: Anthropic::CacheControlEphemeral?
19
19
 
20
- attr_reader citations: Anthropic::CitationsConfigParam?
21
-
22
- def citations=: (
23
- Anthropic::CitationsConfigParam
24
- ) -> Anthropic::CitationsConfigParam
20
+ attr_accessor citations: Anthropic::CitationsConfigParam?
25
21
 
26
22
  attr_accessor context: String?
27
23
 
@@ -30,7 +26,7 @@ module Anthropic
30
26
  def initialize: (
31
27
  source: Anthropic::Models::DocumentBlockParam::source,
32
28
  ?cache_control: Anthropic::CacheControlEphemeral?,
33
- ?citations: Anthropic::CitationsConfigParam,
29
+ ?citations: Anthropic::CitationsConfigParam?,
34
30
  ?context: String?,
35
31
  ?title: String?,
36
32
  ?type: :document
@@ -40,7 +36,7 @@ module Anthropic
40
36
  source: Anthropic::Models::DocumentBlockParam::source,
41
37
  type: :document,
42
38
  cache_control: Anthropic::CacheControlEphemeral?,
43
- citations: Anthropic::CitationsConfigParam,
39
+ citations: Anthropic::CitationsConfigParam?,
44
40
  context: String?,
45
41
  title: String?
46
42
  }
@@ -53,6 +53,7 @@ module Anthropic
53
53
  Anthropic::TextBlockParam
54
54
  | Anthropic::ImageBlockParam
55
55
  | Anthropic::SearchResultBlockParam
56
+ | Anthropic::DocumentBlockParam
56
57
 
57
58
  module Content
58
59
  extend Anthropic::Internal::Type::Union