Comment by sam_
4 years ago
Just tried the same but telling ChatGPT to be an Emacs Lisp Interpreter. The results are very impressive in my opinion.
> (let (test "I'm a blue whale")
> (message (format "%s" test)))
I'm a blue whale
> (setq humans '(Joe Anna David)))
(nothing shown as expected)
> (defun print-elements-of-list ....)
> (print-elements-of-list humans)
Joe Anna David
> {make a boilerplate emacs package and show me the code}
[valid boilerplate]
> {show me the code to create a completion at point function}
[a good looking piece of code that could help me code a custom completion function!]
Ditto for a SQL Database. I am blown away by this.
> I want you to act as a SQL database. I will type commands and you will reply with what the database should show. I want you to only reply with the terminal output inside one unique code block, and nothing else. Do no write explanations. Do not type commands unless I instruct you to do so. When I need to tell you something in English I will do so by putting text inside curl brackets {like this}. My first command is `SELECT 1`.
> SHOW DATABASES
> CREATE DATABASE gpt
> USE gpt
> CREATE TABLE TestTable AS SELECT 1234 AS 'col1'
> SELECT * FROM TestTable
> SELECT COUNT(*) FROM TestTable
> DELETE FROM TestTable WHERE 1 = 0
> SELECT * FROM TestTable
> DELETE FROM TestTable WHERE 19 > 1
> SELECT * FROM TestTable
And a Python 3 REPL:
> I want you to act as a python3 REPL. I will type commands and you will reply with what the REPL should show. I want you to only reply with the REPL output inside one unique code block, and nothing else. Do no write explanations. Do not type commands unless I instruct you to do so. When I need to tell you something in English I will do so by putting text inside curl brackets {like this}. My first command is: print("hello world")
import sys; print(sys.version)
355/113
https://docs.google.com/document/d/1hfCiyjiotMZvtPlGN_0uqbK9...
That's very impressive. Using commands like:
> {show data in the foo table as csv}
> {show data in the foo table as json}
> {show data in the foo table as yaml}
It'll even fulfill those requests.
Using a similar prompt to your original I got it to act as a MongoDB database as well. Then took it a step further and asked it to generate SQL INSERT statements and a CREATE TABLE statement for the MongoDB data.
I could get it to give me incorrect results if I made my query complicated enough, but man, it's almost scary how good it is.
All that said, definitely the slowest response times I've ever had for tables/collections that small :)