Skip to content

Commit 775e725

Browse files
committed
Added async test
1 parent efcf882 commit 775e725

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

test/wkok/openai_clojure/api_integration_test.clj

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,17 @@
1010
{:role "assistant" :content "The Los Angeles Dodgers won the World Series in 2020."}
1111
{:role "user" :content "Where was it played?"}]})
1212
:choices))))
13+
14+
15+
(deftest create-chat-completion-async
16+
(testing "creates a simple chat completion async"
17+
(let [result (api/create-chat-completion {:model "gpt-3.5-turbo"
18+
:messages [{:role "system" :content "You are a helpful assistant."}
19+
{:role "user" :content "Who won the world series in 2020?"}
20+
{:role "assistant" :content "The Los Angeles Dodgers won the World Series in 2020."}
21+
{:role "user" :content "Where was it played?"}]}
22+
{:request {:async? true}})]
23+
24+
(is (future? result))
25+
26+
(is (contains? @result :choices)))))

0 commit comments

Comments
 (0)