anthropic 1.1.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 +123 -0
- data/README.md +32 -16
- data/lib/anthropic/client.rb +5 -2
- data/lib/anthropic/errors.rb +22 -0
- data/lib/anthropic/helpers/bedrock/client.rb +34 -4
- data/lib/anthropic/helpers/streaming/events.rb +141 -0
- data/lib/anthropic/helpers/streaming/message_stream.rb +238 -0
- data/lib/anthropic/helpers/streaming.rb +37 -0
- data/lib/anthropic/helpers/vertex/client.rb +4 -1
- data/lib/anthropic/internal/stream.rb +4 -2
- data/lib/anthropic/internal/transport/base_client.rb +29 -3
- data/lib/anthropic/internal/type/array_of.rb +7 -1
- data/lib/anthropic/internal/type/base_model.rb +80 -24
- data/lib/anthropic/internal/type/base_stream.rb +3 -1
- data/lib/anthropic/internal/type/boolean.rb +7 -1
- data/lib/anthropic/internal/type/converter.rb +69 -34
- data/lib/anthropic/internal/type/enum.rb +16 -5
- data/lib/anthropic/internal/type/file_input.rb +6 -1
- data/lib/anthropic/internal/type/hash_of.rb +7 -1
- data/lib/anthropic/internal/type/union.rb +26 -16
- data/lib/anthropic/internal/type/unknown.rb +7 -1
- data/lib/anthropic/internal/util.rb +8 -9
- data/lib/anthropic/models/anthropic_beta.rb +3 -0
- data/lib/anthropic/models/beta/beta_base64_pdf_block.rb +1 -65
- data/lib/anthropic/models/beta/beta_citation_char_location.rb +7 -1
- data/lib/anthropic/models/beta/beta_citation_content_block_location.rb +7 -1
- data/lib/anthropic/models/beta/beta_citation_page_location.rb +7 -1
- data/lib/anthropic/models/beta/beta_citation_search_result_location.rb +55 -0
- data/lib/anthropic/models/beta/beta_citation_search_result_location_param.rb +55 -0
- data/lib/anthropic/models/beta/beta_citations_delta.rb +5 -3
- data/lib/anthropic/models/beta/beta_content_block.rb +5 -5
- data/lib/anthropic/models/beta/beta_content_block_param.rb +20 -17
- data/lib/anthropic/models/beta/beta_message.rb +6 -2
- data/lib/anthropic/models/beta/beta_message_param.rb +3 -3
- data/lib/anthropic/models/beta/beta_raw_content_block_start_event.rb +7 -7
- data/lib/anthropic/models/beta/beta_request_document_block.rb +75 -0
- data/lib/anthropic/models/beta/beta_search_result_block_param.rb +55 -0
- data/lib/anthropic/models/beta/beta_text_block.rb +2 -2
- data/lib/anthropic/models/beta/beta_text_block_param.rb +2 -2
- data/lib/anthropic/models/beta/beta_text_citation.rb +3 -1
- data/lib/anthropic/models/beta/beta_text_citation_param.rb +3 -1
- data/lib/anthropic/models/beta/beta_tool.rb +7 -1
- data/lib/anthropic/models/beta/beta_tool_result_block_param.rb +6 -4
- data/lib/anthropic/models/beta/beta_tool_text_editor_20250728.rb +49 -0
- data/lib/anthropic/models/beta/beta_tool_union.rb +9 -7
- data/lib/anthropic/models/beta/message_count_tokens_params.rb +18 -10
- data/lib/anthropic/models/beta/message_create_params.rb +9 -3
- data/lib/anthropic/models/beta/messages/batch_create_params.rb +9 -3
- data/lib/anthropic/models/citation_char_location.rb +7 -1
- data/lib/anthropic/models/citation_content_block_location.rb +7 -1
- data/lib/anthropic/models/citation_page_location.rb +7 -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.rb +5 -5
- data/lib/anthropic/models/content_block_param.rb +14 -11
- data/lib/anthropic/models/message.rb +6 -2
- data/lib/anthropic/models/message_count_tokens_params.rb +9 -3
- data/lib/anthropic/models/message_count_tokens_tool.rb +5 -1
- data/lib/anthropic/models/message_create_params.rb +9 -3
- data/lib/anthropic/models/message_param.rb +3 -3
- data/lib/anthropic/models/messages/batch_create_params.rb +9 -3
- data/lib/anthropic/models/model.rb +10 -21
- data/lib/anthropic/models/raw_content_block_start_event.rb +7 -7
- 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.rb +7 -1
- data/lib/anthropic/models/tool_result_block_param.rb +6 -4
- data/lib/anthropic/models/tool_text_editor_20250429.rb +36 -0
- data/lib/anthropic/models/tool_text_editor_20250728.rb +45 -0
- data/lib/anthropic/models/tool_union.rb +5 -1
- data/lib/anthropic/models/tool_use_block.rb +6 -0
- data/lib/anthropic/models.rb +14 -4
- data/lib/anthropic/resources/beta/messages.rb +73 -6
- data/lib/anthropic/resources/messages.rb +68 -7
- data/lib/anthropic/streaming.rb +5 -0
- data/lib/anthropic/version.rb +1 -1
- data/lib/anthropic.rb +14 -0
- data/rbi/anthropic/errors.rbi +16 -0
- data/rbi/anthropic/helpers/bedrock/client.rbi +17 -6
- data/rbi/anthropic/helpers/streaming/events.rbi +95 -0
- data/rbi/anthropic/helpers/streaming/message_stream.rbi +73 -0
- data/rbi/anthropic/helpers/vertex/client.rbi +17 -6
- data/rbi/anthropic/internal/transport/base_client.rbi +1 -1
- data/rbi/anthropic/internal/type/base_stream.rbi +8 -1
- data/rbi/anthropic/internal/type/boolean.rbi +2 -0
- data/rbi/anthropic/internal/type/converter.rbi +69 -15
- data/rbi/anthropic/internal/type/union.rbi +14 -2
- data/rbi/anthropic/internal/type/unknown.rbi +2 -0
- data/rbi/anthropic/internal/util.rbi +2 -0
- data/rbi/anthropic/models/anthropic_beta.rbi +2 -0
- data/rbi/anthropic/models/beta/beta_base64_pdf_block.rbi +1 -128
- data/rbi/anthropic/models/beta/beta_citation_char_location.rbi +6 -0
- data/rbi/anthropic/models/beta/beta_citation_content_block_location.rbi +6 -0
- data/rbi/anthropic/models/beta/beta_citation_page_location.rbi +6 -0
- data/rbi/anthropic/models/beta/beta_citation_search_result_location.rbi +78 -0
- data/rbi/anthropic/models/beta/beta_citation_search_result_location_param.rbi +79 -0
- data/rbi/anthropic/models/beta/beta_citations_delta.rbi +4 -2
- data/rbi/anthropic/models/beta/beta_content_block.rbi +3 -3
- data/rbi/anthropic/models/beta/beta_content_block_param.rbi +8 -7
- data/rbi/anthropic/models/beta/beta_message.rbi +11 -3
- data/rbi/anthropic/models/beta/beta_raw_content_block_start_event.rbi +6 -6
- data/rbi/anthropic/models/beta/beta_request_document_block.rbi +140 -0
- data/rbi/anthropic/models/beta/beta_search_result_block_param.rbi +91 -0
- data/rbi/anthropic/models/beta/beta_text_block.rbi +2 -1
- data/rbi/anthropic/models/beta/beta_text_block_param.rbi +6 -3
- data/rbi/anthropic/models/beta/beta_text_citation.rbi +2 -1
- data/rbi/anthropic/models/beta/beta_text_citation_param.rbi +2 -1
- data/rbi/anthropic/models/beta/beta_tool.rbi +14 -5
- data/rbi/anthropic/models/beta/beta_tool_result_block_param.rbi +2 -1
- data/rbi/anthropic/models/beta/beta_tool_text_editor_20250728.rbi +82 -0
- data/rbi/anthropic/models/beta/beta_tool_union.rbi +6 -5
- data/rbi/anthropic/models/beta/message_count_tokens_params.rbi +44 -27
- data/rbi/anthropic/models/beta/message_create_params.rbi +38 -22
- data/rbi/anthropic/models/beta/messages/batch_create_params.rbi +38 -22
- data/rbi/anthropic/models/citation_char_location.rbi +6 -0
- data/rbi/anthropic/models/citation_content_block_location.rbi +6 -0
- data/rbi/anthropic/models/citation_page_location.rbi +6 -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.rbi +3 -3
- data/rbi/anthropic/models/content_block_param.rbi +6 -5
- data/rbi/anthropic/models/message.rbi +11 -3
- data/rbi/anthropic/models/message_count_tokens_params.rbi +22 -2
- data/rbi/anthropic/models/message_count_tokens_tool.rbi +2 -0
- data/rbi/anthropic/models/message_create_params.rbi +22 -2
- data/rbi/anthropic/models/messages/batch_create_params.rbi +22 -2
- data/rbi/anthropic/models/model.rbi +4 -8
- data/rbi/anthropic/models/raw_content_block_start_event.rbi +6 -6
- 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.rbi +16 -5
- data/rbi/anthropic/models/tool_result_block_param.rbi +5 -1
- data/rbi/anthropic/models/tool_text_editor_20250429.rbi +62 -0
- data/rbi/anthropic/models/tool_text_editor_20250728.rbi +72 -0
- data/rbi/anthropic/models/tool_union.rbi +2 -0
- data/rbi/anthropic/models.rbi +12 -0
- data/rbi/anthropic/resources/beta/messages.rbi +39 -18
- data/rbi/anthropic/resources/messages.rbi +318 -3
- data/rbi/anthropic/streaming.rbi +5 -0
- data/sig/anthropic/errors.rbs +9 -0
- data/sig/anthropic/helpers/streaming/events.rbs +117 -0
- data/sig/anthropic/helpers/streaming/message_stream.rbs +57 -0
- data/sig/anthropic/internal/transport/base_client.rbs +1 -1
- data/sig/anthropic/internal/type/base_stream.rbs +4 -0
- data/sig/anthropic/internal/type/converter.rbs +24 -1
- data/sig/anthropic/internal/type/union.rbs +2 -2
- data/sig/anthropic/models/anthropic_beta.rbs +2 -0
- data/sig/anthropic/models/beta/beta_base64_pdf_block.rbs +1 -58
- data/sig/anthropic/models/beta/beta_citation_char_location.rbs +5 -0
- data/sig/anthropic/models/beta/beta_citation_content_block_location.rbs +5 -0
- data/sig/anthropic/models/beta/beta_citation_page_location.rbs +5 -0
- data/sig/anthropic/models/beta/beta_citation_search_result_location.rbs +54 -0
- data/sig/anthropic/models/beta/beta_citation_search_result_location_param.rbs +54 -0
- data/sig/anthropic/models/beta/beta_citations_delta.rbs +1 -0
- data/sig/anthropic/models/beta/beta_content_block.rbs +2 -2
- data/sig/anthropic/models/beta/beta_content_block_param.rbs +9 -8
- data/sig/anthropic/models/beta/beta_raw_content_block_start_event.rbs +2 -2
- data/sig/anthropic/models/beta/beta_request_document_block.rbs +66 -0
- data/sig/anthropic/models/beta/beta_search_result_block_param.rbs +53 -0
- data/sig/anthropic/models/beta/beta_text_citation.rbs +1 -0
- data/sig/anthropic/models/beta/beta_text_citation_param.rbs +1 -0
- data/sig/anthropic/models/beta/beta_tool.rbs +14 -3
- data/sig/anthropic/models/beta/beta_tool_result_block_param.rbs +1 -0
- data/sig/anthropic/models/beta/beta_tool_text_editor_20250728.rbs +39 -0
- data/sig/anthropic/models/beta/beta_tool_union.rbs +5 -4
- data/sig/anthropic/models/beta/message_count_tokens_params.rbs +5 -4
- data/sig/anthropic/models/citation_char_location.rbs +5 -0
- data/sig/anthropic/models/citation_content_block_location.rbs +5 -0
- data/sig/anthropic/models/citation_page_location.rbs +5 -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.rbs +2 -2
- data/sig/anthropic/models/content_block_param.rbs +6 -5
- data/sig/anthropic/models/message_count_tokens_tool.rbs +2 -0
- data/sig/anthropic/models/model.rbs +4 -10
- data/sig/anthropic/models/raw_content_block_start_event.rbs +2 -2
- 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.rbs +14 -3
- data/sig/anthropic/models/tool_result_block_param.rbs +4 -1
- data/sig/anthropic/models/tool_text_editor_20250429.rbs +30 -0
- data/sig/anthropic/models/tool_text_editor_20250728.rbs +35 -0
- data/sig/anthropic/models/tool_union.rbs +2 -0
- data/sig/anthropic/models.rbs +10 -0
- data/sig/anthropic/streaming.rbs +3 -0
- metadata +44 -3
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
module Anthropic
|
|
2
|
+
module Helpers
|
|
3
|
+
module Streaming
|
|
4
|
+
type raw_message_event =
|
|
5
|
+
Anthropic::Models::raw_message_start_event
|
|
6
|
+
| Anthropic::Models::raw_message_delta_event
|
|
7
|
+
| Anthropic::Models::raw_message_stop_event
|
|
8
|
+
| Anthropic::Models::raw_content_block_start_event
|
|
9
|
+
| Anthropic::Models::raw_content_block_delta_event
|
|
10
|
+
| Anthropic::Models::raw_content_block_stop_event
|
|
11
|
+
|
|
12
|
+
type stream_event =
|
|
13
|
+
raw_message_event
|
|
14
|
+
| text_event
|
|
15
|
+
| citation_event
|
|
16
|
+
| thinking_event
|
|
17
|
+
| signature_event
|
|
18
|
+
| input_json_event
|
|
19
|
+
| message_stop_event
|
|
20
|
+
| content_block_stop_event
|
|
21
|
+
|
|
22
|
+
class MessageStream
|
|
23
|
+
include Anthropic::Internal::Type::BaseStream[raw_message_event, stream_event]
|
|
24
|
+
|
|
25
|
+
@raw_stream: Anthropic::Internal::Stream[raw_message_event]
|
|
26
|
+
@accumated_message_snapshot: Anthropic::Models::message?
|
|
27
|
+
@iterator: Enumerable[stream_event]?
|
|
28
|
+
|
|
29
|
+
def initialize: (
|
|
30
|
+
raw_stream: Anthropic::Internal::Stream[raw_message_event]
|
|
31
|
+
) -> void
|
|
32
|
+
|
|
33
|
+
def until_done: -> void
|
|
34
|
+
|
|
35
|
+
def text: -> Enumerator[String]
|
|
36
|
+
|
|
37
|
+
def accumulated_message: -> Anthropic::Models::message
|
|
38
|
+
|
|
39
|
+
def accumulated_text: -> String
|
|
40
|
+
|
|
41
|
+
private
|
|
42
|
+
|
|
43
|
+
def iterator: -> Enumerable[stream_event]
|
|
44
|
+
|
|
45
|
+
def accumulate_event: (
|
|
46
|
+
event: raw_message_event,
|
|
47
|
+
current_snapshot: Anthropic::Models::message?
|
|
48
|
+
) -> Anthropic::Models::message
|
|
49
|
+
|
|
50
|
+
def build_events: (
|
|
51
|
+
event: raw_message_event,
|
|
52
|
+
message_snapshot: Anthropic::Models::message
|
|
53
|
+
) -> ::Array[stream_event]
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
end
|
|
@@ -8,8 +8,10 @@ module Anthropic
|
|
|
8
8
|
|
|
9
9
|
type coerce_state =
|
|
10
10
|
{
|
|
11
|
-
|
|
11
|
+
translate_names: bool,
|
|
12
|
+
strictness: bool,
|
|
12
13
|
exactness: { yes: Integer, no: Integer, maybe: Integer },
|
|
14
|
+
error: Class,
|
|
13
15
|
branched: Integer
|
|
14
16
|
}
|
|
15
17
|
|
|
@@ -37,6 +39,27 @@ module Anthropic
|
|
|
37
39
|
| Anthropic::Internal::Type::Converter::input spec
|
|
38
40
|
) -> (^-> top)
|
|
39
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
|
+
|
|
59
|
+
def self.new_coerce_state: (
|
|
60
|
+
?translate_names: bool
|
|
61
|
+
) -> Anthropic::Internal::Type::Converter::coerce_state
|
|
62
|
+
|
|
40
63
|
def self.coerce: (
|
|
41
64
|
Anthropic::Internal::Type::Converter::input target,
|
|
42
65
|
top value,
|
|
@@ -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
|
|
@@ -3,64 +3,7 @@ module Anthropic
|
|
|
3
3
|
class BetaBase64PDFBlock = Beta::BetaBase64PDFBlock
|
|
4
4
|
|
|
5
5
|
module Beta
|
|
6
|
-
|
|
7
|
-
{
|
|
8
|
-
source: Anthropic::Models::Beta::BetaBase64PDFBlock::source,
|
|
9
|
-
type: :document,
|
|
10
|
-
cache_control: Anthropic::Beta::BetaCacheControlEphemeral?,
|
|
11
|
-
citations: Anthropic::Beta::BetaCitationsConfigParam,
|
|
12
|
-
context: String?,
|
|
13
|
-
title: String?
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
class BetaBase64PDFBlock < Anthropic::Internal::Type::BaseModel
|
|
17
|
-
attr_accessor source: Anthropic::Models::Beta::BetaBase64PDFBlock::source
|
|
18
|
-
|
|
19
|
-
attr_accessor type: :document
|
|
20
|
-
|
|
21
|
-
attr_accessor cache_control: Anthropic::Beta::BetaCacheControlEphemeral?
|
|
22
|
-
|
|
23
|
-
attr_reader citations: Anthropic::Beta::BetaCitationsConfigParam?
|
|
24
|
-
|
|
25
|
-
def citations=: (
|
|
26
|
-
Anthropic::Beta::BetaCitationsConfigParam
|
|
27
|
-
) -> Anthropic::Beta::BetaCitationsConfigParam
|
|
28
|
-
|
|
29
|
-
attr_accessor context: String?
|
|
30
|
-
|
|
31
|
-
attr_accessor title: String?
|
|
32
|
-
|
|
33
|
-
def initialize: (
|
|
34
|
-
source: Anthropic::Models::Beta::BetaBase64PDFBlock::source,
|
|
35
|
-
?cache_control: Anthropic::Beta::BetaCacheControlEphemeral?,
|
|
36
|
-
?citations: Anthropic::Beta::BetaCitationsConfigParam,
|
|
37
|
-
?context: String?,
|
|
38
|
-
?title: String?,
|
|
39
|
-
?type: :document
|
|
40
|
-
) -> void
|
|
41
|
-
|
|
42
|
-
def to_hash: -> {
|
|
43
|
-
source: Anthropic::Models::Beta::BetaBase64PDFBlock::source,
|
|
44
|
-
type: :document,
|
|
45
|
-
cache_control: Anthropic::Beta::BetaCacheControlEphemeral?,
|
|
46
|
-
citations: Anthropic::Beta::BetaCitationsConfigParam,
|
|
47
|
-
context: String?,
|
|
48
|
-
title: String?
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
type source =
|
|
52
|
-
Anthropic::Beta::BetaBase64PDFSource
|
|
53
|
-
| Anthropic::Beta::BetaPlainTextSource
|
|
54
|
-
| Anthropic::Beta::BetaContentBlockSource
|
|
55
|
-
| Anthropic::Beta::BetaURLPDFSource
|
|
56
|
-
| Anthropic::Beta::BetaFileDocumentSource
|
|
57
|
-
|
|
58
|
-
module Source
|
|
59
|
-
extend Anthropic::Internal::Type::Union
|
|
60
|
-
|
|
61
|
-
def self?.variants: -> ::Array[Anthropic::Models::Beta::BetaBase64PDFBlock::source]
|
|
62
|
-
end
|
|
63
|
-
end
|
|
6
|
+
class BetaBase64PDFBlock = Anthropic::Models::Beta::BetaRequestDocumentBlock
|
|
64
7
|
end
|
|
65
8
|
end
|
|
66
9
|
end
|
|
@@ -9,6 +9,7 @@ module Anthropic
|
|
|
9
9
|
document_index: Integer,
|
|
10
10
|
document_title: String?,
|
|
11
11
|
end_char_index: Integer,
|
|
12
|
+
file_id: String?,
|
|
12
13
|
start_char_index: Integer,
|
|
13
14
|
type: :char_location
|
|
14
15
|
}
|
|
@@ -22,6 +23,8 @@ module Anthropic
|
|
|
22
23
|
|
|
23
24
|
attr_accessor end_char_index: Integer
|
|
24
25
|
|
|
26
|
+
attr_accessor file_id: String?
|
|
27
|
+
|
|
25
28
|
attr_accessor start_char_index: Integer
|
|
26
29
|
|
|
27
30
|
attr_accessor type: :char_location
|
|
@@ -31,6 +34,7 @@ module Anthropic
|
|
|
31
34
|
document_index: Integer,
|
|
32
35
|
document_title: String?,
|
|
33
36
|
end_char_index: Integer,
|
|
37
|
+
file_id: String?,
|
|
34
38
|
start_char_index: Integer,
|
|
35
39
|
?type: :char_location
|
|
36
40
|
) -> void
|
|
@@ -40,6 +44,7 @@ module Anthropic
|
|
|
40
44
|
document_index: Integer,
|
|
41
45
|
document_title: String?,
|
|
42
46
|
end_char_index: Integer,
|
|
47
|
+
file_id: String?,
|
|
43
48
|
start_char_index: Integer,
|
|
44
49
|
type: :char_location
|
|
45
50
|
}
|
|
@@ -9,6 +9,7 @@ module Anthropic
|
|
|
9
9
|
document_index: Integer,
|
|
10
10
|
document_title: String?,
|
|
11
11
|
end_block_index: Integer,
|
|
12
|
+
file_id: String?,
|
|
12
13
|
start_block_index: Integer,
|
|
13
14
|
type: :content_block_location
|
|
14
15
|
}
|
|
@@ -22,6 +23,8 @@ module Anthropic
|
|
|
22
23
|
|
|
23
24
|
attr_accessor end_block_index: Integer
|
|
24
25
|
|
|
26
|
+
attr_accessor file_id: String?
|
|
27
|
+
|
|
25
28
|
attr_accessor start_block_index: Integer
|
|
26
29
|
|
|
27
30
|
attr_accessor type: :content_block_location
|
|
@@ -31,6 +34,7 @@ module Anthropic
|
|
|
31
34
|
document_index: Integer,
|
|
32
35
|
document_title: String?,
|
|
33
36
|
end_block_index: Integer,
|
|
37
|
+
file_id: String?,
|
|
34
38
|
start_block_index: Integer,
|
|
35
39
|
?type: :content_block_location
|
|
36
40
|
) -> void
|
|
@@ -40,6 +44,7 @@ module Anthropic
|
|
|
40
44
|
document_index: Integer,
|
|
41
45
|
document_title: String?,
|
|
42
46
|
end_block_index: Integer,
|
|
47
|
+
file_id: String?,
|
|
43
48
|
start_block_index: Integer,
|
|
44
49
|
type: :content_block_location
|
|
45
50
|
}
|
|
@@ -9,6 +9,7 @@ module Anthropic
|
|
|
9
9
|
document_index: Integer,
|
|
10
10
|
document_title: String?,
|
|
11
11
|
end_page_number: Integer,
|
|
12
|
+
file_id: String?,
|
|
12
13
|
start_page_number: Integer,
|
|
13
14
|
type: :page_location
|
|
14
15
|
}
|
|
@@ -22,6 +23,8 @@ module Anthropic
|
|
|
22
23
|
|
|
23
24
|
attr_accessor end_page_number: Integer
|
|
24
25
|
|
|
26
|
+
attr_accessor file_id: String?
|
|
27
|
+
|
|
25
28
|
attr_accessor start_page_number: Integer
|
|
26
29
|
|
|
27
30
|
attr_accessor type: :page_location
|
|
@@ -31,6 +34,7 @@ module Anthropic
|
|
|
31
34
|
document_index: Integer,
|
|
32
35
|
document_title: String?,
|
|
33
36
|
end_page_number: Integer,
|
|
37
|
+
file_id: String?,
|
|
34
38
|
start_page_number: Integer,
|
|
35
39
|
?type: :page_location
|
|
36
40
|
) -> void
|
|
@@ -40,6 +44,7 @@ module Anthropic
|
|
|
40
44
|
document_index: Integer,
|
|
41
45
|
document_title: String?,
|
|
42
46
|
end_page_number: Integer,
|
|
47
|
+
file_id: String?,
|
|
43
48
|
start_page_number: Integer,
|
|
44
49
|
type: :page_location
|
|
45
50
|
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
module Anthropic
|
|
2
|
+
module Models
|
|
3
|
+
class BetaCitationSearchResultLocation = Beta::BetaCitationSearchResultLocation
|
|
4
|
+
|
|
5
|
+
module Beta
|
|
6
|
+
type beta_citation_search_result_location =
|
|
7
|
+
{
|
|
8
|
+
cited_text: String,
|
|
9
|
+
end_block_index: Integer,
|
|
10
|
+
search_result_index: Integer,
|
|
11
|
+
source: String,
|
|
12
|
+
start_block_index: Integer,
|
|
13
|
+
title: String?,
|
|
14
|
+
type: :search_result_location
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
class BetaCitationSearchResultLocation < Anthropic::Internal::Type::BaseModel
|
|
18
|
+
attr_accessor cited_text: String
|
|
19
|
+
|
|
20
|
+
attr_accessor end_block_index: Integer
|
|
21
|
+
|
|
22
|
+
attr_accessor search_result_index: Integer
|
|
23
|
+
|
|
24
|
+
attr_accessor source: String
|
|
25
|
+
|
|
26
|
+
attr_accessor start_block_index: Integer
|
|
27
|
+
|
|
28
|
+
attr_accessor title: String?
|
|
29
|
+
|
|
30
|
+
attr_accessor type: :search_result_location
|
|
31
|
+
|
|
32
|
+
def initialize: (
|
|
33
|
+
cited_text: String,
|
|
34
|
+
end_block_index: Integer,
|
|
35
|
+
search_result_index: Integer,
|
|
36
|
+
source: String,
|
|
37
|
+
start_block_index: Integer,
|
|
38
|
+
title: String?,
|
|
39
|
+
?type: :search_result_location
|
|
40
|
+
) -> void
|
|
41
|
+
|
|
42
|
+
def to_hash: -> {
|
|
43
|
+
cited_text: String,
|
|
44
|
+
end_block_index: Integer,
|
|
45
|
+
search_result_index: Integer,
|
|
46
|
+
source: String,
|
|
47
|
+
start_block_index: Integer,
|
|
48
|
+
title: String?,
|
|
49
|
+
type: :search_result_location
|
|
50
|
+
}
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
end
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
module Anthropic
|
|
2
|
+
module Models
|
|
3
|
+
class BetaCitationSearchResultLocationParam = Beta::BetaCitationSearchResultLocationParam
|
|
4
|
+
|
|
5
|
+
module Beta
|
|
6
|
+
type beta_citation_search_result_location_param =
|
|
7
|
+
{
|
|
8
|
+
cited_text: String,
|
|
9
|
+
end_block_index: Integer,
|
|
10
|
+
search_result_index: Integer,
|
|
11
|
+
source: String,
|
|
12
|
+
start_block_index: Integer,
|
|
13
|
+
title: String?,
|
|
14
|
+
type: :search_result_location
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
class BetaCitationSearchResultLocationParam < Anthropic::Internal::Type::BaseModel
|
|
18
|
+
attr_accessor cited_text: String
|
|
19
|
+
|
|
20
|
+
attr_accessor end_block_index: Integer
|
|
21
|
+
|
|
22
|
+
attr_accessor search_result_index: Integer
|
|
23
|
+
|
|
24
|
+
attr_accessor source: String
|
|
25
|
+
|
|
26
|
+
attr_accessor start_block_index: Integer
|
|
27
|
+
|
|
28
|
+
attr_accessor title: String?
|
|
29
|
+
|
|
30
|
+
attr_accessor type: :search_result_location
|
|
31
|
+
|
|
32
|
+
def initialize: (
|
|
33
|
+
cited_text: String,
|
|
34
|
+
end_block_index: Integer,
|
|
35
|
+
search_result_index: Integer,
|
|
36
|
+
source: String,
|
|
37
|
+
start_block_index: Integer,
|
|
38
|
+
title: String?,
|
|
39
|
+
?type: :search_result_location
|
|
40
|
+
) -> void
|
|
41
|
+
|
|
42
|
+
def to_hash: -> {
|
|
43
|
+
cited_text: String,
|
|
44
|
+
end_block_index: Integer,
|
|
45
|
+
search_result_index: Integer,
|
|
46
|
+
source: String,
|
|
47
|
+
start_block_index: Integer,
|
|
48
|
+
title: String?,
|
|
49
|
+
type: :search_result_location
|
|
50
|
+
}
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
end
|
|
@@ -29,6 +29,7 @@ module Anthropic
|
|
|
29
29
|
| Anthropic::Beta::BetaCitationPageLocation
|
|
30
30
|
| Anthropic::Beta::BetaCitationContentBlockLocation
|
|
31
31
|
| Anthropic::Beta::BetaCitationsWebSearchResultLocation
|
|
32
|
+
| Anthropic::Beta::BetaCitationSearchResultLocation
|
|
32
33
|
|
|
33
34
|
module Citation
|
|
34
35
|
extend Anthropic::Internal::Type::Union
|
|
@@ -5,6 +5,8 @@ module Anthropic
|
|
|
5
5
|
module Beta
|
|
6
6
|
type beta_content_block =
|
|
7
7
|
Anthropic::Beta::BetaTextBlock
|
|
8
|
+
| Anthropic::Beta::BetaThinkingBlock
|
|
9
|
+
| Anthropic::Beta::BetaRedactedThinkingBlock
|
|
8
10
|
| Anthropic::Beta::BetaToolUseBlock
|
|
9
11
|
| Anthropic::Beta::BetaServerToolUseBlock
|
|
10
12
|
| Anthropic::Beta::BetaWebSearchToolResultBlock
|
|
@@ -12,8 +14,6 @@ module Anthropic
|
|
|
12
14
|
| Anthropic::Beta::BetaMCPToolUseBlock
|
|
13
15
|
| Anthropic::Beta::BetaMCPToolResultBlock
|
|
14
16
|
| Anthropic::Beta::BetaContainerUploadBlock
|
|
15
|
-
| Anthropic::Beta::BetaThinkingBlock
|
|
16
|
-
| Anthropic::Beta::BetaRedactedThinkingBlock
|
|
17
17
|
|
|
18
18
|
module BetaContentBlock
|
|
19
19
|
extend Anthropic::Internal::Type::Union
|
|
@@ -4,18 +4,19 @@ module Anthropic
|
|
|
4
4
|
|
|
5
5
|
module Beta
|
|
6
6
|
type beta_content_block_param =
|
|
7
|
-
Anthropic::Beta::
|
|
7
|
+
Anthropic::Beta::BetaTextBlockParam
|
|
8
|
+
| Anthropic::Beta::BetaImageBlockParam
|
|
9
|
+
| Anthropic::Beta::BetaRequestDocumentBlock
|
|
10
|
+
| Anthropic::Beta::BetaSearchResultBlockParam
|
|
11
|
+
| Anthropic::Beta::BetaThinkingBlockParam
|
|
12
|
+
| Anthropic::Beta::BetaRedactedThinkingBlockParam
|
|
13
|
+
| Anthropic::Beta::BetaToolUseBlockParam
|
|
14
|
+
| Anthropic::Beta::BetaToolResultBlockParam
|
|
15
|
+
| Anthropic::Beta::BetaServerToolUseBlockParam
|
|
8
16
|
| Anthropic::Beta::BetaWebSearchToolResultBlockParam
|
|
9
17
|
| Anthropic::Beta::BetaCodeExecutionToolResultBlockParam
|
|
10
18
|
| Anthropic::Beta::BetaMCPToolUseBlockParam
|
|
11
19
|
| Anthropic::Beta::BetaRequestMCPToolResultBlockParam
|
|
12
|
-
| Anthropic::Beta::BetaTextBlockParam
|
|
13
|
-
| Anthropic::Beta::BetaImageBlockParam
|
|
14
|
-
| Anthropic::Beta::BetaToolUseBlockParam
|
|
15
|
-
| Anthropic::Beta::BetaToolResultBlockParam
|
|
16
|
-
| Anthropic::Beta::BetaBase64PDFBlock
|
|
17
|
-
| Anthropic::Beta::BetaThinkingBlockParam
|
|
18
|
-
| Anthropic::Beta::BetaRedactedThinkingBlockParam
|
|
19
20
|
| Anthropic::Beta::BetaContainerUploadBlockParam
|
|
20
21
|
|
|
21
22
|
module BetaContentBlockParam
|
|
@@ -31,6 +31,8 @@ module Anthropic
|
|
|
31
31
|
|
|
32
32
|
type content_block =
|
|
33
33
|
Anthropic::Beta::BetaTextBlock
|
|
34
|
+
| Anthropic::Beta::BetaThinkingBlock
|
|
35
|
+
| Anthropic::Beta::BetaRedactedThinkingBlock
|
|
34
36
|
| Anthropic::Beta::BetaToolUseBlock
|
|
35
37
|
| Anthropic::Beta::BetaServerToolUseBlock
|
|
36
38
|
| Anthropic::Beta::BetaWebSearchToolResultBlock
|
|
@@ -38,8 +40,6 @@ module Anthropic
|
|
|
38
40
|
| Anthropic::Beta::BetaMCPToolUseBlock
|
|
39
41
|
| Anthropic::Beta::BetaMCPToolResultBlock
|
|
40
42
|
| Anthropic::Beta::BetaContainerUploadBlock
|
|
41
|
-
| Anthropic::Beta::BetaThinkingBlock
|
|
42
|
-
| Anthropic::Beta::BetaRedactedThinkingBlock
|
|
43
43
|
|
|
44
44
|
module ContentBlock
|
|
45
45
|
extend Anthropic::Internal::Type::Union
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
module Anthropic
|
|
2
|
+
module Models
|
|
3
|
+
class BetaRequestDocumentBlock = Beta::BetaRequestDocumentBlock
|
|
4
|
+
|
|
5
|
+
module Beta
|
|
6
|
+
type beta_request_document_block =
|
|
7
|
+
{
|
|
8
|
+
source: Anthropic::Models::Beta::BetaRequestDocumentBlock::source,
|
|
9
|
+
type: :document,
|
|
10
|
+
cache_control: Anthropic::Beta::BetaCacheControlEphemeral?,
|
|
11
|
+
citations: Anthropic::Beta::BetaCitationsConfigParam,
|
|
12
|
+
context: String?,
|
|
13
|
+
title: String?
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
class BetaRequestDocumentBlock < Anthropic::Internal::Type::BaseModel
|
|
17
|
+
attr_accessor source: Anthropic::Models::Beta::BetaRequestDocumentBlock::source
|
|
18
|
+
|
|
19
|
+
attr_accessor type: :document
|
|
20
|
+
|
|
21
|
+
attr_accessor cache_control: Anthropic::Beta::BetaCacheControlEphemeral?
|
|
22
|
+
|
|
23
|
+
attr_reader citations: Anthropic::Beta::BetaCitationsConfigParam?
|
|
24
|
+
|
|
25
|
+
def citations=: (
|
|
26
|
+
Anthropic::Beta::BetaCitationsConfigParam
|
|
27
|
+
) -> Anthropic::Beta::BetaCitationsConfigParam
|
|
28
|
+
|
|
29
|
+
attr_accessor context: String?
|
|
30
|
+
|
|
31
|
+
attr_accessor title: String?
|
|
32
|
+
|
|
33
|
+
def initialize: (
|
|
34
|
+
source: Anthropic::Models::Beta::BetaRequestDocumentBlock::source,
|
|
35
|
+
?cache_control: Anthropic::Beta::BetaCacheControlEphemeral?,
|
|
36
|
+
?citations: Anthropic::Beta::BetaCitationsConfigParam,
|
|
37
|
+
?context: String?,
|
|
38
|
+
?title: String?,
|
|
39
|
+
?type: :document
|
|
40
|
+
) -> void
|
|
41
|
+
|
|
42
|
+
def to_hash: -> {
|
|
43
|
+
source: Anthropic::Models::Beta::BetaRequestDocumentBlock::source,
|
|
44
|
+
type: :document,
|
|
45
|
+
cache_control: Anthropic::Beta::BetaCacheControlEphemeral?,
|
|
46
|
+
citations: Anthropic::Beta::BetaCitationsConfigParam,
|
|
47
|
+
context: String?,
|
|
48
|
+
title: String?
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
type source =
|
|
52
|
+
Anthropic::Beta::BetaBase64PDFSource
|
|
53
|
+
| Anthropic::Beta::BetaPlainTextSource
|
|
54
|
+
| Anthropic::Beta::BetaContentBlockSource
|
|
55
|
+
| Anthropic::Beta::BetaURLPDFSource
|
|
56
|
+
| Anthropic::Beta::BetaFileDocumentSource
|
|
57
|
+
|
|
58
|
+
module Source
|
|
59
|
+
extend Anthropic::Internal::Type::Union
|
|
60
|
+
|
|
61
|
+
def self?.variants: -> ::Array[Anthropic::Models::Beta::BetaRequestDocumentBlock::source]
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
end
|
|
65
|
+
end
|
|
66
|
+
end
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
module Anthropic
|
|
2
|
+
module Models
|
|
3
|
+
class BetaSearchResultBlockParam = Beta::BetaSearchResultBlockParam
|
|
4
|
+
|
|
5
|
+
module Beta
|
|
6
|
+
type beta_search_result_block_param =
|
|
7
|
+
{
|
|
8
|
+
content: ::Array[Anthropic::Beta::BetaTextBlockParam],
|
|
9
|
+
source: String,
|
|
10
|
+
title: String,
|
|
11
|
+
type: :search_result,
|
|
12
|
+
cache_control: Anthropic::Beta::BetaCacheControlEphemeral?,
|
|
13
|
+
citations: Anthropic::Beta::BetaCitationsConfigParam
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
class BetaSearchResultBlockParam < Anthropic::Internal::Type::BaseModel
|
|
17
|
+
attr_accessor content: ::Array[Anthropic::Beta::BetaTextBlockParam]
|
|
18
|
+
|
|
19
|
+
attr_accessor source: String
|
|
20
|
+
|
|
21
|
+
attr_accessor title: String
|
|
22
|
+
|
|
23
|
+
attr_accessor type: :search_result
|
|
24
|
+
|
|
25
|
+
attr_accessor cache_control: Anthropic::Beta::BetaCacheControlEphemeral?
|
|
26
|
+
|
|
27
|
+
attr_reader citations: Anthropic::Beta::BetaCitationsConfigParam?
|
|
28
|
+
|
|
29
|
+
def citations=: (
|
|
30
|
+
Anthropic::Beta::BetaCitationsConfigParam
|
|
31
|
+
) -> Anthropic::Beta::BetaCitationsConfigParam
|
|
32
|
+
|
|
33
|
+
def initialize: (
|
|
34
|
+
content: ::Array[Anthropic::Beta::BetaTextBlockParam],
|
|
35
|
+
source: String,
|
|
36
|
+
title: String,
|
|
37
|
+
?cache_control: Anthropic::Beta::BetaCacheControlEphemeral?,
|
|
38
|
+
?citations: Anthropic::Beta::BetaCitationsConfigParam,
|
|
39
|
+
?type: :search_result
|
|
40
|
+
) -> void
|
|
41
|
+
|
|
42
|
+
def to_hash: -> {
|
|
43
|
+
content: ::Array[Anthropic::Beta::BetaTextBlockParam],
|
|
44
|
+
source: String,
|
|
45
|
+
title: String,
|
|
46
|
+
type: :search_result,
|
|
47
|
+
cache_control: Anthropic::Beta::BetaCacheControlEphemeral?,
|
|
48
|
+
citations: Anthropic::Beta::BetaCitationsConfigParam
|
|
49
|
+
}
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
end
|
|
@@ -8,6 +8,7 @@ module Anthropic
|
|
|
8
8
|
| Anthropic::Beta::BetaCitationPageLocation
|
|
9
9
|
| Anthropic::Beta::BetaCitationContentBlockLocation
|
|
10
10
|
| Anthropic::Beta::BetaCitationsWebSearchResultLocation
|
|
11
|
+
| Anthropic::Beta::BetaCitationSearchResultLocation
|
|
11
12
|
|
|
12
13
|
module BetaTextCitation
|
|
13
14
|
extend Anthropic::Internal::Type::Union
|
|
@@ -8,6 +8,7 @@ module Anthropic
|
|
|
8
8
|
| Anthropic::Beta::BetaCitationPageLocationParam
|
|
9
9
|
| Anthropic::Beta::BetaCitationContentBlockLocationParam
|
|
10
10
|
| Anthropic::Beta::BetaCitationWebSearchResultLocationParam
|
|
11
|
+
| Anthropic::Beta::BetaCitationSearchResultLocationParam
|
|
11
12
|
|
|
12
13
|
module BetaTextCitationParam
|
|
13
14
|
extend Anthropic::Internal::Type::Union
|
|
@@ -41,16 +41,27 @@ module Anthropic
|
|
|
41
41
|
type: Anthropic::Models::Beta::BetaTool::type_?
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
type input_schema =
|
|
44
|
+
type input_schema =
|
|
45
|
+
{ type: :object, properties: top?, required: ::Array[String]? }
|
|
45
46
|
|
|
46
47
|
class InputSchema < Anthropic::Internal::Type::BaseModel
|
|
47
48
|
attr_accessor type: :object
|
|
48
49
|
|
|
49
50
|
attr_accessor properties: top?
|
|
50
51
|
|
|
51
|
-
|
|
52
|
+
attr_accessor required: ::Array[String]?
|
|
52
53
|
|
|
53
|
-
def
|
|
54
|
+
def initialize: (
|
|
55
|
+
?properties: top?,
|
|
56
|
+
?required: ::Array[String]?,
|
|
57
|
+
?type: :object
|
|
58
|
+
) -> void
|
|
59
|
+
|
|
60
|
+
def to_hash: -> {
|
|
61
|
+
type: :object,
|
|
62
|
+
properties: top?,
|
|
63
|
+
required: ::Array[String]?
|
|
64
|
+
}
|
|
54
65
|
end
|
|
55
66
|
|
|
56
67
|
type type_ = :custom
|