anthropic 1.4.1 → 1.5.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +13 -0
- data/README.md +1 -1
- data/lib/anthropic/helpers/bedrock/client.rb +55 -2
- data/lib/anthropic/internal/transport/base_client.rb +1 -1
- data/lib/anthropic/models/citation_search_result_location_param.rb +51 -0
- data/lib/anthropic/models/citations_delta.rb +5 -3
- data/lib/anthropic/models/citations_search_result_location.rb +51 -0
- data/lib/anthropic/models/content_block_param.rb +4 -1
- data/lib/anthropic/models/message_param.rb +3 -3
- data/lib/anthropic/models/search_result_block_param.rb +51 -0
- data/lib/anthropic/models/text_block.rb +2 -2
- data/lib/anthropic/models/text_block_param.rb +2 -2
- data/lib/anthropic/models/text_citation.rb +3 -1
- data/lib/anthropic/models/text_citation_param.rb +3 -1
- data/lib/anthropic/models/tool_result_block_param.rb +6 -4
- data/lib/anthropic/models.rb +6 -0
- data/lib/anthropic/version.rb +1 -1
- data/lib/anthropic.rb +3 -0
- data/rbi/anthropic/models/citation_search_result_location_param.rbi +74 -0
- data/rbi/anthropic/models/citations_delta.rbi +4 -2
- data/rbi/anthropic/models/citations_search_result_location.rbi +74 -0
- data/rbi/anthropic/models/content_block_param.rbi +1 -0
- data/rbi/anthropic/models/search_result_block_param.rbi +77 -0
- data/rbi/anthropic/models/text_block.rbi +2 -1
- data/rbi/anthropic/models/text_block_param.rbi +6 -3
- data/rbi/anthropic/models/text_citation.rbi +2 -1
- data/rbi/anthropic/models/text_citation_param.rbi +2 -1
- data/rbi/anthropic/models/tool_result_block_param.rbi +5 -1
- data/rbi/anthropic/models.rbi +8 -0
- data/sig/anthropic/models/citation_search_result_location_param.rbs +50 -0
- data/sig/anthropic/models/citations_delta.rbs +1 -0
- data/sig/anthropic/models/citations_search_result_location.rbs +50 -0
- data/sig/anthropic/models/content_block_param.rbs +1 -0
- data/sig/anthropic/models/search_result_block_param.rbs +49 -0
- data/sig/anthropic/models/text_citation.rbs +1 -0
- data/sig/anthropic/models/text_citation_param.rbs +1 -0
- data/sig/anthropic/models/tool_result_block_param.rbs +4 -1
- data/sig/anthropic/models.rbs +6 -0
- metadata +11 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f7ddefa0c24bda53c10f5055a874b0aad2ad1be2d469a6c6dfb5d22f82e81c30
|
4
|
+
data.tar.gz: 1cd0165a763474dd156fe6c7d039d36119756b40e1117aae949df45740b9b5b3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 31550e3c9ed2cdd5231a04b3025964c8771cf97804723ee04f797d4ac89cf3eaa875edde85d5c4ca182b548b4cdd6ce76a01cef3b3be7d0aa04b9802981c8386
|
7
|
+
data.tar.gz: 48d79952e98815c703d605653b70706e9de2286f44da9c47a01b13e3fbca1da5876f4f8ccb2cc51dd4a4f4ee7576fe0df994e9d3cbeb29406fc186e96371a681
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,18 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 1.5.0 (2025-08-08)
|
4
|
+
|
5
|
+
Full Changelog: [v1.4.1...v1.5.0](https://github.com/anthropics/anthropic-sdk-ruby/compare/v1.4.1...v1.5.0)
|
6
|
+
|
7
|
+
### Features
|
8
|
+
|
9
|
+
* **api:** search result content blocks ([9a94866](https://github.com/anthropics/anthropic-sdk-ruby/commit/9a9486664e10ce0d02967ab1d5360357ffb72a66))
|
10
|
+
|
11
|
+
|
12
|
+
### Bug Fixes
|
13
|
+
|
14
|
+
* aws bedrock base url ([#673](https://github.com/anthropics/anthropic-sdk-ruby/issues/673)) ([b2996b9](https://github.com/anthropics/anthropic-sdk-ruby/commit/b2996b9349b047c53232ecd63823110ad90c71c3))
|
15
|
+
|
3
16
|
## 1.4.1 (2025-08-07)
|
4
17
|
|
5
18
|
Full Changelog: [v1.4.0...v1.4.1](https://github.com/anthropics/anthropic-sdk-ruby/compare/v1.4.0...v1.4.1)
|
data/README.md
CHANGED
@@ -111,6 +111,60 @@ module Anthropic
|
|
111
111
|
@beta = Anthropic::Resources::Beta.new(client: self)
|
112
112
|
end
|
113
113
|
|
114
|
+
# @api private
|
115
|
+
#
|
116
|
+
# @param req [Hash{Symbol=>Object}] .
|
117
|
+
#
|
118
|
+
# @option req [Symbol] :method
|
119
|
+
#
|
120
|
+
# @option req [String, Array<String>] :path
|
121
|
+
#
|
122
|
+
# @option req [Hash{String=>Array<String>, String, nil}, nil] :query
|
123
|
+
#
|
124
|
+
# @option req [Hash{String=>String, Integer, Array<String, Integer, nil>, nil}, nil] :headers
|
125
|
+
#
|
126
|
+
# @option req [Object, nil] :body
|
127
|
+
#
|
128
|
+
# @option req [Symbol, Integer, Array<Symbol, Integer>, Proc, nil] :unwrap
|
129
|
+
#
|
130
|
+
# @option req [Class<Anthropic::Internal::Type::BasePage>, nil] :page
|
131
|
+
#
|
132
|
+
# @option req [Class<Anthropic::Internal::Type::BaseStream>, nil] :stream
|
133
|
+
#
|
134
|
+
# @option req [Anthropic::Internal::Type::Converter, Class, nil] :model
|
135
|
+
#
|
136
|
+
# @param opts [Hash{Symbol=>Object}] .
|
137
|
+
#
|
138
|
+
# @option opts [String, nil] :idempotency_key
|
139
|
+
#
|
140
|
+
# @option opts [Hash{String=>Array<String>, String, nil}, nil] :extra_query
|
141
|
+
#
|
142
|
+
# @option opts [Hash{String=>String, nil}, nil] :extra_headers
|
143
|
+
#
|
144
|
+
# @option opts [Object, nil] :extra_body
|
145
|
+
#
|
146
|
+
# @option opts [Integer, nil] :max_retries
|
147
|
+
#
|
148
|
+
# @option opts [Float, nil] :timeout
|
149
|
+
#
|
150
|
+
# @return [Hash{Symbol=>Object}]
|
151
|
+
private def build_request(req, opts)
|
152
|
+
fit_req_to_bedrock_specs!(req)
|
153
|
+
|
154
|
+
request_input = super
|
155
|
+
|
156
|
+
signed_request = @signer.sign_request(
|
157
|
+
http_method: request_input[:method],
|
158
|
+
url: request_input[:url],
|
159
|
+
headers: request_input[:headers],
|
160
|
+
body: request_input[:body]
|
161
|
+
)
|
162
|
+
|
163
|
+
request_input[:headers].merge!(signed_request.headers)
|
164
|
+
|
165
|
+
request_input
|
166
|
+
end
|
167
|
+
|
114
168
|
# @api private
|
115
169
|
#
|
116
170
|
# Very private API, do not use
|
@@ -126,8 +180,7 @@ module Anthropic
|
|
126
180
|
# @option request [Object] :body
|
127
181
|
#
|
128
182
|
# @return [Hash{Symbol, Object}]
|
129
|
-
|
130
|
-
fit_req_to_bedrock_specs!(request)
|
183
|
+
private def transform_request(request)
|
131
184
|
sliced = super.slice(
|
132
185
|
:method,
|
133
186
|
:url,
|
@@ -0,0 +1,51 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Anthropic
|
4
|
+
module Models
|
5
|
+
class CitationSearchResultLocationParam < Anthropic::Internal::Type::BaseModel
|
6
|
+
# @!attribute cited_text
|
7
|
+
#
|
8
|
+
# @return [String]
|
9
|
+
required :cited_text, String
|
10
|
+
|
11
|
+
# @!attribute end_block_index
|
12
|
+
#
|
13
|
+
# @return [Integer]
|
14
|
+
required :end_block_index, Integer
|
15
|
+
|
16
|
+
# @!attribute search_result_index
|
17
|
+
#
|
18
|
+
# @return [Integer]
|
19
|
+
required :search_result_index, Integer
|
20
|
+
|
21
|
+
# @!attribute source
|
22
|
+
#
|
23
|
+
# @return [String]
|
24
|
+
required :source, String
|
25
|
+
|
26
|
+
# @!attribute start_block_index
|
27
|
+
#
|
28
|
+
# @return [Integer]
|
29
|
+
required :start_block_index, Integer
|
30
|
+
|
31
|
+
# @!attribute title
|
32
|
+
#
|
33
|
+
# @return [String, nil]
|
34
|
+
required :title, String, nil?: true
|
35
|
+
|
36
|
+
# @!attribute type
|
37
|
+
#
|
38
|
+
# @return [Symbol, :search_result_location]
|
39
|
+
required :type, const: :search_result_location
|
40
|
+
|
41
|
+
# @!method initialize(cited_text:, end_block_index:, search_result_index:, source:, start_block_index:, title:, type: :search_result_location)
|
42
|
+
# @param cited_text [String]
|
43
|
+
# @param end_block_index [Integer]
|
44
|
+
# @param search_result_index [Integer]
|
45
|
+
# @param source [String]
|
46
|
+
# @param start_block_index [Integer]
|
47
|
+
# @param title [String, nil]
|
48
|
+
# @param type [Symbol, :search_result_location]
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -5,7 +5,7 @@ module Anthropic
|
|
5
5
|
class CitationsDelta < Anthropic::Internal::Type::BaseModel
|
6
6
|
# @!attribute citation
|
7
7
|
#
|
8
|
-
# @return [Anthropic::Models::CitationCharLocation, Anthropic::Models::CitationPageLocation, Anthropic::Models::CitationContentBlockLocation, Anthropic::Models::CitationsWebSearchResultLocation]
|
8
|
+
# @return [Anthropic::Models::CitationCharLocation, Anthropic::Models::CitationPageLocation, Anthropic::Models::CitationContentBlockLocation, Anthropic::Models::CitationsWebSearchResultLocation, Anthropic::Models::CitationsSearchResultLocation]
|
9
9
|
required :citation, union: -> { Anthropic::CitationsDelta::Citation }
|
10
10
|
|
11
11
|
# @!attribute type
|
@@ -14,7 +14,7 @@ module Anthropic
|
|
14
14
|
required :type, const: :citations_delta
|
15
15
|
|
16
16
|
# @!method initialize(citation:, type: :citations_delta)
|
17
|
-
# @param citation [Anthropic::Models::CitationCharLocation, Anthropic::Models::CitationPageLocation, Anthropic::Models::CitationContentBlockLocation, Anthropic::Models::CitationsWebSearchResultLocation]
|
17
|
+
# @param citation [Anthropic::Models::CitationCharLocation, Anthropic::Models::CitationPageLocation, Anthropic::Models::CitationContentBlockLocation, Anthropic::Models::CitationsWebSearchResultLocation, Anthropic::Models::CitationsSearchResultLocation]
|
18
18
|
# @param type [Symbol, :citations_delta]
|
19
19
|
|
20
20
|
# @see Anthropic::Models::CitationsDelta#citation
|
@@ -31,8 +31,10 @@ module Anthropic
|
|
31
31
|
|
32
32
|
variant :web_search_result_location, -> { Anthropic::CitationsWebSearchResultLocation }
|
33
33
|
|
34
|
+
variant :search_result_location, -> { Anthropic::CitationsSearchResultLocation }
|
35
|
+
|
34
36
|
# @!method self.variants
|
35
|
-
# @return [Array(Anthropic::Models::CitationCharLocation, Anthropic::Models::CitationPageLocation, Anthropic::Models::CitationContentBlockLocation, Anthropic::Models::CitationsWebSearchResultLocation)]
|
37
|
+
# @return [Array(Anthropic::Models::CitationCharLocation, Anthropic::Models::CitationPageLocation, Anthropic::Models::CitationContentBlockLocation, Anthropic::Models::CitationsWebSearchResultLocation, Anthropic::Models::CitationsSearchResultLocation)]
|
36
38
|
end
|
37
39
|
end
|
38
40
|
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Anthropic
|
4
|
+
module Models
|
5
|
+
class CitationsSearchResultLocation < Anthropic::Internal::Type::BaseModel
|
6
|
+
# @!attribute cited_text
|
7
|
+
#
|
8
|
+
# @return [String]
|
9
|
+
required :cited_text, String
|
10
|
+
|
11
|
+
# @!attribute end_block_index
|
12
|
+
#
|
13
|
+
# @return [Integer]
|
14
|
+
required :end_block_index, Integer
|
15
|
+
|
16
|
+
# @!attribute search_result_index
|
17
|
+
#
|
18
|
+
# @return [Integer]
|
19
|
+
required :search_result_index, Integer
|
20
|
+
|
21
|
+
# @!attribute source
|
22
|
+
#
|
23
|
+
# @return [String]
|
24
|
+
required :source, String
|
25
|
+
|
26
|
+
# @!attribute start_block_index
|
27
|
+
#
|
28
|
+
# @return [Integer]
|
29
|
+
required :start_block_index, Integer
|
30
|
+
|
31
|
+
# @!attribute title
|
32
|
+
#
|
33
|
+
# @return [String, nil]
|
34
|
+
required :title, String, nil?: true
|
35
|
+
|
36
|
+
# @!attribute type
|
37
|
+
#
|
38
|
+
# @return [Symbol, :search_result_location]
|
39
|
+
required :type, const: :search_result_location
|
40
|
+
|
41
|
+
# @!method initialize(cited_text:, end_block_index:, search_result_index:, source:, start_block_index:, title:, type: :search_result_location)
|
42
|
+
# @param cited_text [String]
|
43
|
+
# @param end_block_index [Integer]
|
44
|
+
# @param search_result_index [Integer]
|
45
|
+
# @param source [String]
|
46
|
+
# @param start_block_index [Integer]
|
47
|
+
# @param title [String, nil]
|
48
|
+
# @param type [Symbol, :search_result_location]
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -17,6 +17,9 @@ module Anthropic
|
|
17
17
|
# Document content, either specified directly as base64 data, as text, or as a reference via a URL.
|
18
18
|
variant :document, -> { Anthropic::DocumentBlockParam }
|
19
19
|
|
20
|
+
# A search result block containing source, title, and content from search operations.
|
21
|
+
variant :search_result, -> { Anthropic::SearchResultBlockParam }
|
22
|
+
|
20
23
|
# A block specifying internal thinking by the model.
|
21
24
|
variant :thinking, -> { Anthropic::ThinkingBlockParam }
|
22
25
|
|
@@ -34,7 +37,7 @@ module Anthropic
|
|
34
37
|
variant :web_search_tool_result, -> { Anthropic::WebSearchToolResultBlockParam }
|
35
38
|
|
36
39
|
# @!method self.variants
|
37
|
-
# @return [Array(Anthropic::Models::TextBlockParam, Anthropic::Models::ImageBlockParam, Anthropic::Models::DocumentBlockParam, Anthropic::Models::ThinkingBlockParam, Anthropic::Models::RedactedThinkingBlockParam, Anthropic::Models::ToolUseBlockParam, Anthropic::Models::ToolResultBlockParam, Anthropic::Models::ServerToolUseBlockParam, Anthropic::Models::WebSearchToolResultBlockParam)]
|
40
|
+
# @return [Array(Anthropic::Models::TextBlockParam, Anthropic::Models::ImageBlockParam, Anthropic::Models::DocumentBlockParam, Anthropic::Models::SearchResultBlockParam, Anthropic::Models::ThinkingBlockParam, Anthropic::Models::RedactedThinkingBlockParam, Anthropic::Models::ToolUseBlockParam, Anthropic::Models::ToolResultBlockParam, Anthropic::Models::ServerToolUseBlockParam, Anthropic::Models::WebSearchToolResultBlockParam)]
|
38
41
|
end
|
39
42
|
end
|
40
43
|
end
|
@@ -5,7 +5,7 @@ module Anthropic
|
|
5
5
|
class MessageParam < Anthropic::Internal::Type::BaseModel
|
6
6
|
# @!attribute content
|
7
7
|
#
|
8
|
-
# @return [String, Array<Anthropic::Models::TextBlockParam, Anthropic::Models::ImageBlockParam, Anthropic::Models::DocumentBlockParam, Anthropic::Models::ThinkingBlockParam, Anthropic::Models::RedactedThinkingBlockParam, Anthropic::Models::ToolUseBlockParam, Anthropic::Models::ToolResultBlockParam, Anthropic::Models::ServerToolUseBlockParam, Anthropic::Models::WebSearchToolResultBlockParam>]
|
8
|
+
# @return [String, Array<Anthropic::Models::TextBlockParam, Anthropic::Models::ImageBlockParam, Anthropic::Models::DocumentBlockParam, Anthropic::Models::SearchResultBlockParam, Anthropic::Models::ThinkingBlockParam, Anthropic::Models::RedactedThinkingBlockParam, Anthropic::Models::ToolUseBlockParam, Anthropic::Models::ToolResultBlockParam, Anthropic::Models::ServerToolUseBlockParam, Anthropic::Models::WebSearchToolResultBlockParam>]
|
9
9
|
required :content, union: -> { Anthropic::MessageParam::Content }
|
10
10
|
|
11
11
|
# @!attribute role
|
@@ -14,7 +14,7 @@ module Anthropic
|
|
14
14
|
required :role, enum: -> { Anthropic::MessageParam::Role }
|
15
15
|
|
16
16
|
# @!method initialize(content:, role:)
|
17
|
-
# @param content [String, Array<Anthropic::Models::TextBlockParam, Anthropic::Models::ImageBlockParam, Anthropic::Models::DocumentBlockParam, Anthropic::Models::ThinkingBlockParam, Anthropic::Models::RedactedThinkingBlockParam, Anthropic::Models::ToolUseBlockParam, Anthropic::Models::ToolResultBlockParam, Anthropic::Models::ServerToolUseBlockParam, Anthropic::Models::WebSearchToolResultBlockParam>]
|
17
|
+
# @param content [String, Array<Anthropic::Models::TextBlockParam, Anthropic::Models::ImageBlockParam, Anthropic::Models::DocumentBlockParam, Anthropic::Models::SearchResultBlockParam, Anthropic::Models::ThinkingBlockParam, Anthropic::Models::RedactedThinkingBlockParam, Anthropic::Models::ToolUseBlockParam, Anthropic::Models::ToolResultBlockParam, Anthropic::Models::ServerToolUseBlockParam, Anthropic::Models::WebSearchToolResultBlockParam>]
|
18
18
|
# @param role [Symbol, Anthropic::Models::MessageParam::Role]
|
19
19
|
|
20
20
|
# @see Anthropic::Models::MessageParam#content
|
@@ -26,7 +26,7 @@ module Anthropic
|
|
26
26
|
variant -> { Anthropic::Models::MessageParam::Content::ContentBlockParamArray }
|
27
27
|
|
28
28
|
# @!method self.variants
|
29
|
-
# @return [Array(String, Array<Anthropic::Models::TextBlockParam, Anthropic::Models::ImageBlockParam, Anthropic::Models::DocumentBlockParam, Anthropic::Models::ThinkingBlockParam, Anthropic::Models::RedactedThinkingBlockParam, Anthropic::Models::ToolUseBlockParam, Anthropic::Models::ToolResultBlockParam, Anthropic::Models::ServerToolUseBlockParam, Anthropic::Models::WebSearchToolResultBlockParam>)]
|
29
|
+
# @return [Array(String, Array<Anthropic::Models::TextBlockParam, Anthropic::Models::ImageBlockParam, Anthropic::Models::DocumentBlockParam, Anthropic::Models::SearchResultBlockParam, Anthropic::Models::ThinkingBlockParam, Anthropic::Models::RedactedThinkingBlockParam, Anthropic::Models::ToolUseBlockParam, Anthropic::Models::ToolResultBlockParam, Anthropic::Models::ServerToolUseBlockParam, Anthropic::Models::WebSearchToolResultBlockParam>)]
|
30
30
|
|
31
31
|
# @type [Anthropic::Internal::Type::Converter]
|
32
32
|
ContentBlockParamArray = Anthropic::Internal::Type::ArrayOf[union: -> {
|
@@ -0,0 +1,51 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Anthropic
|
4
|
+
module Models
|
5
|
+
class SearchResultBlockParam < Anthropic::Internal::Type::BaseModel
|
6
|
+
# @!attribute content
|
7
|
+
#
|
8
|
+
# @return [Array<Anthropic::Models::TextBlockParam>]
|
9
|
+
required :content, -> { Anthropic::Internal::Type::ArrayOf[Anthropic::TextBlockParam] }
|
10
|
+
|
11
|
+
# @!attribute source
|
12
|
+
#
|
13
|
+
# @return [String]
|
14
|
+
required :source, String
|
15
|
+
|
16
|
+
# @!attribute title
|
17
|
+
#
|
18
|
+
# @return [String]
|
19
|
+
required :title, String
|
20
|
+
|
21
|
+
# @!attribute type
|
22
|
+
#
|
23
|
+
# @return [Symbol, :search_result]
|
24
|
+
required :type, const: :search_result
|
25
|
+
|
26
|
+
# @!attribute cache_control
|
27
|
+
# Create a cache control breakpoint at this content block.
|
28
|
+
#
|
29
|
+
# @return [Anthropic::Models::CacheControlEphemeral, nil]
|
30
|
+
optional :cache_control, -> { Anthropic::CacheControlEphemeral }, nil?: true
|
31
|
+
|
32
|
+
# @!attribute citations
|
33
|
+
#
|
34
|
+
# @return [Anthropic::Models::CitationsConfigParam, nil]
|
35
|
+
optional :citations, -> { Anthropic::CitationsConfigParam }
|
36
|
+
|
37
|
+
# @!method initialize(content:, source:, title:, cache_control: nil, citations: nil, type: :search_result)
|
38
|
+
# @param content [Array<Anthropic::Models::TextBlockParam>]
|
39
|
+
#
|
40
|
+
# @param source [String]
|
41
|
+
#
|
42
|
+
# @param title [String]
|
43
|
+
#
|
44
|
+
# @param cache_control [Anthropic::Models::CacheControlEphemeral, nil] Create a cache control breakpoint at this content block.
|
45
|
+
#
|
46
|
+
# @param citations [Anthropic::Models::CitationsConfigParam]
|
47
|
+
#
|
48
|
+
# @param type [Symbol, :search_result]
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -10,7 +10,7 @@ module Anthropic
|
|
10
10
|
# Citing a PDF results in `page_location`, plain text results in `char_location`,
|
11
11
|
# and content document results in `content_block_location`.
|
12
12
|
#
|
13
|
-
# @return [Array<Anthropic::Models::CitationCharLocation, Anthropic::Models::CitationPageLocation, Anthropic::Models::CitationContentBlockLocation, Anthropic::Models::CitationsWebSearchResultLocation>, nil]
|
13
|
+
# @return [Array<Anthropic::Models::CitationCharLocation, Anthropic::Models::CitationPageLocation, Anthropic::Models::CitationContentBlockLocation, Anthropic::Models::CitationsWebSearchResultLocation, Anthropic::Models::CitationsSearchResultLocation>, nil]
|
14
14
|
required :citations,
|
15
15
|
-> {
|
16
16
|
Anthropic::Internal::Type::ArrayOf[union: Anthropic::TextCitation]
|
@@ -31,7 +31,7 @@ module Anthropic
|
|
31
31
|
# Some parameter documentations has been truncated, see
|
32
32
|
# {Anthropic::Models::TextBlock} for more details.
|
33
33
|
#
|
34
|
-
# @param citations [Array<Anthropic::Models::CitationCharLocation, Anthropic::Models::CitationPageLocation, Anthropic::Models::CitationContentBlockLocation, Anthropic::Models::CitationsWebSearchResultLocation>, nil] Citations supporting the text block.
|
34
|
+
# @param citations [Array<Anthropic::Models::CitationCharLocation, Anthropic::Models::CitationPageLocation, Anthropic::Models::CitationContentBlockLocation, Anthropic::Models::CitationsWebSearchResultLocation, Anthropic::Models::CitationsSearchResultLocation>, nil] Citations supporting the text block.
|
35
35
|
#
|
36
36
|
# @param text [String]
|
37
37
|
#
|
@@ -21,7 +21,7 @@ module Anthropic
|
|
21
21
|
|
22
22
|
# @!attribute citations
|
23
23
|
#
|
24
|
-
# @return [Array<Anthropic::Models::CitationCharLocationParam, Anthropic::Models::CitationPageLocationParam, Anthropic::Models::CitationContentBlockLocationParam, Anthropic::Models::CitationWebSearchResultLocationParam>, nil]
|
24
|
+
# @return [Array<Anthropic::Models::CitationCharLocationParam, Anthropic::Models::CitationPageLocationParam, Anthropic::Models::CitationContentBlockLocationParam, Anthropic::Models::CitationWebSearchResultLocationParam, Anthropic::Models::CitationSearchResultLocationParam>, nil]
|
25
25
|
optional :citations,
|
26
26
|
-> { Anthropic::Internal::Type::ArrayOf[union: Anthropic::TextCitationParam] },
|
27
27
|
nil?: true
|
@@ -31,7 +31,7 @@ module Anthropic
|
|
31
31
|
#
|
32
32
|
# @param cache_control [Anthropic::Models::CacheControlEphemeral, nil] Create a cache control breakpoint at this content block.
|
33
33
|
#
|
34
|
-
# @param citations [Array<Anthropic::Models::CitationCharLocationParam, Anthropic::Models::CitationPageLocationParam, Anthropic::Models::CitationContentBlockLocationParam, Anthropic::Models::CitationWebSearchResultLocationParam>, nil]
|
34
|
+
# @param citations [Array<Anthropic::Models::CitationCharLocationParam, Anthropic::Models::CitationPageLocationParam, Anthropic::Models::CitationContentBlockLocationParam, Anthropic::Models::CitationWebSearchResultLocationParam, Anthropic::Models::CitationSearchResultLocationParam>, nil]
|
35
35
|
#
|
36
36
|
# @param type [Symbol, :text]
|
37
37
|
end
|
@@ -15,8 +15,10 @@ module Anthropic
|
|
15
15
|
|
16
16
|
variant :web_search_result_location, -> { Anthropic::CitationsWebSearchResultLocation }
|
17
17
|
|
18
|
+
variant :search_result_location, -> { Anthropic::CitationsSearchResultLocation }
|
19
|
+
|
18
20
|
# @!method self.variants
|
19
|
-
# @return [Array(Anthropic::Models::CitationCharLocation, Anthropic::Models::CitationPageLocation, Anthropic::Models::CitationContentBlockLocation, Anthropic::Models::CitationsWebSearchResultLocation)]
|
21
|
+
# @return [Array(Anthropic::Models::CitationCharLocation, Anthropic::Models::CitationPageLocation, Anthropic::Models::CitationContentBlockLocation, Anthropic::Models::CitationsWebSearchResultLocation, Anthropic::Models::CitationsSearchResultLocation)]
|
20
22
|
end
|
21
23
|
end
|
22
24
|
end
|
@@ -15,8 +15,10 @@ module Anthropic
|
|
15
15
|
|
16
16
|
variant :web_search_result_location, -> { Anthropic::CitationWebSearchResultLocationParam }
|
17
17
|
|
18
|
+
variant :search_result_location, -> { Anthropic::CitationSearchResultLocationParam }
|
19
|
+
|
18
20
|
# @!method self.variants
|
19
|
-
# @return [Array(Anthropic::Models::CitationCharLocationParam, Anthropic::Models::CitationPageLocationParam, Anthropic::Models::CitationContentBlockLocationParam, Anthropic::Models::CitationWebSearchResultLocationParam)]
|
21
|
+
# @return [Array(Anthropic::Models::CitationCharLocationParam, Anthropic::Models::CitationPageLocationParam, Anthropic::Models::CitationContentBlockLocationParam, Anthropic::Models::CitationWebSearchResultLocationParam, Anthropic::Models::CitationSearchResultLocationParam)]
|
20
22
|
end
|
21
23
|
end
|
22
24
|
end
|
@@ -21,7 +21,7 @@ module Anthropic
|
|
21
21
|
|
22
22
|
# @!attribute content
|
23
23
|
#
|
24
|
-
# @return [String, Array<Anthropic::Models::TextBlockParam, Anthropic::Models::ImageBlockParam>, nil]
|
24
|
+
# @return [String, Array<Anthropic::Models::TextBlockParam, Anthropic::Models::ImageBlockParam, Anthropic::Models::SearchResultBlockParam>, nil]
|
25
25
|
optional :content, union: -> { Anthropic::ToolResultBlockParam::Content }
|
26
26
|
|
27
27
|
# @!attribute is_error
|
@@ -34,7 +34,7 @@ module Anthropic
|
|
34
34
|
#
|
35
35
|
# @param cache_control [Anthropic::Models::CacheControlEphemeral, nil] Create a cache control breakpoint at this content block.
|
36
36
|
#
|
37
|
-
# @param content [String, Array<Anthropic::Models::TextBlockParam, Anthropic::Models::ImageBlockParam>]
|
37
|
+
# @param content [String, Array<Anthropic::Models::TextBlockParam, Anthropic::Models::ImageBlockParam, Anthropic::Models::SearchResultBlockParam>]
|
38
38
|
#
|
39
39
|
# @param is_error [Boolean]
|
40
40
|
#
|
@@ -57,12 +57,14 @@ module Anthropic
|
|
57
57
|
|
58
58
|
variant :image, -> { Anthropic::ImageBlockParam }
|
59
59
|
|
60
|
+
variant :search_result, -> { Anthropic::SearchResultBlockParam }
|
61
|
+
|
60
62
|
# @!method self.variants
|
61
|
-
# @return [Array(Anthropic::Models::TextBlockParam, Anthropic::Models::ImageBlockParam)]
|
63
|
+
# @return [Array(Anthropic::Models::TextBlockParam, Anthropic::Models::ImageBlockParam, Anthropic::Models::SearchResultBlockParam)]
|
62
64
|
end
|
63
65
|
|
64
66
|
# @!method self.variants
|
65
|
-
# @return [Array(String, Array<Anthropic::Models::TextBlockParam, Anthropic::Models::ImageBlockParam>)]
|
67
|
+
# @return [Array(String, Array<Anthropic::Models::TextBlockParam, Anthropic::Models::ImageBlockParam, Anthropic::Models::SearchResultBlockParam>)]
|
66
68
|
|
67
69
|
# @type [Anthropic::Internal::Type::Converter]
|
68
70
|
ContentArray =
|
data/lib/anthropic/models.rb
CHANGED
@@ -93,6 +93,10 @@ module Anthropic
|
|
93
93
|
|
94
94
|
CitationsDelta = Anthropic::Models::CitationsDelta
|
95
95
|
|
96
|
+
CitationSearchResultLocationParam = Anthropic::Models::CitationSearchResultLocationParam
|
97
|
+
|
98
|
+
CitationsSearchResultLocation = Anthropic::Models::CitationsSearchResultLocation
|
99
|
+
|
96
100
|
CitationsWebSearchResultLocation = Anthropic::Models::CitationsWebSearchResultLocation
|
97
101
|
|
98
102
|
CitationWebSearchResultLocationParam = Anthropic::Models::CitationWebSearchResultLocationParam
|
@@ -179,6 +183,8 @@ module Anthropic
|
|
179
183
|
|
180
184
|
RedactedThinkingBlockParam = Anthropic::Models::RedactedThinkingBlockParam
|
181
185
|
|
186
|
+
SearchResultBlockParam = Anthropic::Models::SearchResultBlockParam
|
187
|
+
|
182
188
|
ServerToolUsage = Anthropic::Models::ServerToolUsage
|
183
189
|
|
184
190
|
ServerToolUseBlock = Anthropic::Models::ServerToolUseBlock
|
data/lib/anthropic/version.rb
CHANGED
data/lib/anthropic.rb
CHANGED
@@ -222,6 +222,8 @@ require_relative "anthropic/models/citation_page_location"
|
|
222
222
|
require_relative "anthropic/models/citation_page_location_param"
|
223
223
|
require_relative "anthropic/models/citations_config_param"
|
224
224
|
require_relative "anthropic/models/citations_delta"
|
225
|
+
require_relative "anthropic/models/citation_search_result_location_param"
|
226
|
+
require_relative "anthropic/models/citations_search_result_location"
|
225
227
|
require_relative "anthropic/models/citations_web_search_result_location"
|
226
228
|
require_relative "anthropic/models/citation_web_search_result_location_param"
|
227
229
|
require_relative "anthropic/models/completion"
|
@@ -279,6 +281,7 @@ require_relative "anthropic/models/raw_message_stop_event"
|
|
279
281
|
require_relative "anthropic/models/raw_message_stream_event"
|
280
282
|
require_relative "anthropic/models/redacted_thinking_block"
|
281
283
|
require_relative "anthropic/models/redacted_thinking_block_param"
|
284
|
+
require_relative "anthropic/models/search_result_block_param"
|
282
285
|
require_relative "anthropic/models/server_tool_usage"
|
283
286
|
require_relative "anthropic/models/server_tool_use_block"
|
284
287
|
require_relative "anthropic/models/server_tool_use_block_param"
|
@@ -0,0 +1,74 @@
|
|
1
|
+
# typed: strong
|
2
|
+
|
3
|
+
module Anthropic
|
4
|
+
module Models
|
5
|
+
class CitationSearchResultLocationParam < Anthropic::Internal::Type::BaseModel
|
6
|
+
OrHash =
|
7
|
+
T.type_alias do
|
8
|
+
T.any(
|
9
|
+
Anthropic::CitationSearchResultLocationParam,
|
10
|
+
Anthropic::Internal::AnyHash
|
11
|
+
)
|
12
|
+
end
|
13
|
+
|
14
|
+
sig { returns(String) }
|
15
|
+
attr_accessor :cited_text
|
16
|
+
|
17
|
+
sig { returns(Integer) }
|
18
|
+
attr_accessor :end_block_index
|
19
|
+
|
20
|
+
sig { returns(Integer) }
|
21
|
+
attr_accessor :search_result_index
|
22
|
+
|
23
|
+
sig { returns(String) }
|
24
|
+
attr_accessor :source
|
25
|
+
|
26
|
+
sig { returns(Integer) }
|
27
|
+
attr_accessor :start_block_index
|
28
|
+
|
29
|
+
sig { returns(T.nilable(String)) }
|
30
|
+
attr_accessor :title
|
31
|
+
|
32
|
+
sig { returns(Symbol) }
|
33
|
+
attr_accessor :type
|
34
|
+
|
35
|
+
sig do
|
36
|
+
params(
|
37
|
+
cited_text: String,
|
38
|
+
end_block_index: Integer,
|
39
|
+
search_result_index: Integer,
|
40
|
+
source: String,
|
41
|
+
start_block_index: Integer,
|
42
|
+
title: T.nilable(String),
|
43
|
+
type: Symbol
|
44
|
+
).returns(T.attached_class)
|
45
|
+
end
|
46
|
+
def self.new(
|
47
|
+
cited_text:,
|
48
|
+
end_block_index:,
|
49
|
+
search_result_index:,
|
50
|
+
source:,
|
51
|
+
start_block_index:,
|
52
|
+
title:,
|
53
|
+
type: :search_result_location
|
54
|
+
)
|
55
|
+
end
|
56
|
+
|
57
|
+
sig do
|
58
|
+
override.returns(
|
59
|
+
{
|
60
|
+
cited_text: String,
|
61
|
+
end_block_index: Integer,
|
62
|
+
search_result_index: Integer,
|
63
|
+
source: String,
|
64
|
+
start_block_index: Integer,
|
65
|
+
title: T.nilable(String),
|
66
|
+
type: Symbol
|
67
|
+
}
|
68
|
+
)
|
69
|
+
end
|
70
|
+
def to_hash
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
@@ -21,7 +21,8 @@ module Anthropic
|
|
21
21
|
Anthropic::CitationCharLocation::OrHash,
|
22
22
|
Anthropic::CitationPageLocation::OrHash,
|
23
23
|
Anthropic::CitationContentBlockLocation::OrHash,
|
24
|
-
Anthropic::CitationsWebSearchResultLocation::OrHash
|
24
|
+
Anthropic::CitationsWebSearchResultLocation::OrHash,
|
25
|
+
Anthropic::CitationsSearchResultLocation::OrHash
|
25
26
|
),
|
26
27
|
type: Symbol
|
27
28
|
).returns(T.attached_class)
|
@@ -49,7 +50,8 @@ module Anthropic
|
|
49
50
|
Anthropic::CitationCharLocation,
|
50
51
|
Anthropic::CitationPageLocation,
|
51
52
|
Anthropic::CitationContentBlockLocation,
|
52
|
-
Anthropic::CitationsWebSearchResultLocation
|
53
|
+
Anthropic::CitationsWebSearchResultLocation,
|
54
|
+
Anthropic::CitationsSearchResultLocation
|
53
55
|
)
|
54
56
|
end
|
55
57
|
|
@@ -0,0 +1,74 @@
|
|
1
|
+
# typed: strong
|
2
|
+
|
3
|
+
module Anthropic
|
4
|
+
module Models
|
5
|
+
class CitationsSearchResultLocation < Anthropic::Internal::Type::BaseModel
|
6
|
+
OrHash =
|
7
|
+
T.type_alias do
|
8
|
+
T.any(
|
9
|
+
Anthropic::CitationsSearchResultLocation,
|
10
|
+
Anthropic::Internal::AnyHash
|
11
|
+
)
|
12
|
+
end
|
13
|
+
|
14
|
+
sig { returns(String) }
|
15
|
+
attr_accessor :cited_text
|
16
|
+
|
17
|
+
sig { returns(Integer) }
|
18
|
+
attr_accessor :end_block_index
|
19
|
+
|
20
|
+
sig { returns(Integer) }
|
21
|
+
attr_accessor :search_result_index
|
22
|
+
|
23
|
+
sig { returns(String) }
|
24
|
+
attr_accessor :source
|
25
|
+
|
26
|
+
sig { returns(Integer) }
|
27
|
+
attr_accessor :start_block_index
|
28
|
+
|
29
|
+
sig { returns(T.nilable(String)) }
|
30
|
+
attr_accessor :title
|
31
|
+
|
32
|
+
sig { returns(Symbol) }
|
33
|
+
attr_accessor :type
|
34
|
+
|
35
|
+
sig do
|
36
|
+
params(
|
37
|
+
cited_text: String,
|
38
|
+
end_block_index: Integer,
|
39
|
+
search_result_index: Integer,
|
40
|
+
source: String,
|
41
|
+
start_block_index: Integer,
|
42
|
+
title: T.nilable(String),
|
43
|
+
type: Symbol
|
44
|
+
).returns(T.attached_class)
|
45
|
+
end
|
46
|
+
def self.new(
|
47
|
+
cited_text:,
|
48
|
+
end_block_index:,
|
49
|
+
search_result_index:,
|
50
|
+
source:,
|
51
|
+
start_block_index:,
|
52
|
+
title:,
|
53
|
+
type: :search_result_location
|
54
|
+
)
|
55
|
+
end
|
56
|
+
|
57
|
+
sig do
|
58
|
+
override.returns(
|
59
|
+
{
|
60
|
+
cited_text: String,
|
61
|
+
end_block_index: Integer,
|
62
|
+
search_result_index: Integer,
|
63
|
+
source: String,
|
64
|
+
start_block_index: Integer,
|
65
|
+
title: T.nilable(String),
|
66
|
+
type: Symbol
|
67
|
+
}
|
68
|
+
)
|
69
|
+
end
|
70
|
+
def to_hash
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
@@ -0,0 +1,77 @@
|
|
1
|
+
# typed: strong
|
2
|
+
|
3
|
+
module Anthropic
|
4
|
+
module Models
|
5
|
+
class SearchResultBlockParam < Anthropic::Internal::Type::BaseModel
|
6
|
+
OrHash =
|
7
|
+
T.type_alias do
|
8
|
+
T.any(Anthropic::SearchResultBlockParam, Anthropic::Internal::AnyHash)
|
9
|
+
end
|
10
|
+
|
11
|
+
sig { returns(T::Array[Anthropic::TextBlockParam]) }
|
12
|
+
attr_accessor :content
|
13
|
+
|
14
|
+
sig { returns(String) }
|
15
|
+
attr_accessor :source
|
16
|
+
|
17
|
+
sig { returns(String) }
|
18
|
+
attr_accessor :title
|
19
|
+
|
20
|
+
sig { returns(Symbol) }
|
21
|
+
attr_accessor :type
|
22
|
+
|
23
|
+
# Create a cache control breakpoint at this content block.
|
24
|
+
sig { returns(T.nilable(Anthropic::CacheControlEphemeral)) }
|
25
|
+
attr_reader :cache_control
|
26
|
+
|
27
|
+
sig do
|
28
|
+
params(
|
29
|
+
cache_control: T.nilable(Anthropic::CacheControlEphemeral::OrHash)
|
30
|
+
).void
|
31
|
+
end
|
32
|
+
attr_writer :cache_control
|
33
|
+
|
34
|
+
sig { returns(T.nilable(Anthropic::CitationsConfigParam)) }
|
35
|
+
attr_reader :citations
|
36
|
+
|
37
|
+
sig { params(citations: Anthropic::CitationsConfigParam::OrHash).void }
|
38
|
+
attr_writer :citations
|
39
|
+
|
40
|
+
sig do
|
41
|
+
params(
|
42
|
+
content: T::Array[Anthropic::TextBlockParam::OrHash],
|
43
|
+
source: String,
|
44
|
+
title: String,
|
45
|
+
cache_control: T.nilable(Anthropic::CacheControlEphemeral::OrHash),
|
46
|
+
citations: Anthropic::CitationsConfigParam::OrHash,
|
47
|
+
type: Symbol
|
48
|
+
).returns(T.attached_class)
|
49
|
+
end
|
50
|
+
def self.new(
|
51
|
+
content:,
|
52
|
+
source:,
|
53
|
+
title:,
|
54
|
+
# Create a cache control breakpoint at this content block.
|
55
|
+
cache_control: nil,
|
56
|
+
citations: nil,
|
57
|
+
type: :search_result
|
58
|
+
)
|
59
|
+
end
|
60
|
+
|
61
|
+
sig do
|
62
|
+
override.returns(
|
63
|
+
{
|
64
|
+
content: T::Array[Anthropic::TextBlockParam],
|
65
|
+
source: String,
|
66
|
+
title: String,
|
67
|
+
type: Symbol,
|
68
|
+
cache_control: T.nilable(Anthropic::CacheControlEphemeral),
|
69
|
+
citations: Anthropic::CitationsConfigParam
|
70
|
+
}
|
71
|
+
)
|
72
|
+
end
|
73
|
+
def to_hash
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
@@ -31,7 +31,8 @@ module Anthropic
|
|
31
31
|
Anthropic::CitationCharLocation::OrHash,
|
32
32
|
Anthropic::CitationPageLocation::OrHash,
|
33
33
|
Anthropic::CitationContentBlockLocation::OrHash,
|
34
|
-
Anthropic::CitationsWebSearchResultLocation::OrHash
|
34
|
+
Anthropic::CitationsWebSearchResultLocation::OrHash,
|
35
|
+
Anthropic::CitationsSearchResultLocation::OrHash
|
35
36
|
)
|
36
37
|
]
|
37
38
|
),
|
@@ -33,7 +33,8 @@ module Anthropic
|
|
33
33
|
Anthropic::CitationCharLocationParam,
|
34
34
|
Anthropic::CitationPageLocationParam,
|
35
35
|
Anthropic::CitationContentBlockLocationParam,
|
36
|
-
Anthropic::CitationWebSearchResultLocationParam
|
36
|
+
Anthropic::CitationWebSearchResultLocationParam,
|
37
|
+
Anthropic::CitationSearchResultLocationParam
|
37
38
|
)
|
38
39
|
]
|
39
40
|
)
|
@@ -52,7 +53,8 @@ module Anthropic
|
|
52
53
|
Anthropic::CitationCharLocationParam::OrHash,
|
53
54
|
Anthropic::CitationPageLocationParam::OrHash,
|
54
55
|
Anthropic::CitationContentBlockLocationParam::OrHash,
|
55
|
-
Anthropic::CitationWebSearchResultLocationParam::OrHash
|
56
|
+
Anthropic::CitationWebSearchResultLocationParam::OrHash,
|
57
|
+
Anthropic::CitationSearchResultLocationParam::OrHash
|
56
58
|
)
|
57
59
|
]
|
58
60
|
),
|
@@ -81,7 +83,8 @@ module Anthropic
|
|
81
83
|
Anthropic::CitationCharLocationParam,
|
82
84
|
Anthropic::CitationPageLocationParam,
|
83
85
|
Anthropic::CitationContentBlockLocationParam,
|
84
|
-
Anthropic::CitationWebSearchResultLocationParam
|
86
|
+
Anthropic::CitationWebSearchResultLocationParam,
|
87
|
+
Anthropic::CitationSearchResultLocationParam
|
85
88
|
)
|
86
89
|
]
|
87
90
|
)
|
@@ -11,7 +11,8 @@ module Anthropic
|
|
11
11
|
Anthropic::CitationCharLocation,
|
12
12
|
Anthropic::CitationPageLocation,
|
13
13
|
Anthropic::CitationContentBlockLocation,
|
14
|
-
Anthropic::CitationsWebSearchResultLocation
|
14
|
+
Anthropic::CitationsWebSearchResultLocation,
|
15
|
+
Anthropic::CitationsSearchResultLocation
|
15
16
|
)
|
16
17
|
end
|
17
18
|
|
@@ -11,7 +11,8 @@ module Anthropic
|
|
11
11
|
Anthropic::CitationCharLocationParam,
|
12
12
|
Anthropic::CitationPageLocationParam,
|
13
13
|
Anthropic::CitationContentBlockLocationParam,
|
14
|
-
Anthropic::CitationWebSearchResultLocationParam
|
14
|
+
Anthropic::CitationWebSearchResultLocationParam,
|
15
|
+
Anthropic::CitationSearchResultLocationParam
|
15
16
|
)
|
16
17
|
end
|
17
18
|
|
@@ -92,7 +92,11 @@ module Anthropic
|
|
92
92
|
|
93
93
|
Variants =
|
94
94
|
T.type_alias do
|
95
|
-
T.any(
|
95
|
+
T.any(
|
96
|
+
Anthropic::TextBlockParam,
|
97
|
+
Anthropic::ImageBlockParam,
|
98
|
+
Anthropic::SearchResultBlockParam
|
99
|
+
)
|
96
100
|
end
|
97
101
|
|
98
102
|
sig do
|
data/rbi/anthropic/models.rbi
CHANGED
@@ -56,6 +56,12 @@ module Anthropic
|
|
56
56
|
|
57
57
|
CitationsDelta = Anthropic::Models::CitationsDelta
|
58
58
|
|
59
|
+
CitationSearchResultLocationParam =
|
60
|
+
Anthropic::Models::CitationSearchResultLocationParam
|
61
|
+
|
62
|
+
CitationsSearchResultLocation =
|
63
|
+
Anthropic::Models::CitationsSearchResultLocation
|
64
|
+
|
59
65
|
CitationsWebSearchResultLocation =
|
60
66
|
Anthropic::Models::CitationsWebSearchResultLocation
|
61
67
|
|
@@ -144,6 +150,8 @@ module Anthropic
|
|
144
150
|
|
145
151
|
RedactedThinkingBlockParam = Anthropic::Models::RedactedThinkingBlockParam
|
146
152
|
|
153
|
+
SearchResultBlockParam = Anthropic::Models::SearchResultBlockParam
|
154
|
+
|
147
155
|
ServerToolUsage = Anthropic::Models::ServerToolUsage
|
148
156
|
|
149
157
|
ServerToolUseBlock = Anthropic::Models::ServerToolUseBlock
|
@@ -0,0 +1,50 @@
|
|
1
|
+
module Anthropic
|
2
|
+
module Models
|
3
|
+
type citation_search_result_location_param =
|
4
|
+
{
|
5
|
+
cited_text: String,
|
6
|
+
end_block_index: Integer,
|
7
|
+
search_result_index: Integer,
|
8
|
+
source: String,
|
9
|
+
start_block_index: Integer,
|
10
|
+
title: String?,
|
11
|
+
type: :search_result_location
|
12
|
+
}
|
13
|
+
|
14
|
+
class CitationSearchResultLocationParam < Anthropic::Internal::Type::BaseModel
|
15
|
+
attr_accessor cited_text: String
|
16
|
+
|
17
|
+
attr_accessor end_block_index: Integer
|
18
|
+
|
19
|
+
attr_accessor search_result_index: Integer
|
20
|
+
|
21
|
+
attr_accessor source: String
|
22
|
+
|
23
|
+
attr_accessor start_block_index: Integer
|
24
|
+
|
25
|
+
attr_accessor title: String?
|
26
|
+
|
27
|
+
attr_accessor type: :search_result_location
|
28
|
+
|
29
|
+
def initialize: (
|
30
|
+
cited_text: String,
|
31
|
+
end_block_index: Integer,
|
32
|
+
search_result_index: Integer,
|
33
|
+
source: String,
|
34
|
+
start_block_index: Integer,
|
35
|
+
title: String?,
|
36
|
+
?type: :search_result_location
|
37
|
+
) -> void
|
38
|
+
|
39
|
+
def to_hash: -> {
|
40
|
+
cited_text: String,
|
41
|
+
end_block_index: Integer,
|
42
|
+
search_result_index: Integer,
|
43
|
+
source: String,
|
44
|
+
start_block_index: Integer,
|
45
|
+
title: String?,
|
46
|
+
type: :search_result_location
|
47
|
+
}
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
module Anthropic
|
2
|
+
module Models
|
3
|
+
type citations_search_result_location =
|
4
|
+
{
|
5
|
+
cited_text: String,
|
6
|
+
end_block_index: Integer,
|
7
|
+
search_result_index: Integer,
|
8
|
+
source: String,
|
9
|
+
start_block_index: Integer,
|
10
|
+
title: String?,
|
11
|
+
type: :search_result_location
|
12
|
+
}
|
13
|
+
|
14
|
+
class CitationsSearchResultLocation < Anthropic::Internal::Type::BaseModel
|
15
|
+
attr_accessor cited_text: String
|
16
|
+
|
17
|
+
attr_accessor end_block_index: Integer
|
18
|
+
|
19
|
+
attr_accessor search_result_index: Integer
|
20
|
+
|
21
|
+
attr_accessor source: String
|
22
|
+
|
23
|
+
attr_accessor start_block_index: Integer
|
24
|
+
|
25
|
+
attr_accessor title: String?
|
26
|
+
|
27
|
+
attr_accessor type: :search_result_location
|
28
|
+
|
29
|
+
def initialize: (
|
30
|
+
cited_text: String,
|
31
|
+
end_block_index: Integer,
|
32
|
+
search_result_index: Integer,
|
33
|
+
source: String,
|
34
|
+
start_block_index: Integer,
|
35
|
+
title: String?,
|
36
|
+
?type: :search_result_location
|
37
|
+
) -> void
|
38
|
+
|
39
|
+
def to_hash: -> {
|
40
|
+
cited_text: String,
|
41
|
+
end_block_index: Integer,
|
42
|
+
search_result_index: Integer,
|
43
|
+
source: String,
|
44
|
+
start_block_index: Integer,
|
45
|
+
title: String?,
|
46
|
+
type: :search_result_location
|
47
|
+
}
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
@@ -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::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 =
|
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
|
data/sig/anthropic/models.rbs
CHANGED
@@ -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
|
+
version: 1.5.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-
|
11
|
+
date: 2025-08-08 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
|