Skip to content

Commit

Permalink
Changes async response to return body only when de-referenced
Browse files Browse the repository at this point in the history
  • Loading branch information
wkok committed Jan 31, 2024
1 parent cfd715b commit efcf882
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/wkok/openai_clojure/sse.clj
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,13 @@

(if async?

((:leave martian.hato/perform-request-async) ctx')
(-> ((:leave martian.hato/perform-request-async) ctx')
(update :response
#(.thenApply
%
(reify java.util.function.Function
(apply [_ response']
(:body response'))))))

(assoc ctx :response (if (:stream params)
(sse-request ctx')
Expand Down

0 comments on commit efcf882

Please sign in to comment.