ask-graph 0.1.1 → 0.1.2
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 +18 -0
- data/lib/ask/graph/version.rb +1 -1
- data/lib/ask/graph.rb +9 -9
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c00714c8b8feb0d71aa93636f39f077b14f19ef5405efdc667317f4fe99cc6a2
|
|
4
|
+
data.tar.gz: 29cc8acc5187762918a2084bd2f3578df5ee5e6383a3b6d1edde1e4df519604a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7291024a6f4b113e87f0cf2b6005e6dd44aa3e913dc509350e6d15fb061d64b091d05c7cd6c72dca4dae291a7a329c5d95dda94c80122b128773fda1ae510102
|
|
7
|
+
data.tar.gz: 1d5692fdd06f6a3a626f704f32bef5f75e70078846567650fb583325b188f16f2647ac17e87c0bc3c441f71ac6d1fd8ffce580fddf8f3fa7b999f462b2227079
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,21 @@
|
|
|
1
|
+
## [0.1.2] — 2026-07-28
|
|
2
|
+
|
|
3
|
+
### Changed
|
|
4
|
+
|
|
5
|
+
- **`Graph.new(input).call` API** — input is now passed to the constructor, not to `call`. This reads more naturally: create a graph with data, then execute it. `Graph.call(input, checkpoint_store:)` class method still available for convenience.
|
|
6
|
+
|
|
7
|
+
```ruby
|
|
8
|
+
# Before
|
|
9
|
+
HandleCall.new.call(recording: "call.wav")
|
|
10
|
+
|
|
11
|
+
# After
|
|
12
|
+
HandleCall.new({ recording: "call.wav" }).call
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
### Tested
|
|
16
|
+
|
|
17
|
+
- 36 tests, 52 assertions, 0 failures
|
|
18
|
+
|
|
1
19
|
## [0.1.1] — 2026-07-28
|
|
2
20
|
|
|
3
21
|
### Fixed
|
data/lib/ask/graph/version.rb
CHANGED
data/lib/ask/graph.rb
CHANGED
|
@@ -83,15 +83,16 @@ module Ask
|
|
|
83
83
|
# @param checkpoint_store [#set, #get, #delete] optional persistent store
|
|
84
84
|
# @return [Ask::Graph::Context] the completed context
|
|
85
85
|
def call(input = nil, checkpoint_store: nil)
|
|
86
|
-
new(checkpoint_store: checkpoint_store).call
|
|
86
|
+
new(input, checkpoint_store: checkpoint_store).call
|
|
87
87
|
end
|
|
88
88
|
alias run call
|
|
89
89
|
end
|
|
90
90
|
|
|
91
|
-
# @param
|
|
92
|
-
#
|
|
93
|
-
# for crash recovery.
|
|
94
|
-
def initialize(checkpoint_store: nil)
|
|
91
|
+
# @param input [Object, nil] initial input for the graph execution
|
|
92
|
+
# @param checkpoint_store [#set, #get, #delete, nil] optional persistent store.
|
|
93
|
+
# Defaults to in-memory store. Pass a persistent store for crash recovery.
|
|
94
|
+
def initialize(input = nil, checkpoint_store: nil)
|
|
95
|
+
@input = input
|
|
95
96
|
store = checkpoint_store || Ask::State::Memory.new
|
|
96
97
|
@runner = Runner.new(self.class.declarations, checkpoint_store: store)
|
|
97
98
|
@context = nil
|
|
@@ -103,11 +104,10 @@ module Ask
|
|
|
103
104
|
# @return [Ask::Graph::Context, nil] the shared context
|
|
104
105
|
attr_reader :context
|
|
105
106
|
|
|
106
|
-
#
|
|
107
|
-
# @param input [Object] optional initial input
|
|
107
|
+
# Execute the graph.
|
|
108
108
|
# @return [Ask::Graph::Context] the completed context
|
|
109
|
-
def call
|
|
110
|
-
@context = Context.new(self, input)
|
|
109
|
+
def call
|
|
110
|
+
@context = Context.new(self, @input)
|
|
111
111
|
@runner.run(@context)
|
|
112
112
|
@context
|
|
113
113
|
rescue => e
|