cadenya 0.22.0 → 0.23.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 +9 -0
- data/README.md +13 -1
- data/lib/cadenya/internal/stream.rb +32 -0
- data/lib/cadenya/internal/transport/base_client.rb +1 -1
- data/lib/cadenya/internal/type/base_stream.rb +83 -0
- data/lib/cadenya/models/ai_provider_key_spec.rb +14 -168
- data/lib/cadenya/models/{objective_continue_response.rb → objective_event.rb} +2 -2
- data/lib/cadenya/models/objective_event_webhook_data.rb +3 -43
- data/lib/cadenya/models/objective_stream_events_params.rb +26 -0
- data/lib/cadenya/models/unsafe_unwrap_webhook_event.rb +3 -43
- data/lib/cadenya/models/unwrap_webhook_event.rb +3 -42
- data/lib/cadenya/models.rb +4 -0
- data/lib/cadenya/resources/objectives.rb +31 -4
- data/lib/cadenya/version.rb +1 -1
- data/lib/cadenya.rb +4 -2
- data/rbi/cadenya/internal/stream.rbi +18 -0
- data/rbi/cadenya/internal/transport/base_client.rbi +18 -2
- data/rbi/cadenya/internal/type/base_stream.rbi +75 -0
- data/rbi/cadenya/models/ai_provider_key_spec.rbi +24 -363
- data/rbi/cadenya/models/{objective_continue_response.rbi → objective_event.rbi} +2 -5
- data/rbi/cadenya/models/objective_event_webhook_data.rbi +4 -80
- data/rbi/cadenya/models/objective_stream_events_params.rbi +46 -0
- data/rbi/cadenya/models/unsafe_unwrap_webhook_event.rbi +4 -78
- data/rbi/cadenya/models/unwrap_webhook_event.rbi +4 -77
- data/rbi/cadenya/models.rbi +4 -0
- data/rbi/cadenya/resources/objectives.rbi +17 -6
- data/sig/cadenya/internal/stream.rbs +9 -0
- data/sig/cadenya/internal/type/base_stream.rbs +38 -0
- data/sig/cadenya/models/ai_provider_key_spec.rbs +11 -161
- data/sig/cadenya/models/{objective_continue_response.rbs → objective_event.rbs} +2 -2
- data/sig/cadenya/models/objective_event_webhook_data.rbs +4 -42
- data/sig/cadenya/models/objective_stream_events_params.rbs +28 -0
- data/sig/cadenya/models/unsafe_unwrap_webhook_event.rbs +4 -42
- data/sig/cadenya/models/unwrap_webhook_event.rbs +4 -42
- data/sig/cadenya/models.rbs +4 -0
- data/sig/cadenya/resources/objectives.rbs +8 -2
- metadata +13 -7
- data/lib/cadenya/models/objective_list_events_response.rb +0 -42
- data/rbi/cadenya/models/objective_list_events_response.rbi +0 -72
- data/sig/cadenya/models/objective_list_events_response.rbs +0 -39
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 88a495d13fa3197bd62108f4a356f43b3dc8d8b280f6a11584afd3484fbb0135
|
|
4
|
+
data.tar.gz: 7cd25a4bbea3d69c830e18e2f61db051165da239d5d41d0c9547b426ea166aa9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b2f73a4957a9e5f1adcf9b8f51b9a39223a4cf1bc9e8c721c4c4d7ace807ce1eb73acc57cba38847967b99211b87726f1ca625b0ddfeeb140a3526851bfbb7da
|
|
7
|
+
data.tar.gz: 8974859e7ae5d2035635ea7f0ea5a3c843cafd2f71b0efae359af83572b73402a81b4d683b306db724fc3b65beecd44eb1b50705f57bef1116f54ff63515ce82
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.23.0 (2026-07-01)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v0.22.0...v0.23.0](https://github.com/cadenya/cadenya-ruby/compare/v0.22.0...v0.23.0)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* Add SSE streaming endpoint for objective events (ENG-344) ([eec699b](https://github.com/cadenya/cadenya-ruby/commit/eec699b38fee3662e2d07d8ca22b321472d88e93))
|
|
10
|
+
* **api:** api update ([d9ebcf1](https://github.com/cadenya/cadenya-ruby/commit/d9ebcf1e47b6bb392dada1aa8e64d230ca342e42))
|
|
11
|
+
|
|
3
12
|
## 0.22.0 (2026-07-01)
|
|
4
13
|
|
|
5
14
|
Full Changelog: [v0.21.0...v0.22.0](https://github.com/cadenya/cadenya-ruby/compare/v0.21.0...v0.22.0)
|
data/README.md
CHANGED
|
@@ -17,7 +17,7 @@ To use this gem, install via Bundler by adding the following to your application
|
|
|
17
17
|
<!-- x-release-please-start-version -->
|
|
18
18
|
|
|
19
19
|
```ruby
|
|
20
|
-
gem "cadenya", "~> 0.
|
|
20
|
+
gem "cadenya", "~> 0.23.0"
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
<!-- x-release-please-end -->
|
|
@@ -37,6 +37,18 @@ account = cadenya.account.retrieve
|
|
|
37
37
|
puts(account.info)
|
|
38
38
|
```
|
|
39
39
|
|
|
40
|
+
### Streaming
|
|
41
|
+
|
|
42
|
+
We provide support for streaming responses using Server-Sent Events (SSE).
|
|
43
|
+
|
|
44
|
+
```ruby
|
|
45
|
+
stream = cadenya.objectives.stream_events_streaming
|
|
46
|
+
|
|
47
|
+
stream.each do |objective|
|
|
48
|
+
puts(objective.data)
|
|
49
|
+
end
|
|
50
|
+
```
|
|
51
|
+
|
|
40
52
|
### Pagination
|
|
41
53
|
|
|
42
54
|
List methods in the Cadenya API are paginated.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Cadenya
|
|
4
|
+
module Internal
|
|
5
|
+
# @generic Elem
|
|
6
|
+
#
|
|
7
|
+
# @example
|
|
8
|
+
# stream.each do |event|
|
|
9
|
+
# puts(event)
|
|
10
|
+
# end
|
|
11
|
+
class Stream
|
|
12
|
+
include Cadenya::Internal::Type::BaseStream
|
|
13
|
+
|
|
14
|
+
# @api private
|
|
15
|
+
#
|
|
16
|
+
# @return [Enumerable<generic<Elem>>]
|
|
17
|
+
private def iterator
|
|
18
|
+
@iterator ||= Cadenya::Internal::Util.chain_fused(@stream) do |y|
|
|
19
|
+
@stream.each do |msg|
|
|
20
|
+
case msg
|
|
21
|
+
in {data: String => data}
|
|
22
|
+
decoded = JSON.parse(data, symbolize_names: true)
|
|
23
|
+
unwrapped = Cadenya::Internal::Util.dig(decoded, @unwrap)
|
|
24
|
+
y << Cadenya::Internal::Type::Converter.coerce(@model, unwrapped)
|
|
25
|
+
else
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
@@ -554,7 +554,7 @@ module Cadenya
|
|
|
554
554
|
)
|
|
555
555
|
),
|
|
556
556
|
page: T.nilable(T::Class[Cadenya::Internal::Type::BasePage[Cadenya::Internal::Type::BaseModel]]),
|
|
557
|
-
stream: T.nilable(T::Class[T.anything]),
|
|
557
|
+
stream: T.nilable(T::Class[Cadenya::Internal::Type::BaseStream[T.anything, Cadenya::Internal::Type::BaseModel]]),
|
|
558
558
|
model: T.nilable(Cadenya::Internal::Type::Converter::Input),
|
|
559
559
|
options: T.nilable(Cadenya::RequestOptions::OrHash)
|
|
560
560
|
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Cadenya
|
|
4
|
+
module Internal
|
|
5
|
+
module Type
|
|
6
|
+
# @api private
|
|
7
|
+
#
|
|
8
|
+
# @generic Elem
|
|
9
|
+
#
|
|
10
|
+
# This module provides a base implementation for streaming responses in the SDK.
|
|
11
|
+
#
|
|
12
|
+
# @see https://rubyapi.org/3.2/o/enumerable
|
|
13
|
+
module BaseStream
|
|
14
|
+
include Enumerable
|
|
15
|
+
|
|
16
|
+
# @return [Integer]
|
|
17
|
+
attr_reader :status
|
|
18
|
+
|
|
19
|
+
# @return [Hash{String=>String}]
|
|
20
|
+
attr_reader :headers
|
|
21
|
+
|
|
22
|
+
# @api public
|
|
23
|
+
#
|
|
24
|
+
# @return [void]
|
|
25
|
+
def close = Cadenya::Internal::Util.close_fused!(@iterator)
|
|
26
|
+
|
|
27
|
+
# @api private
|
|
28
|
+
#
|
|
29
|
+
# @return [Enumerable<generic<Elem>>]
|
|
30
|
+
private def iterator = (raise NotImplementedError)
|
|
31
|
+
|
|
32
|
+
# @api public
|
|
33
|
+
#
|
|
34
|
+
# @param blk [Proc]
|
|
35
|
+
#
|
|
36
|
+
# @yieldparam [generic<Elem>]
|
|
37
|
+
# @return [void]
|
|
38
|
+
def each(&blk)
|
|
39
|
+
unless block_given?
|
|
40
|
+
raise ArgumentError.new("A block must be given to ##{__method__}")
|
|
41
|
+
end
|
|
42
|
+
@iterator.each(&blk)
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# @api public
|
|
46
|
+
#
|
|
47
|
+
# @return [Enumerator<generic<Elem>>]
|
|
48
|
+
def to_enum = @iterator
|
|
49
|
+
|
|
50
|
+
alias_method :enum_for, :to_enum
|
|
51
|
+
|
|
52
|
+
# @api private
|
|
53
|
+
#
|
|
54
|
+
# @param model [Class, Cadenya::Internal::Type::Converter]
|
|
55
|
+
# @param url [URI::Generic]
|
|
56
|
+
# @param status [Integer]
|
|
57
|
+
# @param headers [Hash{String=>String}]
|
|
58
|
+
# @param response [Net::HTTPResponse]
|
|
59
|
+
# @param unwrap [Symbol, Integer, Array<Symbol, Integer>, Proc]
|
|
60
|
+
# @param stream [Enumerable<Object>]
|
|
61
|
+
def initialize(model:, url:, status:, headers:, response:, unwrap:, stream:)
|
|
62
|
+
@model = model
|
|
63
|
+
@url = url
|
|
64
|
+
@status = status
|
|
65
|
+
@headers = headers
|
|
66
|
+
@response = response
|
|
67
|
+
@unwrap = unwrap
|
|
68
|
+
@stream = stream
|
|
69
|
+
@iterator = iterator
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
# @api private
|
|
73
|
+
#
|
|
74
|
+
# @return [String]
|
|
75
|
+
def inspect
|
|
76
|
+
model = Cadenya::Internal::Type::Converter.inspect(@model, depth: 1)
|
|
77
|
+
|
|
78
|
+
"#<#{self.class}[#{model}]:0x#{object_id.to_s(16)}>"
|
|
79
|
+
end
|
|
80
|
+
end
|
|
81
|
+
end
|
|
82
|
+
end
|
|
83
|
+
end
|
|
@@ -3,23 +3,20 @@
|
|
|
3
3
|
module Cadenya
|
|
4
4
|
module Models
|
|
5
5
|
class AIProviderKeySpec < Cadenya::Internal::Type::BaseModel
|
|
6
|
-
# @!attribute
|
|
7
|
-
#
|
|
8
|
-
#
|
|
9
|
-
# Gemini) simply leave this unset. The endpoint of a named provider is fixed and
|
|
10
|
-
# intentionally not overridable here; use the OpenAI-compatible provider to target
|
|
11
|
-
# a custom endpoint.
|
|
6
|
+
# @!attribute api_key
|
|
7
|
+
# The provider credential. Accepted on create/update; never populated in responses
|
|
8
|
+
# (the server returns an empty value to avoid leaking it).
|
|
12
9
|
#
|
|
13
|
-
# @return [
|
|
14
|
-
optional :
|
|
10
|
+
# @return [String, nil]
|
|
11
|
+
optional :api_key, String, api_name: :apiKey
|
|
15
12
|
|
|
16
|
-
# @!attribute
|
|
17
|
-
#
|
|
18
|
-
#
|
|
19
|
-
#
|
|
13
|
+
# @!attribute openrouter
|
|
14
|
+
# OpenRouterConfig holds OpenRouter-specific settings. Empty for now; it exists as
|
|
15
|
+
# the oneof seam so provider-specific options (region, base URL, etc.) can be
|
|
16
|
+
# added later without restructuring the spec.
|
|
20
17
|
#
|
|
21
|
-
# @return [
|
|
22
|
-
optional :
|
|
18
|
+
# @return [Object, nil]
|
|
19
|
+
optional :openrouter, Cadenya::Internal::Type::Unknown
|
|
23
20
|
|
|
24
21
|
# @!attribute provider
|
|
25
22
|
# The AI provider this key authenticates against.
|
|
@@ -27,163 +24,16 @@ module Cadenya
|
|
|
27
24
|
# @return [Symbol, Cadenya::Models::AIProviderKeySpec::Provider, nil]
|
|
28
25
|
optional :provider, enum: -> { Cadenya::AIProviderKeySpec::Provider }
|
|
29
26
|
|
|
30
|
-
# @!method initialize(
|
|
27
|
+
# @!method initialize(api_key: nil, openrouter: nil, provider: nil)
|
|
31
28
|
# Some parameter documentations has been truncated, see
|
|
32
29
|
# {Cadenya::Models::AIProviderKeySpec} for more details.
|
|
33
30
|
#
|
|
34
|
-
# @param
|
|
31
|
+
# @param api_key [String] The provider credential. Accepted on create/update; never populated in
|
|
35
32
|
#
|
|
36
|
-
# @param
|
|
33
|
+
# @param openrouter [Object] OpenRouterConfig holds OpenRouter-specific settings. Empty for now; it exists
|
|
37
34
|
#
|
|
38
35
|
# @param provider [Symbol, Cadenya::Models::AIProviderKeySpec::Provider] The AI provider this key authenticates against.
|
|
39
36
|
|
|
40
|
-
# @see Cadenya::Models::AIProviderKeySpec#config
|
|
41
|
-
class Config < Cadenya::Internal::Type::BaseModel
|
|
42
|
-
# @!attribute openai
|
|
43
|
-
# OpenAIConfig holds OpenAI-specific settings.
|
|
44
|
-
#
|
|
45
|
-
# @return [Cadenya::Models::AIProviderKeySpec::Config::OpenAI, nil]
|
|
46
|
-
optional :openai, -> { Cadenya::AIProviderKeySpec::Config::OpenAI }
|
|
47
|
-
|
|
48
|
-
# @!attribute openai_compatible
|
|
49
|
-
# OpenAICompatibleConfig configures a generic endpoint that speaks the OpenAI Chat
|
|
50
|
-
# Completions API. The base URL is required and its model catalog is discovered
|
|
51
|
-
# live via GET {base_url}/models.
|
|
52
|
-
#
|
|
53
|
-
# @return [Cadenya::Models::AIProviderKeySpec::Config::OpenAICompatible, nil]
|
|
54
|
-
optional :openai_compatible,
|
|
55
|
-
-> { Cadenya::AIProviderKeySpec::Config::OpenAICompatible },
|
|
56
|
-
api_name: :openaiCompatible
|
|
57
|
-
|
|
58
|
-
# @!attribute openrouter
|
|
59
|
-
# OpenRouterConfig holds OpenRouter-specific settings.
|
|
60
|
-
#
|
|
61
|
-
# @return [Cadenya::Models::AIProviderKeySpec::Config::Openrouter, nil]
|
|
62
|
-
optional :openrouter, -> { Cadenya::AIProviderKeySpec::Config::Openrouter }
|
|
63
|
-
|
|
64
|
-
# @!method initialize(openai: nil, openai_compatible: nil, openrouter: nil)
|
|
65
|
-
# Some parameter documentations has been truncated, see
|
|
66
|
-
# {Cadenya::Models::AIProviderKeySpec::Config} for more details.
|
|
67
|
-
#
|
|
68
|
-
# AIProviderConfig holds non-secret, provider-specific settings. The set case must
|
|
69
|
-
# correspond to AIProviderKeySpec.provider. Providers with no settings (Anthropic,
|
|
70
|
-
# Gemini) simply leave this unset. The endpoint of a named provider is fixed and
|
|
71
|
-
# intentionally not overridable here; use the OpenAI-compatible provider to target
|
|
72
|
-
# a custom endpoint.
|
|
73
|
-
#
|
|
74
|
-
# @param openai [Cadenya::Models::AIProviderKeySpec::Config::OpenAI] OpenAIConfig holds OpenAI-specific settings.
|
|
75
|
-
#
|
|
76
|
-
# @param openai_compatible [Cadenya::Models::AIProviderKeySpec::Config::OpenAICompatible] OpenAICompatibleConfig configures a generic endpoint that speaks the OpenAI
|
|
77
|
-
#
|
|
78
|
-
# @param openrouter [Cadenya::Models::AIProviderKeySpec::Config::Openrouter] OpenRouterConfig holds OpenRouter-specific settings.
|
|
79
|
-
|
|
80
|
-
# @see Cadenya::Models::AIProviderKeySpec::Config#openai
|
|
81
|
-
class OpenAI < Cadenya::Internal::Type::BaseModel
|
|
82
|
-
# @!attribute organization_id
|
|
83
|
-
# Sent as the OpenAI-Organization header when set.
|
|
84
|
-
#
|
|
85
|
-
# @return [String, nil]
|
|
86
|
-
optional :organization_id, String, api_name: :organizationId
|
|
87
|
-
|
|
88
|
-
# @!attribute project_id
|
|
89
|
-
# Sent as the OpenAI-Project header when set.
|
|
90
|
-
#
|
|
91
|
-
# @return [String, nil]
|
|
92
|
-
optional :project_id, String, api_name: :projectId
|
|
93
|
-
|
|
94
|
-
# @!method initialize(organization_id: nil, project_id: nil)
|
|
95
|
-
# OpenAIConfig holds OpenAI-specific settings.
|
|
96
|
-
#
|
|
97
|
-
# @param organization_id [String] Sent as the OpenAI-Organization header when set.
|
|
98
|
-
#
|
|
99
|
-
# @param project_id [String] Sent as the OpenAI-Project header when set.
|
|
100
|
-
end
|
|
101
|
-
|
|
102
|
-
# @see Cadenya::Models::AIProviderKeySpec::Config#openai_compatible
|
|
103
|
-
class OpenAICompatible < Cadenya::Internal::Type::BaseModel
|
|
104
|
-
# @!attribute base_url
|
|
105
|
-
#
|
|
106
|
-
# @return [String, nil]
|
|
107
|
-
optional :base_url, String, api_name: :baseUrl
|
|
108
|
-
|
|
109
|
-
# @!method initialize(base_url: nil)
|
|
110
|
-
# OpenAICompatibleConfig configures a generic endpoint that speaks the OpenAI Chat
|
|
111
|
-
# Completions API. The base URL is required and its model catalog is discovered
|
|
112
|
-
# live via GET {base_url}/models.
|
|
113
|
-
#
|
|
114
|
-
# @param base_url [String]
|
|
115
|
-
end
|
|
116
|
-
|
|
117
|
-
# @see Cadenya::Models::AIProviderKeySpec::Config#openrouter
|
|
118
|
-
class Openrouter < Cadenya::Internal::Type::BaseModel
|
|
119
|
-
# @!attribute region
|
|
120
|
-
# Data-residency region (e.g. "us", "eu"). Empty uses the provider default.
|
|
121
|
-
#
|
|
122
|
-
# @return [String, nil]
|
|
123
|
-
optional :region, String
|
|
124
|
-
|
|
125
|
-
# @!method initialize(region: nil)
|
|
126
|
-
# OpenRouterConfig holds OpenRouter-specific settings.
|
|
127
|
-
#
|
|
128
|
-
# @param region [String] Data-residency region (e.g. "us", "eu"). Empty uses the provider default.
|
|
129
|
-
end
|
|
130
|
-
end
|
|
131
|
-
|
|
132
|
-
# @see Cadenya::Models::AIProviderKeySpec#credentials
|
|
133
|
-
class Credentials < Cadenya::Internal::Type::BaseModel
|
|
134
|
-
# @!attribute api_key
|
|
135
|
-
# CredentialAPIKey carries a single bearer/header API key.
|
|
136
|
-
#
|
|
137
|
-
# @return [Cadenya::Models::AIProviderKeySpec::Credentials::APIKey, nil]
|
|
138
|
-
optional :api_key, -> { Cadenya::AIProviderKeySpec::Credentials::APIKey }, api_name: :apiKey
|
|
139
|
-
|
|
140
|
-
# @!attribute headers
|
|
141
|
-
# CredentialHeaders carries arbitrary HTTP headers sent with every request to the
|
|
142
|
-
# provider (e.g. {"Authorization": "Bearer ...", "X-Api-Key": "..."}).
|
|
143
|
-
#
|
|
144
|
-
# @return [Cadenya::Models::AIProviderKeySpec::Credentials::Headers, nil]
|
|
145
|
-
optional :headers, -> { Cadenya::AIProviderKeySpec::Credentials::Headers }
|
|
146
|
-
|
|
147
|
-
# @!method initialize(api_key: nil, headers: nil)
|
|
148
|
-
# Some parameter documentations has been truncated, see
|
|
149
|
-
# {Cadenya::Models::AIProviderKeySpec::Credentials} for more details.
|
|
150
|
-
#
|
|
151
|
-
# AIProviderCredential is the secret material used to authenticate with a
|
|
152
|
-
# provider. The set case must correspond to AIProviderKeySpec.provider. The server
|
|
153
|
-
# encrypts the serialized message at rest and never returns it on reads.
|
|
154
|
-
#
|
|
155
|
-
# @param api_key [Cadenya::Models::AIProviderKeySpec::Credentials::APIKey] CredentialAPIKey carries a single bearer/header API key.
|
|
156
|
-
#
|
|
157
|
-
# @param headers [Cadenya::Models::AIProviderKeySpec::Credentials::Headers] CredentialHeaders carries arbitrary HTTP headers sent with every request to
|
|
158
|
-
|
|
159
|
-
# @see Cadenya::Models::AIProviderKeySpec::Credentials#api_key
|
|
160
|
-
class APIKey < Cadenya::Internal::Type::BaseModel
|
|
161
|
-
# @!attribute api_key
|
|
162
|
-
#
|
|
163
|
-
# @return [String, nil]
|
|
164
|
-
optional :api_key, String, api_name: :apiKey
|
|
165
|
-
|
|
166
|
-
# @!method initialize(api_key: nil)
|
|
167
|
-
# CredentialAPIKey carries a single bearer/header API key.
|
|
168
|
-
#
|
|
169
|
-
# @param api_key [String]
|
|
170
|
-
end
|
|
171
|
-
|
|
172
|
-
# @see Cadenya::Models::AIProviderKeySpec::Credentials#headers
|
|
173
|
-
class Headers < Cadenya::Internal::Type::BaseModel
|
|
174
|
-
# @!attribute headers
|
|
175
|
-
#
|
|
176
|
-
# @return [Hash{Symbol=>String}, nil]
|
|
177
|
-
optional :headers, Cadenya::Internal::Type::HashOf[String]
|
|
178
|
-
|
|
179
|
-
# @!method initialize(headers: nil)
|
|
180
|
-
# CredentialHeaders carries arbitrary HTTP headers sent with every request to the
|
|
181
|
-
# provider (e.g. {"Authorization": "Bearer ...", "X-Api-Key": "..."}).
|
|
182
|
-
#
|
|
183
|
-
# @param headers [Hash{Symbol=>String}]
|
|
184
|
-
end
|
|
185
|
-
end
|
|
186
|
-
|
|
187
37
|
# The AI provider this key authenticates against.
|
|
188
38
|
#
|
|
189
39
|
# @see Cadenya::Models::AIProviderKeySpec#provider
|
|
@@ -192,10 +42,6 @@ module Cadenya
|
|
|
192
42
|
|
|
193
43
|
AI_PROVIDER_UNSPECIFIED = :AI_PROVIDER_UNSPECIFIED
|
|
194
44
|
AI_PROVIDER_OPENROUTER = :AI_PROVIDER_OPENROUTER
|
|
195
|
-
AI_PROVIDER_OPENAI = :AI_PROVIDER_OPENAI
|
|
196
|
-
AI_PROVIDER_ANTHROPIC = :AI_PROVIDER_ANTHROPIC
|
|
197
|
-
AI_PROVIDER_GEMINI = :AI_PROVIDER_GEMINI
|
|
198
|
-
AI_PROVIDER_OPENAI_COMPATIBLE = :AI_PROVIDER_OPENAI_COMPATIBLE
|
|
199
45
|
|
|
200
46
|
# @!method self.values
|
|
201
47
|
# @return [Array<Symbol>]
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
module Cadenya
|
|
4
4
|
module Models
|
|
5
5
|
# @see Cadenya::Resources::Objectives#continue
|
|
6
|
-
class
|
|
6
|
+
class ObjectiveEvent < Cadenya::Internal::Type::BaseModel
|
|
7
7
|
# @!attribute data
|
|
8
8
|
#
|
|
9
9
|
# @return [Cadenya::Models::ObjectiveEventData]
|
|
@@ -28,7 +28,7 @@ module Cadenya
|
|
|
28
28
|
|
|
29
29
|
# @!method initialize(data:, metadata:, context_window_id: nil, info: nil)
|
|
30
30
|
# Some parameter documentations has been truncated, see
|
|
31
|
-
# {Cadenya::Models::
|
|
31
|
+
# {Cadenya::Models::ObjectiveEvent} for more details.
|
|
32
32
|
#
|
|
33
33
|
# @param data [Cadenya::Models::ObjectiveEventData]
|
|
34
34
|
#
|
|
@@ -58,10 +58,8 @@ module Cadenya
|
|
|
58
58
|
|
|
59
59
|
# @!attribute objective_event
|
|
60
60
|
#
|
|
61
|
-
# @return [Cadenya::Models::
|
|
62
|
-
required :objective_event,
|
|
63
|
-
-> { Cadenya::ObjectiveEventWebhookData::Data::ObjectiveEvent },
|
|
64
|
-
api_name: :objectiveEvent
|
|
61
|
+
# @return [Cadenya::Models::ObjectiveEvent]
|
|
62
|
+
required :objective_event, -> { Cadenya::ObjectiveEvent }, api_name: :objectiveEvent
|
|
65
63
|
|
|
66
64
|
# @!method initialize(agent:, agent_variation:, objective:, objective_event:)
|
|
67
65
|
# Some parameter documentations has been truncated, see
|
|
@@ -76,45 +74,7 @@ module Cadenya
|
|
|
76
74
|
#
|
|
77
75
|
# @param objective [Cadenya::Models::OperationMetadata] Metadata for ephemeral operations and activities (e.g., objectives, executions,
|
|
78
76
|
#
|
|
79
|
-
# @param objective_event [Cadenya::Models::
|
|
80
|
-
|
|
81
|
-
# @see Cadenya::Models::ObjectiveEventWebhookData::Data#objective_event
|
|
82
|
-
class ObjectiveEvent < Cadenya::Internal::Type::BaseModel
|
|
83
|
-
# @!attribute data
|
|
84
|
-
#
|
|
85
|
-
# @return [Cadenya::Models::ObjectiveEventData]
|
|
86
|
-
required :data, -> { Cadenya::ObjectiveEventData }
|
|
87
|
-
|
|
88
|
-
# @!attribute metadata
|
|
89
|
-
# Metadata for ephemeral operations and activities (e.g., objectives, executions,
|
|
90
|
-
# runs)
|
|
91
|
-
#
|
|
92
|
-
# @return [Cadenya::Models::OperationMetadata]
|
|
93
|
-
required :metadata, -> { Cadenya::OperationMetadata }
|
|
94
|
-
|
|
95
|
-
# @!attribute context_window_id
|
|
96
|
-
#
|
|
97
|
-
# @return [String, nil]
|
|
98
|
-
optional :context_window_id, String, api_name: :contextWindowId
|
|
99
|
-
|
|
100
|
-
# @!attribute info
|
|
101
|
-
#
|
|
102
|
-
# @return [Cadenya::Models::ObjectiveEventInfo, nil]
|
|
103
|
-
optional :info, -> { Cadenya::ObjectiveEventInfo }
|
|
104
|
-
|
|
105
|
-
# @!method initialize(data:, metadata:, context_window_id: nil, info: nil)
|
|
106
|
-
# Some parameter documentations has been truncated, see
|
|
107
|
-
# {Cadenya::Models::ObjectiveEventWebhookData::Data::ObjectiveEvent} for more
|
|
108
|
-
# details.
|
|
109
|
-
#
|
|
110
|
-
# @param data [Cadenya::Models::ObjectiveEventData]
|
|
111
|
-
#
|
|
112
|
-
# @param metadata [Cadenya::Models::OperationMetadata] Metadata for ephemeral operations and activities (e.g., objectives, executions,
|
|
113
|
-
#
|
|
114
|
-
# @param context_window_id [String]
|
|
115
|
-
#
|
|
116
|
-
# @param info [Cadenya::Models::ObjectiveEventInfo]
|
|
117
|
-
end
|
|
77
|
+
# @param objective_event [Cadenya::Models::ObjectiveEvent]
|
|
118
78
|
end
|
|
119
79
|
end
|
|
120
80
|
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Cadenya
|
|
4
|
+
module Models
|
|
5
|
+
# @see Cadenya::Resources::Objectives#stream_events_streaming
|
|
6
|
+
class ObjectiveStreamEventsParams < Cadenya::Internal::Type::BaseModel
|
|
7
|
+
extend Cadenya::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include Cadenya::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
# @!attribute workspace_id
|
|
11
|
+
#
|
|
12
|
+
# @return [String]
|
|
13
|
+
required :workspace_id, String
|
|
14
|
+
|
|
15
|
+
# @!attribute objective_id
|
|
16
|
+
#
|
|
17
|
+
# @return [String]
|
|
18
|
+
required :objective_id, String
|
|
19
|
+
|
|
20
|
+
# @!method initialize(workspace_id:, objective_id:, request_options: {})
|
|
21
|
+
# @param workspace_id [String]
|
|
22
|
+
# @param objective_id [String]
|
|
23
|
+
# @param request_options [Cadenya::RequestOptions, Hash{Symbol=>Object}]
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -58,10 +58,8 @@ module Cadenya
|
|
|
58
58
|
|
|
59
59
|
# @!attribute objective_event
|
|
60
60
|
#
|
|
61
|
-
# @return [Cadenya::Models::
|
|
62
|
-
required :objective_event,
|
|
63
|
-
-> { Cadenya::UnsafeUnwrapWebhookEvent::Data::ObjectiveEvent },
|
|
64
|
-
api_name: :objectiveEvent
|
|
61
|
+
# @return [Cadenya::Models::ObjectiveEvent]
|
|
62
|
+
required :objective_event, -> { Cadenya::ObjectiveEvent }, api_name: :objectiveEvent
|
|
65
63
|
|
|
66
64
|
# @!method initialize(agent:, agent_variation:, objective:, objective_event:)
|
|
67
65
|
# Some parameter documentations has been truncated, see
|
|
@@ -76,45 +74,7 @@ module Cadenya
|
|
|
76
74
|
#
|
|
77
75
|
# @param objective [Cadenya::Models::OperationMetadata] Metadata for ephemeral operations and activities (e.g., objectives, executions,
|
|
78
76
|
#
|
|
79
|
-
# @param objective_event [Cadenya::Models::
|
|
80
|
-
|
|
81
|
-
# @see Cadenya::Models::UnsafeUnwrapWebhookEvent::Data#objective_event
|
|
82
|
-
class ObjectiveEvent < Cadenya::Internal::Type::BaseModel
|
|
83
|
-
# @!attribute data
|
|
84
|
-
#
|
|
85
|
-
# @return [Cadenya::Models::ObjectiveEventData]
|
|
86
|
-
required :data, -> { Cadenya::ObjectiveEventData }
|
|
87
|
-
|
|
88
|
-
# @!attribute metadata
|
|
89
|
-
# Metadata for ephemeral operations and activities (e.g., objectives, executions,
|
|
90
|
-
# runs)
|
|
91
|
-
#
|
|
92
|
-
# @return [Cadenya::Models::OperationMetadata]
|
|
93
|
-
required :metadata, -> { Cadenya::OperationMetadata }
|
|
94
|
-
|
|
95
|
-
# @!attribute context_window_id
|
|
96
|
-
#
|
|
97
|
-
# @return [String, nil]
|
|
98
|
-
optional :context_window_id, String, api_name: :contextWindowId
|
|
99
|
-
|
|
100
|
-
# @!attribute info
|
|
101
|
-
#
|
|
102
|
-
# @return [Cadenya::Models::ObjectiveEventInfo, nil]
|
|
103
|
-
optional :info, -> { Cadenya::ObjectiveEventInfo }
|
|
104
|
-
|
|
105
|
-
# @!method initialize(data:, metadata:, context_window_id: nil, info: nil)
|
|
106
|
-
# Some parameter documentations has been truncated, see
|
|
107
|
-
# {Cadenya::Models::UnsafeUnwrapWebhookEvent::Data::ObjectiveEvent} for more
|
|
108
|
-
# details.
|
|
109
|
-
#
|
|
110
|
-
# @param data [Cadenya::Models::ObjectiveEventData]
|
|
111
|
-
#
|
|
112
|
-
# @param metadata [Cadenya::Models::OperationMetadata] Metadata for ephemeral operations and activities (e.g., objectives, executions,
|
|
113
|
-
#
|
|
114
|
-
# @param context_window_id [String]
|
|
115
|
-
#
|
|
116
|
-
# @param info [Cadenya::Models::ObjectiveEventInfo]
|
|
117
|
-
end
|
|
77
|
+
# @param objective_event [Cadenya::Models::ObjectiveEvent]
|
|
118
78
|
end
|
|
119
79
|
end
|
|
120
80
|
end
|
|
@@ -58,10 +58,8 @@ module Cadenya
|
|
|
58
58
|
|
|
59
59
|
# @!attribute objective_event
|
|
60
60
|
#
|
|
61
|
-
# @return [Cadenya::Models::
|
|
62
|
-
required :objective_event,
|
|
63
|
-
-> { Cadenya::UnwrapWebhookEvent::Data::ObjectiveEvent },
|
|
64
|
-
api_name: :objectiveEvent
|
|
61
|
+
# @return [Cadenya::Models::ObjectiveEvent]
|
|
62
|
+
required :objective_event, -> { Cadenya::ObjectiveEvent }, api_name: :objectiveEvent
|
|
65
63
|
|
|
66
64
|
# @!method initialize(agent:, agent_variation:, objective:, objective_event:)
|
|
67
65
|
# Some parameter documentations has been truncated, see
|
|
@@ -76,44 +74,7 @@ module Cadenya
|
|
|
76
74
|
#
|
|
77
75
|
# @param objective [Cadenya::Models::OperationMetadata] Metadata for ephemeral operations and activities (e.g., objectives, executions,
|
|
78
76
|
#
|
|
79
|
-
# @param objective_event [Cadenya::Models::
|
|
80
|
-
|
|
81
|
-
# @see Cadenya::Models::UnwrapWebhookEvent::Data#objective_event
|
|
82
|
-
class ObjectiveEvent < Cadenya::Internal::Type::BaseModel
|
|
83
|
-
# @!attribute data
|
|
84
|
-
#
|
|
85
|
-
# @return [Cadenya::Models::ObjectiveEventData]
|
|
86
|
-
required :data, -> { Cadenya::ObjectiveEventData }
|
|
87
|
-
|
|
88
|
-
# @!attribute metadata
|
|
89
|
-
# Metadata for ephemeral operations and activities (e.g., objectives, executions,
|
|
90
|
-
# runs)
|
|
91
|
-
#
|
|
92
|
-
# @return [Cadenya::Models::OperationMetadata]
|
|
93
|
-
required :metadata, -> { Cadenya::OperationMetadata }
|
|
94
|
-
|
|
95
|
-
# @!attribute context_window_id
|
|
96
|
-
#
|
|
97
|
-
# @return [String, nil]
|
|
98
|
-
optional :context_window_id, String, api_name: :contextWindowId
|
|
99
|
-
|
|
100
|
-
# @!attribute info
|
|
101
|
-
#
|
|
102
|
-
# @return [Cadenya::Models::ObjectiveEventInfo, nil]
|
|
103
|
-
optional :info, -> { Cadenya::ObjectiveEventInfo }
|
|
104
|
-
|
|
105
|
-
# @!method initialize(data:, metadata:, context_window_id: nil, info: nil)
|
|
106
|
-
# Some parameter documentations has been truncated, see
|
|
107
|
-
# {Cadenya::Models::UnwrapWebhookEvent::Data::ObjectiveEvent} for more details.
|
|
108
|
-
#
|
|
109
|
-
# @param data [Cadenya::Models::ObjectiveEventData]
|
|
110
|
-
#
|
|
111
|
-
# @param metadata [Cadenya::Models::OperationMetadata] Metadata for ephemeral operations and activities (e.g., objectives, executions,
|
|
112
|
-
#
|
|
113
|
-
# @param context_window_id [String]
|
|
114
|
-
#
|
|
115
|
-
# @param info [Cadenya::Models::ObjectiveEventInfo]
|
|
116
|
-
end
|
|
77
|
+
# @param objective_event [Cadenya::Models::ObjectiveEvent]
|
|
117
78
|
end
|
|
118
79
|
end
|
|
119
80
|
end
|
data/lib/cadenya/models.rb
CHANGED
|
@@ -183,6 +183,8 @@ module Cadenya
|
|
|
183
183
|
|
|
184
184
|
ObjectiveError = Cadenya::Models::ObjectiveError
|
|
185
185
|
|
|
186
|
+
ObjectiveEvent = Cadenya::Models::ObjectiveEvent
|
|
187
|
+
|
|
186
188
|
ObjectiveEventData = Cadenya::Models::ObjectiveEventData
|
|
187
189
|
|
|
188
190
|
ObjectiveEventInfo = Cadenya::Models::ObjectiveEventInfo
|
|
@@ -203,6 +205,8 @@ module Cadenya
|
|
|
203
205
|
|
|
204
206
|
ObjectiveSecret = Cadenya::Models::ObjectiveSecret
|
|
205
207
|
|
|
208
|
+
ObjectiveStreamEventsParams = Cadenya::Models::ObjectiveStreamEventsParams
|
|
209
|
+
|
|
206
210
|
OperationMetadata = Cadenya::Models::OperationMetadata
|
|
207
211
|
|
|
208
212
|
Page = Cadenya::Models::Page
|