Simon Willison
Simon Willison
I deployed a demo to https://datasette-latest-query-info-j7hipcg4aq-uc.a.run.app using the mechanism from #1442. e.g. demo here: https://datasette-latest-query-info-j7hipcg4aq-uc.a.run.app/fixtures?sql=select+*+from+searchable
Here's the problem: https://github.com/muicss/mui/blob/d1774138e025f99c870f9dbb556163028cc2d475/build-targets/cdn-webcomponents.js#L11-L14 `document.registerElement` is obsolete and has been removed from some browsers. The thing to check for instead is `window.customElements`.
I just tried an experiment using [Rich](https://rich.readthedocs.io/) and a new `--rich` option: Annoyingly I don't think I can support `--stream` at the same time, so you have to wait for...
Here's the code for that prototype: ```diff diff --git a/llm/cli.py b/llm/cli.py index 2ed4d8b..1a2c92c 100644 --- a/llm/cli.py +++ b/llm/cli.py @@ -4,6 +4,8 @@ import datetime import json import openai import os...
I tried adding Rich table support to `llm logs` and got this:  Note that's with the new `--truncate` option - without that I get:...
Here's that updated prototype: ```diff diff --git a/llm/cli.py b/llm/cli.py index 2ed4d8b..5b74959 100644 --- a/llm/cli.py +++ b/llm/cli.py @@ -4,6 +4,9 @@ import datetime import json import openai import os +from rich.console...
Here's another example using `rich.print_json()` for the log output:
Huh! That's really cool - yeah, I think I _could_ support `--stream` after all, since Rich knows how to clear the console. Found your code for that here: https://github.com/sderev/shellgenius/blob/v0.1.8/shellgenius/cli.py Relevant...
This is a shame: `rich.markdown` doesn't support tables yet (which ChatGPT and friends like to include in their markdown output): - https://github.com/Textualize/rich/issues/1868#issuecomment-1036106767 I demonstrated that to myself with: `sqlite-utils ~/Dropbox/Development/datasette.io/content.db...
Got an animated Live demo working with this code: ```diff diff --git a/llm/cli.py b/llm/cli.py index 37dd9ed..c6ed001 100644 --- a/llm/cli.py +++ b/llm/cli.py @@ -4,6 +4,9 @@ import datetime import json import...