ClojureScript and Dynamic!? Re-charts

I simply forgot how easy it was to use ClojureScript for charting.

Someone got in touch with me recently to give them an example on how things are again, so here it is.

The data set is an atom, so that eventually the reagent/react reactive rendering framework can be used as its best.

(defonce data (r/atom [  {:name "Page A" :uv 4000 :pv 2400}
                         {:name "Page B" :uv 3000 :pv 1398}
                         {:name "Page C" :uv 2000 :pv 9800}
                         {:name "Page D" :uv 2780 :pv 3908}
                         {:name "Page E" :uv 1890 :pv 4800}
                         {:name "Page F" :uv 2390 :pv 3800}
                         {:name "Page G" :uv 3490 :pv 4300}]))

The chart is a two lines chart, one for the uv series, and one for the pv series.

What surprising skills do leaders need to innovate with generative AI?

This article from the Guardian, picked up my curiosity.

“What surprising skills do leaders need to innovate with generative AI?”

So I asked my model, to come up with a mindmap summary of the main concepts of the article:

../12_02.png

It’s a bit short on details and underlying concepts.

Asking the same question directly to the model was (not-) surprisingly more verbose and interesting.

Visualizing Large Language Model Outputs with Mindmaps and ClojureScript

Introduction

In recent years, Large Language Models (LLMs) have revolutionized the field of natural language processing. These models can generate human-like text based on a given input, making them a valuable tool for various applications, including text analysis, sentiment analysis, and more. However, one major limitation of LLM outputs is their lack of visual representation. This makes it difficult to understand complex relationships between ideas or concepts.

To overcome this limitation, we can use mindmaps to visualize the output of LLMs. Mindmaps are a graphical representation of ideas, concepts, and relationships, making them an ideal tool for understanding complex information. In this blog post, we will explore how to integrate ClojureScript with LLM outputs using Markmap, a JavaScript library that allows us to convert Markdown text to mindmaps.

Using OpenRouter to access large models library

OpenRouter makes it super easy to just get best scores at school by using a large set of models available.

; claude-write-fibonacci

(require '[pyjama.openrouter.core :as openrouter])
(let [response (openrouter/with-prompt "Write Fibonacci in Clojure!")]
  (println
    (-> response :choices first :message :content)))

I actually wanted to evaluate answers from anthropic/claude-3.7-sonnet so that model is the default one for open router.

With a bit of rewriting around, we can get something vastly more generic, where the prompt and the model are simply calling openrouter/with-config.

ChatGPT 4.5-preview

ChatGPT 4.5 Preview meets Pyjama: Clojure Conversations Just Got Smarter!

The latest and greatest from OpenAI—ChatGPT 4.5 Preview—is out in the wild! And what’s better than playing around with cutting-edge AI? Doing so directly from your favorite REPL, thanks to Pyjama, your go-to Clojure companion for seamless interactions with ChatGPT.

Quick recap: Calling ChatGPT from Clojure

With Pyjama, chatting with GPT is as straightforward as ever:

(require '[pyjama.chatgpt.core :as gpt])

(gpt/chatgpt
  {:prompt "give me a command to show number of sata ports linux"})

And to harness the power of the shiny new GPT-4.5-preview model, it’s just a small configuration tweak away:

FIKA - Filosophy Kafe #1

Our first new AI event, to get hands-on AI agents joining a specific topic and battling for wits, and intelligence, happened today at the Karabiner Office.

../08_02.png

Setup was to use the pyjama-philosophers arena, and let custom agents join the on-going conversation after theme was decided between the human participants.

../08_01.png

There are templates for Agents in different languages, namely Rust, Python, Clojure and .. Ruby !