anthropic 1.1.1 → 1.2.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 +45 -0
- data/README.md +32 -16
- data/lib/anthropic/errors.rb +22 -0
- 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 +10 -2
- data/lib/anthropic/internal/type/array_of.rb +6 -1
- data/lib/anthropic/internal/type/base_model.rb +77 -23
- 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 +42 -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 +6 -1
- data/lib/anthropic/internal/type/union.rb +17 -9
- data/lib/anthropic/internal/type/unknown.rb +7 -1
- data/lib/anthropic/internal/util.rb +8 -9
- data/lib/anthropic/models/beta/beta_base64_pdf_block.rb +1 -65
- 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_union.rb +7 -7
- data/lib/anthropic/models/beta/message_count_tokens_params.rb +16 -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/content_block.rb +5 -5
- data/lib/anthropic/models/content_block_param.rb +11 -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 +35 -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 +6 -0
- data/lib/anthropic/models/raw_content_block_start_event.rb +7 -7
- data/lib/anthropic/models/tool.rb +7 -1
- data/lib/anthropic/models/tool_union.rb +34 -1
- data/lib/anthropic/models/tool_use_block.rb +6 -0
- data/lib/anthropic/models.rb +4 -4
- data/lib/anthropic/resources/beta/messages.rb +5 -5
- 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 +8 -0
- data/rbi/anthropic/errors.rbi +16 -0
- data/rbi/anthropic/helpers/streaming/events.rbi +85 -0
- data/rbi/anthropic/helpers/streaming/message_stream.rbi +59 -0
- 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 +15 -15
- data/rbi/anthropic/internal/type/union.rbi +5 -0
- data/rbi/anthropic/internal/type/unknown.rbi +2 -0
- data/rbi/anthropic/internal/util.rbi +2 -0
- data/rbi/anthropic/models/beta/beta_base64_pdf_block.rbi +1 -128
- 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_union.rbi +5 -5
- data/rbi/anthropic/models/beta/message_count_tokens_params.rbi +39 -27
- data/rbi/anthropic/models/beta/message_create_params.rbi +34 -22
- data/rbi/anthropic/models/beta/messages/batch_create_params.rbi +34 -22
- data/rbi/anthropic/models/content_block.rbi +3 -3
- data/rbi/anthropic/models/content_block_param.rbi +5 -5
- data/rbi/anthropic/models/message.rbi +11 -3
- data/rbi/anthropic/models/message_count_tokens_params.rbi +18 -2
- data/rbi/anthropic/models/message_count_tokens_tool.rbi +61 -0
- data/rbi/anthropic/models/message_create_params.rbi +18 -2
- data/rbi/anthropic/models/messages/batch_create_params.rbi +18 -2
- data/rbi/anthropic/models/raw_content_block_start_event.rbi +6 -6
- data/rbi/anthropic/models/tool.rbi +16 -5
- data/rbi/anthropic/models/tool_union.rbi +61 -0
- data/rbi/anthropic/resources/beta/messages.rbi +36 -18
- data/rbi/anthropic/resources/messages.rbi +293 -3
- data/rbi/anthropic/streaming.rbi +5 -0
- data/sig/anthropic/errors.rbs +9 -0
- data/sig/anthropic/helpers/streaming/events.rbs +119 -0
- data/sig/anthropic/helpers/streaming/message_stream.rbs +55 -0
- data/sig/anthropic/internal/type/base_stream.rbs +4 -0
- data/sig/anthropic/internal/type/converter.rbs +7 -1
- data/sig/anthropic/models/beta/beta_base64_pdf_block.rbs +1 -58
- 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_union.rbs +4 -4
- data/sig/anthropic/models/beta/message_count_tokens_params.rbs +4 -4
- data/sig/anthropic/models/content_block.rbs +2 -2
- data/sig/anthropic/models/content_block_param.rbs +5 -5
- data/sig/anthropic/models/message_count_tokens_tool.rbs +28 -0
- data/sig/anthropic/models/raw_content_block_start_event.rbs +2 -2
- data/sig/anthropic/models/tool.rbs +14 -3
- data/sig/anthropic/models/tool_union.rbs +28 -0
- data/sig/anthropic/streaming.rbs +3 -0
- metadata +26 -3
@@ -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
|
@@ -5,15 +5,15 @@ module Anthropic
|
|
5
5
|
module Beta
|
6
6
|
type beta_tool_union =
|
7
7
|
Anthropic::Beta::BetaTool
|
8
|
-
| Anthropic::Beta::BetaToolComputerUse20241022
|
9
8
|
| Anthropic::Beta::BetaToolBash20241022
|
10
|
-
| Anthropic::Beta::BetaToolTextEditor20241022
|
11
|
-
| Anthropic::Beta::BetaToolComputerUse20250124
|
12
9
|
| Anthropic::Beta::BetaToolBash20250124
|
10
|
+
| Anthropic::Beta::BetaCodeExecutionTool20250522
|
11
|
+
| Anthropic::Beta::BetaToolComputerUse20241022
|
12
|
+
| Anthropic::Beta::BetaToolComputerUse20250124
|
13
|
+
| Anthropic::Beta::BetaToolTextEditor20241022
|
13
14
|
| Anthropic::Beta::BetaToolTextEditor20250124
|
14
15
|
| Anthropic::Beta::BetaToolTextEditor20250429
|
15
16
|
| Anthropic::Beta::BetaWebSearchTool20250305
|
16
|
-
| Anthropic::Beta::BetaCodeExecutionTool20250522
|
17
17
|
|
18
18
|
module BetaToolUnion
|
19
19
|
extend Anthropic::Internal::Type::Union
|
@@ -94,15 +94,15 @@ module Anthropic
|
|
94
94
|
|
95
95
|
type tool =
|
96
96
|
Anthropic::Beta::BetaTool
|
97
|
-
| Anthropic::Beta::BetaToolComputerUse20241022
|
98
97
|
| Anthropic::Beta::BetaToolBash20241022
|
99
|
-
| Anthropic::Beta::BetaToolTextEditor20241022
|
100
|
-
| Anthropic::Beta::BetaToolComputerUse20250124
|
101
98
|
| Anthropic::Beta::BetaToolBash20250124
|
99
|
+
| Anthropic::Beta::BetaCodeExecutionTool20250522
|
100
|
+
| Anthropic::Beta::BetaToolComputerUse20241022
|
101
|
+
| Anthropic::Beta::BetaToolComputerUse20250124
|
102
|
+
| Anthropic::Beta::BetaToolTextEditor20241022
|
102
103
|
| Anthropic::Beta::BetaToolTextEditor20250124
|
103
104
|
| Anthropic::Beta::BetaToolTextEditor20250429
|
104
105
|
| Anthropic::Beta::BetaWebSearchTool20250305
|
105
|
-
| Anthropic::Beta::BetaCodeExecutionTool20250522
|
106
106
|
|
107
107
|
module Tool
|
108
108
|
extend Anthropic::Internal::Type::Union
|
@@ -2,11 +2,11 @@ module Anthropic
|
|
2
2
|
module Models
|
3
3
|
type content_block =
|
4
4
|
Anthropic::TextBlock
|
5
|
+
| Anthropic::ThinkingBlock
|
6
|
+
| Anthropic::RedactedThinkingBlock
|
5
7
|
| Anthropic::ToolUseBlock
|
6
8
|
| Anthropic::ServerToolUseBlock
|
7
9
|
| Anthropic::WebSearchToolResultBlock
|
8
|
-
| Anthropic::ThinkingBlock
|
9
|
-
| Anthropic::RedactedThinkingBlock
|
10
10
|
|
11
11
|
module ContentBlock
|
12
12
|
extend Anthropic::Internal::Type::Union
|
@@ -1,15 +1,15 @@
|
|
1
1
|
module Anthropic
|
2
2
|
module Models
|
3
3
|
type content_block_param =
|
4
|
-
Anthropic::
|
5
|
-
| Anthropic::WebSearchToolResultBlockParam
|
6
|
-
| Anthropic::TextBlockParam
|
4
|
+
Anthropic::TextBlockParam
|
7
5
|
| Anthropic::ImageBlockParam
|
8
|
-
| Anthropic::ToolUseBlockParam
|
9
|
-
| Anthropic::ToolResultBlockParam
|
10
6
|
| Anthropic::DocumentBlockParam
|
11
7
|
| Anthropic::ThinkingBlockParam
|
12
8
|
| Anthropic::RedactedThinkingBlockParam
|
9
|
+
| Anthropic::ToolUseBlockParam
|
10
|
+
| Anthropic::ToolResultBlockParam
|
11
|
+
| Anthropic::ServerToolUseBlockParam
|
12
|
+
| Anthropic::WebSearchToolResultBlockParam
|
13
13
|
|
14
14
|
module ContentBlockParam
|
15
15
|
extend Anthropic::Internal::Type::Union
|
@@ -4,11 +4,39 @@ module Anthropic
|
|
4
4
|
Anthropic::Tool
|
5
5
|
| Anthropic::ToolBash20250124
|
6
6
|
| Anthropic::ToolTextEditor20250124
|
7
|
+
| Anthropic::MessageCountTokensTool::TextEditor20250429
|
7
8
|
| Anthropic::WebSearchTool20250305
|
8
9
|
|
9
10
|
module MessageCountTokensTool
|
10
11
|
extend Anthropic::Internal::Type::Union
|
11
12
|
|
13
|
+
type text_editor20250429 =
|
14
|
+
{
|
15
|
+
name: :str_replace_based_edit_tool,
|
16
|
+
type: :text_editor_20250429,
|
17
|
+
cache_control: Anthropic::CacheControlEphemeral?
|
18
|
+
}
|
19
|
+
|
20
|
+
class TextEditor20250429 < Anthropic::Internal::Type::BaseModel
|
21
|
+
attr_accessor name: :str_replace_based_edit_tool
|
22
|
+
|
23
|
+
attr_accessor type: :text_editor_20250429
|
24
|
+
|
25
|
+
attr_accessor cache_control: Anthropic::CacheControlEphemeral?
|
26
|
+
|
27
|
+
def initialize: (
|
28
|
+
?cache_control: Anthropic::CacheControlEphemeral?,
|
29
|
+
?name: :str_replace_based_edit_tool,
|
30
|
+
?type: :text_editor_20250429
|
31
|
+
) -> void
|
32
|
+
|
33
|
+
def to_hash: -> {
|
34
|
+
name: :str_replace_based_edit_tool,
|
35
|
+
type: :text_editor_20250429,
|
36
|
+
cache_control: Anthropic::CacheControlEphemeral?
|
37
|
+
}
|
38
|
+
end
|
39
|
+
|
12
40
|
def self?.variants: -> ::Array[Anthropic::Models::message_count_tokens_tool]
|
13
41
|
end
|
14
42
|
end
|
@@ -28,11 +28,11 @@ module Anthropic
|
|
28
28
|
|
29
29
|
type content_block =
|
30
30
|
Anthropic::TextBlock
|
31
|
+
| Anthropic::ThinkingBlock
|
32
|
+
| Anthropic::RedactedThinkingBlock
|
31
33
|
| Anthropic::ToolUseBlock
|
32
34
|
| Anthropic::ServerToolUseBlock
|
33
35
|
| Anthropic::WebSearchToolResultBlock
|
34
|
-
| Anthropic::ThinkingBlock
|
35
|
-
| Anthropic::RedactedThinkingBlock
|
36
36
|
|
37
37
|
module ContentBlock
|
38
38
|
extend Anthropic::Internal::Type::Union
|
@@ -38,16 +38,27 @@ module Anthropic
|
|
38
38
|
type: Anthropic::Models::Tool::type_?
|
39
39
|
}
|
40
40
|
|
41
|
-
type input_schema =
|
41
|
+
type input_schema =
|
42
|
+
{ type: :object, properties: top?, required: ::Array[String]? }
|
42
43
|
|
43
44
|
class InputSchema < Anthropic::Internal::Type::BaseModel
|
44
45
|
attr_accessor type: :object
|
45
46
|
|
46
47
|
attr_accessor properties: top?
|
47
48
|
|
48
|
-
|
49
|
+
attr_accessor required: ::Array[String]?
|
49
50
|
|
50
|
-
def
|
51
|
+
def initialize: (
|
52
|
+
?properties: top?,
|
53
|
+
?required: ::Array[String]?,
|
54
|
+
?type: :object
|
55
|
+
) -> void
|
56
|
+
|
57
|
+
def to_hash: -> {
|
58
|
+
type: :object,
|
59
|
+
properties: top?,
|
60
|
+
required: ::Array[String]?
|
61
|
+
}
|
51
62
|
end
|
52
63
|
|
53
64
|
type type_ = :custom
|
@@ -4,11 +4,39 @@ module Anthropic
|
|
4
4
|
Anthropic::Tool
|
5
5
|
| Anthropic::ToolBash20250124
|
6
6
|
| Anthropic::ToolTextEditor20250124
|
7
|
+
| Anthropic::ToolUnion::TextEditor20250429
|
7
8
|
| Anthropic::WebSearchTool20250305
|
8
9
|
|
9
10
|
module ToolUnion
|
10
11
|
extend Anthropic::Internal::Type::Union
|
11
12
|
|
13
|
+
type text_editor20250429 =
|
14
|
+
{
|
15
|
+
name: :str_replace_based_edit_tool,
|
16
|
+
type: :text_editor_20250429,
|
17
|
+
cache_control: Anthropic::CacheControlEphemeral?
|
18
|
+
}
|
19
|
+
|
20
|
+
class TextEditor20250429 < Anthropic::Internal::Type::BaseModel
|
21
|
+
attr_accessor name: :str_replace_based_edit_tool
|
22
|
+
|
23
|
+
attr_accessor type: :text_editor_20250429
|
24
|
+
|
25
|
+
attr_accessor cache_control: Anthropic::CacheControlEphemeral?
|
26
|
+
|
27
|
+
def initialize: (
|
28
|
+
?cache_control: Anthropic::CacheControlEphemeral?,
|
29
|
+
?name: :str_replace_based_edit_tool,
|
30
|
+
?type: :text_editor_20250429
|
31
|
+
) -> void
|
32
|
+
|
33
|
+
def to_hash: -> {
|
34
|
+
name: :str_replace_based_edit_tool,
|
35
|
+
type: :text_editor_20250429,
|
36
|
+
cache_control: Anthropic::CacheControlEphemeral?
|
37
|
+
}
|
38
|
+
end
|
39
|
+
|
12
40
|
def self?.variants: -> ::Array[Anthropic::Models::tool_union]
|
13
41
|
end
|
14
42
|
end
|