File tree Expand file tree Collapse file tree
test/simulflow/processors Expand file tree Collapse file tree Original file line number Diff line number Diff line change 138138 ::flow/out-ports {::llm-write llm-write}})))
139139
140140(defn transition
141- [{::flow/keys [in-ports out-ports]} transition]
141+ [{::flow/keys [in-ports out-ports] :as state } transition]
142142 (when (= transition ::flow/stop )
143143 (doseq [port (concat (vals in-ports) (vals out-ports))]
144- (a/close! port))))
144+ (a/close! port)))
145+ state )
145146
146147(defn transform-handle-llm-response
147148 " Handle the streaming response from the LLM. Return appropriate frames based on
Original file line number Diff line number Diff line change 236236 ; ; This test would need mock channels to verify closure
237237 ; ; For now, just test that the function exists and doesn't throw
238238 (let [mock-state {:clojure.core.async.flow/in-ports {} :clojure.core.async.flow/out-ports {}}]
239- (is (nil? (openai/transition mock-state :clojure.core.async.flow/stop )))))
239+ (is (= (openai/transition mock-state :clojure.core.async.flow/stop ) mock-state ))))
240240
241241 (testing " ignores non-stop transitions"
242242 (let [mock-state {:clojure.core.async.flow/in-ports {} :clojure.core.async.flow/out-ports {}}]
243- (is (nil? (openai/transition mock-state :clojure.core.async.flow/start ))))))
243+ (is (= (openai/transition mock-state :clojure.core.async.flow/start ) mock-state )))))
244244
245245(deftest openai-multi-arity-fn-test
246246 (testing " 0-arity returns describe"
251251
252252 (testing " 2-arity delegates to transition"
253253 (let [mock-state {:clojure.core.async.flow/in-ports {} :clojure.core.async.flow/out-ports {}}]
254- (is (nil? (openai/openai-llm-fn mock-state :clojure.core.async.flow/stop )))))
254+ (is (= mock-state (openai/openai-llm-fn mock-state :clojure.core.async.flow/stop )))))
255255
256256 (testing " 3-arity delegates to transform"
257257 (let [context-frame (frame/llm-context {:messages [{:role :system :content " You are helpful" }] :tools []})
You can’t perform that action at this time.
0 commit comments