Listing of which clojure.core functions are implemented #108
Answered
by
borkdude
stevemolitor
asked this question in
Q&A
|
Is there a listing or source file I can check to see which (ns ai-poll
(:require ["openai" :as OpenAI]
[clojure.walk :as w]))
(def openai (OpenAI/OpenAI.))
(defn ^:async ask-ai [question temp]
(let [payload (clj->js {:messages [{:role "user", :content question}] :model "gpt-4", :temperature temp})
response (js/await (.chat.completions.create openai payload))
{{answer :content} :message} (first (:choices (w/keywordize-keys (js->clj response))))]
answer))Context: I want to convert the response here from string map keys to keyword keys. |
Answered by
borkdude
Aug 18, 2023
Replies: 3 comments 2 replies
|
I should add both cherry and squint are super fun btw! It's so great to be able to just leverage the npm ecosystem but use s expressions! Love it. |
0 replies
|
We can add clojure.walk, it's currently not packaged. clojure.string is, but we can do clojure.walk in a similar fashion. Would you like to try a PR or would you like me to do it? |
1 reply
|
Just added |
1 reply
Answer selected by
stevemolitor
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Just added
clojure.string(it turned out it wasn't there yet) andclojure.walk