brand.dev 0.0.1.pre.alpha.0 → 0.1.0.pre.alpha.1
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 +15 -0
- data/README.md +7 -3
- data/lib/brand_dev/models/brand_ai_query_params.rb +91 -0
- data/lib/brand_dev/models/brand_ai_query_response.rb +80 -0
- data/lib/brand_dev/models.rb +2 -0
- data/lib/brand_dev/resources/brand.rb +28 -0
- data/lib/brand_dev/version.rb +1 -1
- data/lib/brand_dev.rb +2 -0
- data/rbi/brand_dev/models/brand_ai_query_params.rbi +184 -0
- data/rbi/brand_dev/models/brand_ai_query_response.rbi +182 -0
- data/rbi/brand_dev/models.rbi +2 -0
- data/rbi/brand_dev/resources/brand.rbi +23 -0
- data/sig/brand_dev/models/brand_ai_query_params.rbs +85 -0
- data/sig/brand_dev/models/brand_ai_query_response.rbs +79 -0
- data/sig/brand_dev/models.rbs +2 -0
- data/sig/brand_dev/resources/brand.rbs +7 -0
- metadata +20 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e9985ae9ba5e62a158a02c8cd2b290bab9811c3ebc6f3061c2f1d90cbf2d0dbe
|
4
|
+
data.tar.gz: cf66b53c0110ff560bb84484e6113990f4f078aa740ca1a8e653cd32334c6f06
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d1cdf4ea4e6b14cdf0bd77d0eb0d2a9d75edee737d10d0464f30df495b35e6eb811e55ca8cb1f379c6dd2f109d8052541e7671d0efbcf5cb57f66ca6d53cbfe0
|
7
|
+
data.tar.gz: 23b905b672117b2d6ade382f7f0291d800072c1de2967b21f0bde3cad888e5317d87cf42e688697db88d31264c0f70d1eadcee46941c943e4ea171173adf5d39
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
# Changelog
|
2
|
+
|
3
|
+
## 0.1.0-alpha.1 (2025-06-02)
|
4
|
+
|
5
|
+
Full Changelog: [v0.0.1-alpha.0...v0.1.0-alpha.1](https://github.com/brand-dot-dev/ruby-sdk/compare/v0.0.1-alpha.0...v0.1.0-alpha.1)
|
6
|
+
|
7
|
+
### Features
|
8
|
+
|
9
|
+
* **api:** manual updates ([1c2a095](https://github.com/brand-dot-dev/ruby-sdk/commit/1c2a09538494964e67752f572ed11a41f4bf4e29))
|
10
|
+
|
11
|
+
|
12
|
+
### Chores
|
13
|
+
|
14
|
+
* configure new SDK language ([4b2d19e](https://github.com/brand-dot-dev/ruby-sdk/commit/4b2d19e3ea9342c01529655c0231e1258c04de35))
|
15
|
+
* sync repo ([fc86136](https://github.com/brand-dot-dev/ruby-sdk/commit/fc86136bdab0b1c30529662a3dedb8016726d8bc))
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Brand Dev Ruby API library
|
2
2
|
|
3
|
-
The Brand Dev Ruby library provides convenient access to the Brand Dev REST API from any Ruby 3.2.0+ application. It ships with comprehensive types & docstrings in Yard, RBS, and RBI – [see below](https://github.com/
|
3
|
+
The Brand Dev Ruby library provides convenient access to the Brand Dev REST API from any Ruby 3.2.0+ application. It ships with comprehensive types & docstrings in Yard, RBS, and RBI – [see below](https://github.com/brand-dot-dev/ruby-sdk#Sorbet) for usage with Sorbet. The standard library's `net/http` is used as the HTTP transport, with connection pooling via the `connection_pool` gem.
|
4
4
|
|
5
5
|
It is generated with [Stainless](https://www.stainless.com/).
|
6
6
|
|
@@ -12,10 +12,14 @@ Documentation for releases of this gem can be found [on RubyDoc](https://gemdocs
|
|
12
12
|
|
13
13
|
To use this gem, install via Bundler by adding the following to your application's `Gemfile`:
|
14
14
|
|
15
|
+
<!-- x-release-please-start-version -->
|
16
|
+
|
15
17
|
```ruby
|
16
|
-
gem "brand.dev", "~> 0.0.
|
18
|
+
gem "brand.dev", "~> 0.1.0.pre.alpha.1"
|
17
19
|
```
|
18
20
|
|
21
|
+
<!-- x-release-please-end -->
|
22
|
+
|
19
23
|
## Usage
|
20
24
|
|
21
25
|
```ruby
|
@@ -226,4 +230,4 @@ Ruby 3.2.0 or higher.
|
|
226
230
|
|
227
231
|
## Contributing
|
228
232
|
|
229
|
-
See [the contributing documentation](https://github.com/
|
233
|
+
See [the contributing documentation](https://github.com/brand-dot-dev/ruby-sdk/tree/main/CONTRIBUTING.md).
|
@@ -0,0 +1,91 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module BrandDev
|
4
|
+
module Models
|
5
|
+
# @see BrandDev::Resources::Brand#ai_query
|
6
|
+
class BrandAIQueryParams < BrandDev::Internal::Type::BaseModel
|
7
|
+
extend BrandDev::Internal::Type::RequestParameters::Converter
|
8
|
+
include BrandDev::Internal::Type::RequestParameters
|
9
|
+
|
10
|
+
# @!attribute data_to_extract
|
11
|
+
# Array of data points to extract from the website
|
12
|
+
#
|
13
|
+
# @return [Array<BrandDev::Models::BrandAIQueryParams::DataToExtract>]
|
14
|
+
required :data_to_extract,
|
15
|
+
-> { BrandDev::Internal::Type::ArrayOf[BrandDev::BrandAIQueryParams::DataToExtract] }
|
16
|
+
|
17
|
+
# @!attribute domain
|
18
|
+
# The domain name to analyze
|
19
|
+
#
|
20
|
+
# @return [String]
|
21
|
+
required :domain, String
|
22
|
+
|
23
|
+
# @!attribute specific_pages
|
24
|
+
# Optional array of specific pages to analyze
|
25
|
+
#
|
26
|
+
# @return [Array<String>, nil]
|
27
|
+
optional :specific_pages, BrandDev::Internal::Type::ArrayOf[String]
|
28
|
+
|
29
|
+
# @!method initialize(data_to_extract:, domain:, specific_pages: nil, request_options: {})
|
30
|
+
# @param data_to_extract [Array<BrandDev::Models::BrandAIQueryParams::DataToExtract>] Array of data points to extract from the website
|
31
|
+
#
|
32
|
+
# @param domain [String] The domain name to analyze
|
33
|
+
#
|
34
|
+
# @param specific_pages [Array<String>] Optional array of specific pages to analyze
|
35
|
+
#
|
36
|
+
# @param request_options [BrandDev::RequestOptions, Hash{Symbol=>Object}]
|
37
|
+
|
38
|
+
class DataToExtract < BrandDev::Internal::Type::BaseModel
|
39
|
+
# @!attribute datapoint_description
|
40
|
+
# Description of what to extract
|
41
|
+
#
|
42
|
+
# @return [String]
|
43
|
+
required :datapoint_description, String
|
44
|
+
|
45
|
+
# @!attribute datapoint_example
|
46
|
+
# Example of the expected value
|
47
|
+
#
|
48
|
+
# @return [String]
|
49
|
+
required :datapoint_example, String
|
50
|
+
|
51
|
+
# @!attribute datapoint_name
|
52
|
+
# Name of the data point to extract
|
53
|
+
#
|
54
|
+
# @return [String]
|
55
|
+
required :datapoint_name, String
|
56
|
+
|
57
|
+
# @!attribute datapoint_type
|
58
|
+
# Type of the data point
|
59
|
+
#
|
60
|
+
# @return [Symbol, BrandDev::Models::BrandAIQueryParams::DataToExtract::DatapointType]
|
61
|
+
required :datapoint_type, enum: -> { BrandDev::BrandAIQueryParams::DataToExtract::DatapointType }
|
62
|
+
|
63
|
+
# @!method initialize(datapoint_description:, datapoint_example:, datapoint_name:, datapoint_type:)
|
64
|
+
# @param datapoint_description [String] Description of what to extract
|
65
|
+
#
|
66
|
+
# @param datapoint_example [String] Example of the expected value
|
67
|
+
#
|
68
|
+
# @param datapoint_name [String] Name of the data point to extract
|
69
|
+
#
|
70
|
+
# @param datapoint_type [Symbol, BrandDev::Models::BrandAIQueryParams::DataToExtract::DatapointType] Type of the data point
|
71
|
+
|
72
|
+
# Type of the data point
|
73
|
+
#
|
74
|
+
# @see BrandDev::Models::BrandAIQueryParams::DataToExtract#datapoint_type
|
75
|
+
module DatapointType
|
76
|
+
extend BrandDev::Internal::Type::Enum
|
77
|
+
|
78
|
+
TEXT = :text
|
79
|
+
NUMBER = :number
|
80
|
+
DATE = :date
|
81
|
+
BOOLEAN = :boolean
|
82
|
+
LIST = :list
|
83
|
+
URL = :url
|
84
|
+
|
85
|
+
# @!method self.values
|
86
|
+
# @return [Array<Symbol>]
|
87
|
+
end
|
88
|
+
end
|
89
|
+
end
|
90
|
+
end
|
91
|
+
end
|
@@ -0,0 +1,80 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module BrandDev
|
4
|
+
module Models
|
5
|
+
# @see BrandDev::Resources::Brand#ai_query
|
6
|
+
class BrandAIQueryResponse < BrandDev::Internal::Type::BaseModel
|
7
|
+
# @!attribute data_extracted
|
8
|
+
# Array of extracted data points
|
9
|
+
#
|
10
|
+
# @return [Array<BrandDev::Models::BrandAIQueryResponse::DataExtracted>, nil]
|
11
|
+
optional :data_extracted,
|
12
|
+
-> { BrandDev::Internal::Type::ArrayOf[BrandDev::Models::BrandAIQueryResponse::DataExtracted] }
|
13
|
+
|
14
|
+
# @!attribute domain
|
15
|
+
# The domain that was analyzed
|
16
|
+
#
|
17
|
+
# @return [String, nil]
|
18
|
+
optional :domain, String
|
19
|
+
|
20
|
+
# @!attribute urls_analyzed
|
21
|
+
# List of URLs that were analyzed
|
22
|
+
#
|
23
|
+
# @return [Array<String>, nil]
|
24
|
+
optional :urls_analyzed, BrandDev::Internal::Type::ArrayOf[String]
|
25
|
+
|
26
|
+
# @!method initialize(data_extracted: nil, domain: nil, urls_analyzed: nil)
|
27
|
+
# @param data_extracted [Array<BrandDev::Models::BrandAIQueryResponse::DataExtracted>] Array of extracted data points
|
28
|
+
#
|
29
|
+
# @param domain [String] The domain that was analyzed
|
30
|
+
#
|
31
|
+
# @param urls_analyzed [Array<String>] List of URLs that were analyzed
|
32
|
+
|
33
|
+
class DataExtracted < BrandDev::Internal::Type::BaseModel
|
34
|
+
# @!attribute datapoint_name
|
35
|
+
# Name of the extracted data point
|
36
|
+
#
|
37
|
+
# @return [String, nil]
|
38
|
+
optional :datapoint_name, String
|
39
|
+
|
40
|
+
# @!attribute datapoint_value
|
41
|
+
# Value of the extracted data point
|
42
|
+
#
|
43
|
+
# @return [String, Float, Boolean, Array<String>, Array<Float>, nil]
|
44
|
+
optional :datapoint_value,
|
45
|
+
union: -> { BrandDev::Models::BrandAIQueryResponse::DataExtracted::DatapointValue }
|
46
|
+
|
47
|
+
# @!method initialize(datapoint_name: nil, datapoint_value: nil)
|
48
|
+
# @param datapoint_name [String] Name of the extracted data point
|
49
|
+
#
|
50
|
+
# @param datapoint_value [String, Float, Boolean, Array<String>, Array<Float>] Value of the extracted data point
|
51
|
+
|
52
|
+
# Value of the extracted data point
|
53
|
+
#
|
54
|
+
# @see BrandDev::Models::BrandAIQueryResponse::DataExtracted#datapoint_value
|
55
|
+
module DatapointValue
|
56
|
+
extend BrandDev::Internal::Type::Union
|
57
|
+
|
58
|
+
variant String
|
59
|
+
|
60
|
+
variant Float
|
61
|
+
|
62
|
+
variant BrandDev::Internal::Type::Boolean
|
63
|
+
|
64
|
+
variant -> { BrandDev::Models::BrandAIQueryResponse::DataExtracted::DatapointValue::StringArray }
|
65
|
+
|
66
|
+
variant -> { BrandDev::Models::BrandAIQueryResponse::DataExtracted::DatapointValue::FloatArray }
|
67
|
+
|
68
|
+
# @!method self.variants
|
69
|
+
# @return [Array(String, Float, Boolean, Array<String>, Array<Float>)]
|
70
|
+
|
71
|
+
# @type [BrandDev::Internal::Type::Converter]
|
72
|
+
StringArray = BrandDev::Internal::Type::ArrayOf[String]
|
73
|
+
|
74
|
+
# @type [BrandDev::Internal::Type::Converter]
|
75
|
+
FloatArray = BrandDev::Internal::Type::ArrayOf[Float]
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
data/lib/brand_dev/models.rb
CHANGED
@@ -39,6 +39,8 @@ module BrandDev
|
|
39
39
|
mod.define_sorbet_constant!(const) { T.type_alias { mod.to_sorbet_type } }
|
40
40
|
end
|
41
41
|
|
42
|
+
BrandAIQueryParams = BrandDev::Models::BrandAIQueryParams
|
43
|
+
|
42
44
|
BrandIdentifyFromTransactionParams = BrandDev::Models::BrandIdentifyFromTransactionParams
|
43
45
|
|
44
46
|
BrandRetrieveByTickerParams = BrandDev::Models::BrandRetrieveByTickerParams
|
@@ -27,6 +27,34 @@ module BrandDev
|
|
27
27
|
)
|
28
28
|
end
|
29
29
|
|
30
|
+
# Beta feature: Use AI to extract specific data points from a brand's website. The
|
31
|
+
# AI will crawl the website and extract the requested information based on the
|
32
|
+
# provided data points.
|
33
|
+
#
|
34
|
+
# @overload ai_query(data_to_extract:, domain:, specific_pages: nil, request_options: {})
|
35
|
+
#
|
36
|
+
# @param data_to_extract [Array<BrandDev::Models::BrandAIQueryParams::DataToExtract>] Array of data points to extract from the website
|
37
|
+
#
|
38
|
+
# @param domain [String] The domain name to analyze
|
39
|
+
#
|
40
|
+
# @param specific_pages [Array<String>] Optional array of specific pages to analyze
|
41
|
+
#
|
42
|
+
# @param request_options [BrandDev::RequestOptions, Hash{Symbol=>Object}, nil]
|
43
|
+
#
|
44
|
+
# @return [BrandDev::Models::BrandAIQueryResponse]
|
45
|
+
#
|
46
|
+
# @see BrandDev::Models::BrandAIQueryParams
|
47
|
+
def ai_query(params)
|
48
|
+
parsed, options = BrandDev::BrandAIQueryParams.dump_request(params)
|
49
|
+
@client.request(
|
50
|
+
method: :post,
|
51
|
+
path: "brand/ai/query",
|
52
|
+
body: parsed,
|
53
|
+
model: BrandDev::Models::BrandAIQueryResponse,
|
54
|
+
options: options
|
55
|
+
)
|
56
|
+
end
|
57
|
+
|
30
58
|
# Endpoint specially designed for platforms that want to identify transaction data
|
31
59
|
# by the transaction title.
|
32
60
|
#
|
data/lib/brand_dev/version.rb
CHANGED
data/lib/brand_dev.rb
CHANGED
@@ -50,6 +50,8 @@ require_relative "brand_dev/errors"
|
|
50
50
|
require_relative "brand_dev/internal/transport/base_client"
|
51
51
|
require_relative "brand_dev/internal/transport/pooled_net_requester"
|
52
52
|
require_relative "brand_dev/client"
|
53
|
+
require_relative "brand_dev/models/brand_ai_query_params"
|
54
|
+
require_relative "brand_dev/models/brand_ai_query_response"
|
53
55
|
require_relative "brand_dev/models/brand_identify_from_transaction_params"
|
54
56
|
require_relative "brand_dev/models/brand_identify_from_transaction_response"
|
55
57
|
require_relative "brand_dev/models/brand_retrieve_by_ticker_params"
|
@@ -0,0 +1,184 @@
|
|
1
|
+
# typed: strong
|
2
|
+
|
3
|
+
module BrandDev
|
4
|
+
module Models
|
5
|
+
class BrandAIQueryParams < BrandDev::Internal::Type::BaseModel
|
6
|
+
extend BrandDev::Internal::Type::RequestParameters::Converter
|
7
|
+
include BrandDev::Internal::Type::RequestParameters
|
8
|
+
|
9
|
+
OrHash =
|
10
|
+
T.type_alias do
|
11
|
+
T.any(BrandDev::BrandAIQueryParams, BrandDev::Internal::AnyHash)
|
12
|
+
end
|
13
|
+
|
14
|
+
# Array of data points to extract from the website
|
15
|
+
sig { returns(T::Array[BrandDev::BrandAIQueryParams::DataToExtract]) }
|
16
|
+
attr_accessor :data_to_extract
|
17
|
+
|
18
|
+
# The domain name to analyze
|
19
|
+
sig { returns(String) }
|
20
|
+
attr_accessor :domain
|
21
|
+
|
22
|
+
# Optional array of specific pages to analyze
|
23
|
+
sig { returns(T.nilable(T::Array[String])) }
|
24
|
+
attr_reader :specific_pages
|
25
|
+
|
26
|
+
sig { params(specific_pages: T::Array[String]).void }
|
27
|
+
attr_writer :specific_pages
|
28
|
+
|
29
|
+
sig do
|
30
|
+
params(
|
31
|
+
data_to_extract:
|
32
|
+
T::Array[BrandDev::BrandAIQueryParams::DataToExtract::OrHash],
|
33
|
+
domain: String,
|
34
|
+
specific_pages: T::Array[String],
|
35
|
+
request_options: BrandDev::RequestOptions::OrHash
|
36
|
+
).returns(T.attached_class)
|
37
|
+
end
|
38
|
+
def self.new(
|
39
|
+
# Array of data points to extract from the website
|
40
|
+
data_to_extract:,
|
41
|
+
# The domain name to analyze
|
42
|
+
domain:,
|
43
|
+
# Optional array of specific pages to analyze
|
44
|
+
specific_pages: nil,
|
45
|
+
request_options: {}
|
46
|
+
)
|
47
|
+
end
|
48
|
+
|
49
|
+
sig do
|
50
|
+
override.returns(
|
51
|
+
{
|
52
|
+
data_to_extract:
|
53
|
+
T::Array[BrandDev::BrandAIQueryParams::DataToExtract],
|
54
|
+
domain: String,
|
55
|
+
specific_pages: T::Array[String],
|
56
|
+
request_options: BrandDev::RequestOptions
|
57
|
+
}
|
58
|
+
)
|
59
|
+
end
|
60
|
+
def to_hash
|
61
|
+
end
|
62
|
+
|
63
|
+
class DataToExtract < BrandDev::Internal::Type::BaseModel
|
64
|
+
OrHash =
|
65
|
+
T.type_alias do
|
66
|
+
T.any(
|
67
|
+
BrandDev::BrandAIQueryParams::DataToExtract,
|
68
|
+
BrandDev::Internal::AnyHash
|
69
|
+
)
|
70
|
+
end
|
71
|
+
|
72
|
+
# Description of what to extract
|
73
|
+
sig { returns(String) }
|
74
|
+
attr_accessor :datapoint_description
|
75
|
+
|
76
|
+
# Example of the expected value
|
77
|
+
sig { returns(String) }
|
78
|
+
attr_accessor :datapoint_example
|
79
|
+
|
80
|
+
# Name of the data point to extract
|
81
|
+
sig { returns(String) }
|
82
|
+
attr_accessor :datapoint_name
|
83
|
+
|
84
|
+
# Type of the data point
|
85
|
+
sig do
|
86
|
+
returns(
|
87
|
+
BrandDev::BrandAIQueryParams::DataToExtract::DatapointType::OrSymbol
|
88
|
+
)
|
89
|
+
end
|
90
|
+
attr_accessor :datapoint_type
|
91
|
+
|
92
|
+
sig do
|
93
|
+
params(
|
94
|
+
datapoint_description: String,
|
95
|
+
datapoint_example: String,
|
96
|
+
datapoint_name: String,
|
97
|
+
datapoint_type:
|
98
|
+
BrandDev::BrandAIQueryParams::DataToExtract::DatapointType::OrSymbol
|
99
|
+
).returns(T.attached_class)
|
100
|
+
end
|
101
|
+
def self.new(
|
102
|
+
# Description of what to extract
|
103
|
+
datapoint_description:,
|
104
|
+
# Example of the expected value
|
105
|
+
datapoint_example:,
|
106
|
+
# Name of the data point to extract
|
107
|
+
datapoint_name:,
|
108
|
+
# Type of the data point
|
109
|
+
datapoint_type:
|
110
|
+
)
|
111
|
+
end
|
112
|
+
|
113
|
+
sig do
|
114
|
+
override.returns(
|
115
|
+
{
|
116
|
+
datapoint_description: String,
|
117
|
+
datapoint_example: String,
|
118
|
+
datapoint_name: String,
|
119
|
+
datapoint_type:
|
120
|
+
BrandDev::BrandAIQueryParams::DataToExtract::DatapointType::OrSymbol
|
121
|
+
}
|
122
|
+
)
|
123
|
+
end
|
124
|
+
def to_hash
|
125
|
+
end
|
126
|
+
|
127
|
+
# Type of the data point
|
128
|
+
module DatapointType
|
129
|
+
extend BrandDev::Internal::Type::Enum
|
130
|
+
|
131
|
+
TaggedSymbol =
|
132
|
+
T.type_alias do
|
133
|
+
T.all(
|
134
|
+
Symbol,
|
135
|
+
BrandDev::BrandAIQueryParams::DataToExtract::DatapointType
|
136
|
+
)
|
137
|
+
end
|
138
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
139
|
+
|
140
|
+
TEXT =
|
141
|
+
T.let(
|
142
|
+
:text,
|
143
|
+
BrandDev::BrandAIQueryParams::DataToExtract::DatapointType::TaggedSymbol
|
144
|
+
)
|
145
|
+
NUMBER =
|
146
|
+
T.let(
|
147
|
+
:number,
|
148
|
+
BrandDev::BrandAIQueryParams::DataToExtract::DatapointType::TaggedSymbol
|
149
|
+
)
|
150
|
+
DATE =
|
151
|
+
T.let(
|
152
|
+
:date,
|
153
|
+
BrandDev::BrandAIQueryParams::DataToExtract::DatapointType::TaggedSymbol
|
154
|
+
)
|
155
|
+
BOOLEAN =
|
156
|
+
T.let(
|
157
|
+
:boolean,
|
158
|
+
BrandDev::BrandAIQueryParams::DataToExtract::DatapointType::TaggedSymbol
|
159
|
+
)
|
160
|
+
LIST =
|
161
|
+
T.let(
|
162
|
+
:list,
|
163
|
+
BrandDev::BrandAIQueryParams::DataToExtract::DatapointType::TaggedSymbol
|
164
|
+
)
|
165
|
+
URL =
|
166
|
+
T.let(
|
167
|
+
:url,
|
168
|
+
BrandDev::BrandAIQueryParams::DataToExtract::DatapointType::TaggedSymbol
|
169
|
+
)
|
170
|
+
|
171
|
+
sig do
|
172
|
+
override.returns(
|
173
|
+
T::Array[
|
174
|
+
BrandDev::BrandAIQueryParams::DataToExtract::DatapointType::TaggedSymbol
|
175
|
+
]
|
176
|
+
)
|
177
|
+
end
|
178
|
+
def self.values
|
179
|
+
end
|
180
|
+
end
|
181
|
+
end
|
182
|
+
end
|
183
|
+
end
|
184
|
+
end
|
@@ -0,0 +1,182 @@
|
|
1
|
+
# typed: strong
|
2
|
+
|
3
|
+
module BrandDev
|
4
|
+
module Models
|
5
|
+
class BrandAIQueryResponse < BrandDev::Internal::Type::BaseModel
|
6
|
+
OrHash =
|
7
|
+
T.type_alias do
|
8
|
+
T.any(
|
9
|
+
BrandDev::Models::BrandAIQueryResponse,
|
10
|
+
BrandDev::Internal::AnyHash
|
11
|
+
)
|
12
|
+
end
|
13
|
+
|
14
|
+
# Array of extracted data points
|
15
|
+
sig do
|
16
|
+
returns(
|
17
|
+
T.nilable(
|
18
|
+
T::Array[BrandDev::Models::BrandAIQueryResponse::DataExtracted]
|
19
|
+
)
|
20
|
+
)
|
21
|
+
end
|
22
|
+
attr_reader :data_extracted
|
23
|
+
|
24
|
+
sig do
|
25
|
+
params(
|
26
|
+
data_extracted:
|
27
|
+
T::Array[
|
28
|
+
BrandDev::Models::BrandAIQueryResponse::DataExtracted::OrHash
|
29
|
+
]
|
30
|
+
).void
|
31
|
+
end
|
32
|
+
attr_writer :data_extracted
|
33
|
+
|
34
|
+
# The domain that was analyzed
|
35
|
+
sig { returns(T.nilable(String)) }
|
36
|
+
attr_reader :domain
|
37
|
+
|
38
|
+
sig { params(domain: String).void }
|
39
|
+
attr_writer :domain
|
40
|
+
|
41
|
+
# List of URLs that were analyzed
|
42
|
+
sig { returns(T.nilable(T::Array[String])) }
|
43
|
+
attr_reader :urls_analyzed
|
44
|
+
|
45
|
+
sig { params(urls_analyzed: T::Array[String]).void }
|
46
|
+
attr_writer :urls_analyzed
|
47
|
+
|
48
|
+
sig do
|
49
|
+
params(
|
50
|
+
data_extracted:
|
51
|
+
T::Array[
|
52
|
+
BrandDev::Models::BrandAIQueryResponse::DataExtracted::OrHash
|
53
|
+
],
|
54
|
+
domain: String,
|
55
|
+
urls_analyzed: T::Array[String]
|
56
|
+
).returns(T.attached_class)
|
57
|
+
end
|
58
|
+
def self.new(
|
59
|
+
# Array of extracted data points
|
60
|
+
data_extracted: nil,
|
61
|
+
# The domain that was analyzed
|
62
|
+
domain: nil,
|
63
|
+
# List of URLs that were analyzed
|
64
|
+
urls_analyzed: nil
|
65
|
+
)
|
66
|
+
end
|
67
|
+
|
68
|
+
sig do
|
69
|
+
override.returns(
|
70
|
+
{
|
71
|
+
data_extracted:
|
72
|
+
T::Array[BrandDev::Models::BrandAIQueryResponse::DataExtracted],
|
73
|
+
domain: String,
|
74
|
+
urls_analyzed: T::Array[String]
|
75
|
+
}
|
76
|
+
)
|
77
|
+
end
|
78
|
+
def to_hash
|
79
|
+
end
|
80
|
+
|
81
|
+
class DataExtracted < BrandDev::Internal::Type::BaseModel
|
82
|
+
OrHash =
|
83
|
+
T.type_alias do
|
84
|
+
T.any(
|
85
|
+
BrandDev::Models::BrandAIQueryResponse::DataExtracted,
|
86
|
+
BrandDev::Internal::AnyHash
|
87
|
+
)
|
88
|
+
end
|
89
|
+
|
90
|
+
# Name of the extracted data point
|
91
|
+
sig { returns(T.nilable(String)) }
|
92
|
+
attr_reader :datapoint_name
|
93
|
+
|
94
|
+
sig { params(datapoint_name: String).void }
|
95
|
+
attr_writer :datapoint_name
|
96
|
+
|
97
|
+
# Value of the extracted data point
|
98
|
+
sig do
|
99
|
+
returns(
|
100
|
+
T.nilable(
|
101
|
+
BrandDev::Models::BrandAIQueryResponse::DataExtracted::DatapointValue::Variants
|
102
|
+
)
|
103
|
+
)
|
104
|
+
end
|
105
|
+
attr_reader :datapoint_value
|
106
|
+
|
107
|
+
sig do
|
108
|
+
params(
|
109
|
+
datapoint_value:
|
110
|
+
BrandDev::Models::BrandAIQueryResponse::DataExtracted::DatapointValue::Variants
|
111
|
+
).void
|
112
|
+
end
|
113
|
+
attr_writer :datapoint_value
|
114
|
+
|
115
|
+
sig do
|
116
|
+
params(
|
117
|
+
datapoint_name: String,
|
118
|
+
datapoint_value:
|
119
|
+
BrandDev::Models::BrandAIQueryResponse::DataExtracted::DatapointValue::Variants
|
120
|
+
).returns(T.attached_class)
|
121
|
+
end
|
122
|
+
def self.new(
|
123
|
+
# Name of the extracted data point
|
124
|
+
datapoint_name: nil,
|
125
|
+
# Value of the extracted data point
|
126
|
+
datapoint_value: nil
|
127
|
+
)
|
128
|
+
end
|
129
|
+
|
130
|
+
sig do
|
131
|
+
override.returns(
|
132
|
+
{
|
133
|
+
datapoint_name: String,
|
134
|
+
datapoint_value:
|
135
|
+
BrandDev::Models::BrandAIQueryResponse::DataExtracted::DatapointValue::Variants
|
136
|
+
}
|
137
|
+
)
|
138
|
+
end
|
139
|
+
def to_hash
|
140
|
+
end
|
141
|
+
|
142
|
+
# Value of the extracted data point
|
143
|
+
module DatapointValue
|
144
|
+
extend BrandDev::Internal::Type::Union
|
145
|
+
|
146
|
+
Variants =
|
147
|
+
T.type_alias do
|
148
|
+
T.any(
|
149
|
+
String,
|
150
|
+
Float,
|
151
|
+
T::Boolean,
|
152
|
+
T::Array[String],
|
153
|
+
T::Array[Float]
|
154
|
+
)
|
155
|
+
end
|
156
|
+
|
157
|
+
sig do
|
158
|
+
override.returns(
|
159
|
+
T::Array[
|
160
|
+
BrandDev::Models::BrandAIQueryResponse::DataExtracted::DatapointValue::Variants
|
161
|
+
]
|
162
|
+
)
|
163
|
+
end
|
164
|
+
def self.variants
|
165
|
+
end
|
166
|
+
|
167
|
+
StringArray =
|
168
|
+
T.let(
|
169
|
+
BrandDev::Internal::Type::ArrayOf[String],
|
170
|
+
BrandDev::Internal::Type::Converter
|
171
|
+
)
|
172
|
+
|
173
|
+
FloatArray =
|
174
|
+
T.let(
|
175
|
+
BrandDev::Internal::Type::ArrayOf[Float],
|
176
|
+
BrandDev::Internal::Type::Converter
|
177
|
+
)
|
178
|
+
end
|
179
|
+
end
|
180
|
+
end
|
181
|
+
end
|
182
|
+
end
|
data/rbi/brand_dev/models.rbi
CHANGED
@@ -21,6 +21,29 @@ module BrandDev
|
|
21
21
|
)
|
22
22
|
end
|
23
23
|
|
24
|
+
# Beta feature: Use AI to extract specific data points from a brand's website. The
|
25
|
+
# AI will crawl the website and extract the requested information based on the
|
26
|
+
# provided data points.
|
27
|
+
sig do
|
28
|
+
params(
|
29
|
+
data_to_extract:
|
30
|
+
T::Array[BrandDev::BrandAIQueryParams::DataToExtract::OrHash],
|
31
|
+
domain: String,
|
32
|
+
specific_pages: T::Array[String],
|
33
|
+
request_options: BrandDev::RequestOptions::OrHash
|
34
|
+
).returns(BrandDev::Models::BrandAIQueryResponse)
|
35
|
+
end
|
36
|
+
def ai_query(
|
37
|
+
# Array of data points to extract from the website
|
38
|
+
data_to_extract:,
|
39
|
+
# The domain name to analyze
|
40
|
+
domain:,
|
41
|
+
# Optional array of specific pages to analyze
|
42
|
+
specific_pages: nil,
|
43
|
+
request_options: {}
|
44
|
+
)
|
45
|
+
end
|
46
|
+
|
24
47
|
# Endpoint specially designed for platforms that want to identify transaction data
|
25
48
|
# by the transaction title.
|
26
49
|
sig do
|
@@ -0,0 +1,85 @@
|
|
1
|
+
module BrandDev
|
2
|
+
module Models
|
3
|
+
type brand_ai_query_params =
|
4
|
+
{
|
5
|
+
data_to_extract: ::Array[BrandDev::BrandAIQueryParams::DataToExtract],
|
6
|
+
domain: String,
|
7
|
+
specific_pages: ::Array[String]
|
8
|
+
}
|
9
|
+
& BrandDev::Internal::Type::request_parameters
|
10
|
+
|
11
|
+
class BrandAIQueryParams < BrandDev::Internal::Type::BaseModel
|
12
|
+
extend BrandDev::Internal::Type::RequestParameters::Converter
|
13
|
+
include BrandDev::Internal::Type::RequestParameters
|
14
|
+
|
15
|
+
attr_accessor data_to_extract: ::Array[BrandDev::BrandAIQueryParams::DataToExtract]
|
16
|
+
|
17
|
+
attr_accessor domain: String
|
18
|
+
|
19
|
+
attr_reader specific_pages: ::Array[String]?
|
20
|
+
|
21
|
+
def specific_pages=: (::Array[String]) -> ::Array[String]
|
22
|
+
|
23
|
+
def initialize: (
|
24
|
+
data_to_extract: ::Array[BrandDev::BrandAIQueryParams::DataToExtract],
|
25
|
+
domain: String,
|
26
|
+
?specific_pages: ::Array[String],
|
27
|
+
?request_options: BrandDev::request_opts
|
28
|
+
) -> void
|
29
|
+
|
30
|
+
def to_hash: -> {
|
31
|
+
data_to_extract: ::Array[BrandDev::BrandAIQueryParams::DataToExtract],
|
32
|
+
domain: String,
|
33
|
+
specific_pages: ::Array[String],
|
34
|
+
request_options: BrandDev::RequestOptions
|
35
|
+
}
|
36
|
+
|
37
|
+
type data_to_extract =
|
38
|
+
{
|
39
|
+
datapoint_description: String,
|
40
|
+
datapoint_example: String,
|
41
|
+
datapoint_name: String,
|
42
|
+
datapoint_type: BrandDev::Models::BrandAIQueryParams::DataToExtract::datapoint_type
|
43
|
+
}
|
44
|
+
|
45
|
+
class DataToExtract < BrandDev::Internal::Type::BaseModel
|
46
|
+
attr_accessor datapoint_description: String
|
47
|
+
|
48
|
+
attr_accessor datapoint_example: String
|
49
|
+
|
50
|
+
attr_accessor datapoint_name: String
|
51
|
+
|
52
|
+
attr_accessor datapoint_type: BrandDev::Models::BrandAIQueryParams::DataToExtract::datapoint_type
|
53
|
+
|
54
|
+
def initialize: (
|
55
|
+
datapoint_description: String,
|
56
|
+
datapoint_example: String,
|
57
|
+
datapoint_name: String,
|
58
|
+
datapoint_type: BrandDev::Models::BrandAIQueryParams::DataToExtract::datapoint_type
|
59
|
+
) -> void
|
60
|
+
|
61
|
+
def to_hash: -> {
|
62
|
+
datapoint_description: String,
|
63
|
+
datapoint_example: String,
|
64
|
+
datapoint_name: String,
|
65
|
+
datapoint_type: BrandDev::Models::BrandAIQueryParams::DataToExtract::datapoint_type
|
66
|
+
}
|
67
|
+
|
68
|
+
type datapoint_type = :text | :number | :date | :boolean | :list | :url
|
69
|
+
|
70
|
+
module DatapointType
|
71
|
+
extend BrandDev::Internal::Type::Enum
|
72
|
+
|
73
|
+
TEXT: :text
|
74
|
+
NUMBER: :number
|
75
|
+
DATE: :date
|
76
|
+
BOOLEAN: :boolean
|
77
|
+
LIST: :list
|
78
|
+
URL: :url
|
79
|
+
|
80
|
+
def self?.values: -> ::Array[BrandDev::Models::BrandAIQueryParams::DataToExtract::datapoint_type]
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
@@ -0,0 +1,79 @@
|
|
1
|
+
module BrandDev
|
2
|
+
module Models
|
3
|
+
type brand_ai_query_response =
|
4
|
+
{
|
5
|
+
data_extracted: ::Array[BrandDev::Models::BrandAIQueryResponse::DataExtracted],
|
6
|
+
domain: String,
|
7
|
+
urls_analyzed: ::Array[String]
|
8
|
+
}
|
9
|
+
|
10
|
+
class BrandAIQueryResponse < BrandDev::Internal::Type::BaseModel
|
11
|
+
attr_reader data_extracted: ::Array[BrandDev::Models::BrandAIQueryResponse::DataExtracted]?
|
12
|
+
|
13
|
+
def data_extracted=: (
|
14
|
+
::Array[BrandDev::Models::BrandAIQueryResponse::DataExtracted]
|
15
|
+
) -> ::Array[BrandDev::Models::BrandAIQueryResponse::DataExtracted]
|
16
|
+
|
17
|
+
attr_reader domain: String?
|
18
|
+
|
19
|
+
def domain=: (String) -> String
|
20
|
+
|
21
|
+
attr_reader urls_analyzed: ::Array[String]?
|
22
|
+
|
23
|
+
def urls_analyzed=: (::Array[String]) -> ::Array[String]
|
24
|
+
|
25
|
+
def initialize: (
|
26
|
+
?data_extracted: ::Array[BrandDev::Models::BrandAIQueryResponse::DataExtracted],
|
27
|
+
?domain: String,
|
28
|
+
?urls_analyzed: ::Array[String]
|
29
|
+
) -> void
|
30
|
+
|
31
|
+
def to_hash: -> {
|
32
|
+
data_extracted: ::Array[BrandDev::Models::BrandAIQueryResponse::DataExtracted],
|
33
|
+
domain: String,
|
34
|
+
urls_analyzed: ::Array[String]
|
35
|
+
}
|
36
|
+
|
37
|
+
type data_extracted =
|
38
|
+
{
|
39
|
+
datapoint_name: String,
|
40
|
+
datapoint_value: BrandDev::Models::BrandAIQueryResponse::DataExtracted::datapoint_value
|
41
|
+
}
|
42
|
+
|
43
|
+
class DataExtracted < BrandDev::Internal::Type::BaseModel
|
44
|
+
attr_reader datapoint_name: String?
|
45
|
+
|
46
|
+
def datapoint_name=: (String) -> String
|
47
|
+
|
48
|
+
attr_reader datapoint_value: BrandDev::Models::BrandAIQueryResponse::DataExtracted::datapoint_value?
|
49
|
+
|
50
|
+
def datapoint_value=: (
|
51
|
+
BrandDev::Models::BrandAIQueryResponse::DataExtracted::datapoint_value
|
52
|
+
) -> BrandDev::Models::BrandAIQueryResponse::DataExtracted::datapoint_value
|
53
|
+
|
54
|
+
def initialize: (
|
55
|
+
?datapoint_name: String,
|
56
|
+
?datapoint_value: BrandDev::Models::BrandAIQueryResponse::DataExtracted::datapoint_value
|
57
|
+
) -> void
|
58
|
+
|
59
|
+
def to_hash: -> {
|
60
|
+
datapoint_name: String,
|
61
|
+
datapoint_value: BrandDev::Models::BrandAIQueryResponse::DataExtracted::datapoint_value
|
62
|
+
}
|
63
|
+
|
64
|
+
type datapoint_value =
|
65
|
+
String | Float | bool | ::Array[String] | ::Array[Float]
|
66
|
+
|
67
|
+
module DatapointValue
|
68
|
+
extend BrandDev::Internal::Type::Union
|
69
|
+
|
70
|
+
def self?.variants: -> ::Array[BrandDev::Models::BrandAIQueryResponse::DataExtracted::datapoint_value]
|
71
|
+
|
72
|
+
StringArray: BrandDev::Internal::Type::Converter
|
73
|
+
|
74
|
+
FloatArray: BrandDev::Internal::Type::Converter
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
data/sig/brand_dev/models.rbs
CHANGED
@@ -7,6 +7,13 @@ module BrandDev
|
|
7
7
|
?request_options: BrandDev::request_opts
|
8
8
|
) -> BrandDev::Models::BrandRetrieveResponse
|
9
9
|
|
10
|
+
def ai_query: (
|
11
|
+
data_to_extract: ::Array[BrandDev::BrandAIQueryParams::DataToExtract],
|
12
|
+
domain: String,
|
13
|
+
?specific_pages: ::Array[String],
|
14
|
+
?request_options: BrandDev::request_opts
|
15
|
+
) -> BrandDev::Models::BrandAIQueryResponse
|
16
|
+
|
10
17
|
def identify_from_transaction: (
|
11
18
|
transaction_info: String,
|
12
19
|
?request_options: BrandDev::request_opts
|
metadata
CHANGED
@@ -1,36 +1,37 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: brand.dev
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.1.0.pre.alpha.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brand Dev
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-06-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: connection_pool
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
27
|
-
description:
|
26
|
+
version: '0'
|
27
|
+
description:
|
28
28
|
email: ''
|
29
29
|
executables: []
|
30
30
|
extensions: []
|
31
31
|
extra_rdoc_files:
|
32
32
|
- README.md
|
33
33
|
files:
|
34
|
+
- CHANGELOG.md
|
34
35
|
- README.md
|
35
36
|
- SECURITY.md
|
36
37
|
- lib/brand_dev.rb
|
@@ -53,6 +54,8 @@ files:
|
|
53
54
|
- lib/brand_dev/internal/type/unknown.rb
|
54
55
|
- lib/brand_dev/internal/util.rb
|
55
56
|
- lib/brand_dev/models.rb
|
57
|
+
- lib/brand_dev/models/brand_ai_query_params.rb
|
58
|
+
- lib/brand_dev/models/brand_ai_query_response.rb
|
56
59
|
- lib/brand_dev/models/brand_identify_from_transaction_params.rb
|
57
60
|
- lib/brand_dev/models/brand_identify_from_transaction_response.rb
|
58
61
|
- lib/brand_dev/models/brand_retrieve_by_ticker_params.rb
|
@@ -86,6 +89,8 @@ files:
|
|
86
89
|
- rbi/brand_dev/internal/type/unknown.rbi
|
87
90
|
- rbi/brand_dev/internal/util.rbi
|
88
91
|
- rbi/brand_dev/models.rbi
|
92
|
+
- rbi/brand_dev/models/brand_ai_query_params.rbi
|
93
|
+
- rbi/brand_dev/models/brand_ai_query_response.rbi
|
89
94
|
- rbi/brand_dev/models/brand_identify_from_transaction_params.rbi
|
90
95
|
- rbi/brand_dev/models/brand_identify_from_transaction_response.rbi
|
91
96
|
- rbi/brand_dev/models/brand_retrieve_by_ticker_params.rbi
|
@@ -118,6 +123,8 @@ files:
|
|
118
123
|
- sig/brand_dev/internal/type/unknown.rbs
|
119
124
|
- sig/brand_dev/internal/util.rbs
|
120
125
|
- sig/brand_dev/models.rbs
|
126
|
+
- sig/brand_dev/models/brand_ai_query_params.rbs
|
127
|
+
- sig/brand_dev/models/brand_ai_query_response.rbs
|
121
128
|
- sig/brand_dev/models/brand_identify_from_transaction_params.rbs
|
122
129
|
- sig/brand_dev/models/brand_identify_from_transaction_response.rbs
|
123
130
|
- sig/brand_dev/models/brand_retrieve_by_ticker_params.rbs
|
@@ -132,13 +139,12 @@ files:
|
|
132
139
|
- sig/brand_dev/resources/brand.rbs
|
133
140
|
- sig/brand_dev/version.rbs
|
134
141
|
homepage: https://gemdocs.org/gems/brand.dev
|
135
|
-
licenses:
|
136
|
-
- Apache-2.0
|
142
|
+
licenses: []
|
137
143
|
metadata:
|
138
144
|
homepage_uri: https://gemdocs.org/gems/brand.dev
|
139
|
-
source_code_uri: https://github.com/
|
145
|
+
source_code_uri: https://github.com/brand-dot-dev/ruby-sdk
|
140
146
|
rubygems_mfa_required: 'false'
|
141
|
-
post_install_message:
|
147
|
+
post_install_message:
|
142
148
|
rdoc_options: []
|
143
149
|
require_paths:
|
144
150
|
- lib
|
@@ -153,8 +159,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
153
159
|
- !ruby/object:Gem::Version
|
154
160
|
version: 1.3.1
|
155
161
|
requirements: []
|
156
|
-
rubygems_version: 3.
|
157
|
-
signing_key:
|
162
|
+
rubygems_version: 3.4.1
|
163
|
+
signing_key:
|
158
164
|
specification_version: 4
|
159
165
|
summary: Ruby library to access the Brand Dev API
|
160
166
|
test_files: []
|