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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +29 -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/internal/type/array_of.rb +1 -0
- data/lib/anthropic/internal/type/base_model.rb +3 -1
- data/lib/anthropic/internal/type/converter.rb +27 -0
- data/lib/anthropic/internal/type/hash_of.rb +1 -0
- data/lib/anthropic/internal/type/union.rb +9 -7
- data/lib/anthropic/models/anthropic_beta.rb +3 -0
- 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/internal/type/converter.rbi +54 -0
- data/rbi/anthropic/internal/type/union.rbi +9 -2
- data/rbi/anthropic/models/anthropic_beta.rbi +2 -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/internal/type/converter.rbs +17 -0
- data/sig/anthropic/internal/type/union.rbs +2 -2
- data/sig/anthropic/models/anthropic_beta.rbs +2 -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
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"
|
@@ -90,6 +90,60 @@ module Anthropic
|
|
90
90
|
def self.type_info(spec)
|
91
91
|
end
|
92
92
|
|
93
|
+
# @api private
|
94
|
+
sig do
|
95
|
+
params(
|
96
|
+
type_info:
|
97
|
+
T.any(
|
98
|
+
{
|
99
|
+
const:
|
100
|
+
T.nilable(
|
101
|
+
T.any(NilClass, T::Boolean, Integer, Float, Symbol)
|
102
|
+
),
|
103
|
+
enum:
|
104
|
+
T.nilable(
|
105
|
+
T.proc.returns(
|
106
|
+
Anthropic::Internal::Type::Converter::Input
|
107
|
+
)
|
108
|
+
),
|
109
|
+
union:
|
110
|
+
T.nilable(
|
111
|
+
T.proc.returns(
|
112
|
+
Anthropic::Internal::Type::Converter::Input
|
113
|
+
)
|
114
|
+
)
|
115
|
+
},
|
116
|
+
T.proc.returns(Anthropic::Internal::Type::Converter::Input),
|
117
|
+
Anthropic::Internal::Type::Converter::Input
|
118
|
+
),
|
119
|
+
spec:
|
120
|
+
T.any(
|
121
|
+
{
|
122
|
+
const:
|
123
|
+
T.nilable(
|
124
|
+
T.any(NilClass, T::Boolean, Integer, Float, Symbol)
|
125
|
+
),
|
126
|
+
enum:
|
127
|
+
T.nilable(
|
128
|
+
T.proc.returns(
|
129
|
+
Anthropic::Internal::Type::Converter::Input
|
130
|
+
)
|
131
|
+
),
|
132
|
+
union:
|
133
|
+
T.nilable(
|
134
|
+
T.proc.returns(
|
135
|
+
Anthropic::Internal::Type::Converter::Input
|
136
|
+
)
|
137
|
+
)
|
138
|
+
},
|
139
|
+
T.proc.returns(Anthropic::Internal::Type::Converter::Input),
|
140
|
+
Anthropic::Internal::Type::Converter::Input
|
141
|
+
)
|
142
|
+
).returns(Anthropic::Internal::AnyHash)
|
143
|
+
end
|
144
|
+
def self.meta_info(type_info, spec)
|
145
|
+
end
|
146
|
+
|
93
147
|
# @api private
|
94
148
|
sig do
|
95
149
|
params(translate_names: T::Boolean).returns(
|
@@ -16,7 +16,8 @@ module Anthropic
|
|
16
16
|
T::Array[
|
17
17
|
[
|
18
18
|
T.nilable(Symbol),
|
19
|
-
T.proc.returns(Anthropic::Internal::Type::Converter::Input)
|
19
|
+
T.proc.returns(Anthropic::Internal::Type::Converter::Input),
|
20
|
+
Anthropic::Internal::AnyHash
|
20
21
|
]
|
21
22
|
]
|
22
23
|
)
|
@@ -25,7 +26,13 @@ module Anthropic
|
|
25
26
|
end
|
26
27
|
|
27
28
|
# @api private
|
28
|
-
sig
|
29
|
+
sig do
|
30
|
+
returns(
|
31
|
+
T::Array[
|
32
|
+
[T.nilable(Symbol), T.anything, Anthropic::Internal::AnyHash]
|
33
|
+
]
|
34
|
+
)
|
35
|
+
end
|
29
36
|
protected def derefed_variants
|
30
37
|
end
|
31
38
|
|
@@ -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
|
@@ -39,6 +39,23 @@ module Anthropic
|
|
39
39
|
| Anthropic::Internal::Type::Converter::input spec
|
40
40
|
) -> (^-> top)
|
41
41
|
|
42
|
+
def self.meta_info: (
|
43
|
+
{
|
44
|
+
const: (nil | bool | Integer | Float | Symbol)?,
|
45
|
+
enum: ^-> Anthropic::Internal::Type::Converter::input?,
|
46
|
+
union: ^-> Anthropic::Internal::Type::Converter::input?
|
47
|
+
}
|
48
|
+
| ^-> Anthropic::Internal::Type::Converter::input
|
49
|
+
| Anthropic::Internal::Type::Converter::input type_info,
|
50
|
+
{
|
51
|
+
const: (nil | bool | Integer | Float | Symbol)?,
|
52
|
+
enum: ^-> Anthropic::Internal::Type::Converter::input?,
|
53
|
+
union: ^-> Anthropic::Internal::Type::Converter::input?
|
54
|
+
}
|
55
|
+
| ^-> Anthropic::Internal::Type::Converter::input
|
56
|
+
| Anthropic::Internal::Type::Converter::input spec
|
57
|
+
) -> ::Hash[Symbol, top]
|
58
|
+
|
42
59
|
def self.new_coerce_state: (
|
43
60
|
?translate_names: bool
|
44
61
|
) -> Anthropic::Internal::Type::Converter::coerce_state
|
@@ -5,9 +5,9 @@ module Anthropic
|
|
5
5
|
include Anthropic::Internal::Type::Converter
|
6
6
|
include Anthropic::Internal::Util::SorbetRuntimeSupport
|
7
7
|
|
8
|
-
private def self.known_variants: -> ::Array[[Symbol?, (^-> Anthropic::Internal::Type::Converter::input)]]
|
8
|
+
private def self.known_variants: -> ::Array[[Symbol?, (^-> Anthropic::Internal::Type::Converter::input), ::Hash[Symbol, top]]]
|
9
9
|
|
10
|
-
def self.derefed_variants: -> ::Array[[Symbol?, top]]
|
10
|
+
def self.derefed_variants: -> ::Array[[Symbol?, top, ::Hash[Symbol, top]]]
|
11
11
|
|
12
12
|
def self.variants: -> ::Array[top]
|
13
13
|
|
@@ -16,6 +16,7 @@ module Anthropic
|
|
16
16
|
| :"interleaved-thinking-2025-05-14"
|
17
17
|
| :"code-execution-2025-05-22"
|
18
18
|
| :"extended-cache-ttl-2025-04-11"
|
19
|
+
| :"context-1m-2025-08-07"
|
19
20
|
|
20
21
|
module AnthropicBeta
|
21
22
|
extend Anthropic::Internal::Type::Union
|
@@ -36,6 +37,7 @@ module Anthropic
|
|
36
37
|
INTERLEAVED_THINKING_2025_05_14: :"interleaved-thinking-2025-05-14"
|
37
38
|
CODE_EXECUTION_2025_05_22: :"code-execution-2025-05-22"
|
38
39
|
EXTENDED_CACHE_TTL_2025_04_11: :"extended-cache-ttl-2025-04-11"
|
40
|
+
CONTEXT_1M_2025_08_07: :"context-1m-2025-08-07"
|
39
41
|
end
|
40
42
|
end
|
41
43
|
end
|
@@ -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
|