Pen.el
https://github.com/semiosis/pen.el
Ink.el
https://github.com/semiosis/ink.el
prompts
https://github.com/semiosis/prompts
engines
https://github.com/semiosis/engines
Moire’s blog on Quantifying Curation
https://generative.ink/posts/quantifying-curation/

Introducing Ink.el

The purpose of Ink.el is to encode within its text properties information about its own provenance. What was the intended meaning behind parts of the text? Annotations made by the writer are encoded in Ink. Where did the text originate? Data of a LM’s influence is also included.

It was created for Pen.el. It is generated when you generate text with Pen.el in order to encode how the text was generated.

Ink.el is used by Pen.el when interpretation of the meaning of text is required. Knowledge of which LM has generated a given text snippet, the language of the text (understood by said model) and the context within that language are all important when interpreting the meaning of that text, and it is for that reason that tasks and metaprompts may employ the ink format.

Demo

You can see the text highlighted if it has been generated, and the text contains metadata on how it was generated. You can right click the text to go to the prompt that generated it, for example.

The file format .ink automatically generates a view buffer running ink-source-mode. ink-mode and ink-source-mode work in tandem and try to remain in sync with each other when either is saved. Saving a .ink file will record all of its metadata.

Further explanations

Quantifying curation is also important. After using many different LMs to assist in creating a document, the text may be analysed by reading information contained in the ink format.

This is a text format that is designed for easy editing via emacs, like normal text.

It is loaded and emacs text properties encode the state of the buffer, plus functions for regenerating text.

The prototype will be in emacs lisp using text properties.

  • This is a document format that contains and evaluates to the document as it is meant to be viewed.
  • It also contains annotations for the transformations, inputs and outputs of those transformations.

Example

Here is some ink text as the value for the task: key in a yaml file.

The text contains information on the engine, language and topic required to interpret the meaning of the task.

1
task: '*("Translate Haskell to Clojure" 0 27 (engine "OpenAI Davinci" language "English" topic "programming"))'

Goals

  • Encode state as well as metadata about what model generated the text.
  • Retain information on the completion functions used to generate the document so parts can be re-evaluated at will.
  • Become a file format for encoding meta-documents.
    • A meta-document is like a template.
  • YASnippet compatibility (may be used as snippets).

Example prompt

Here, the task is encoded in Ink.

If (in future) the prompt disappears, the task will remain and it will be important to associate the task with a LM so the user knows what the task means.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
task: '*("Transpile from programming language X to Y" 0 41 (engine "OpenAI Davinci" language "English" topic "Programming"))'
prompt-version: 6
prompt: |+
    ###
    Haskell: zip (map show [1,5,9]) ["a","b","c"]
    Clojure: (println (map vector '(1 2 3) '(4 5 6)))
    ###
    Clojure: (clojure.string/upper-case "MiXeD cAsE")
    Haskell: map toUpper "MiXeD cAsE"
    ###
    <2>: <1>
    <3>:    
engine: OpenAI Davinci
temperature: 0.3
max-tokens: 400
top-p: 1
stop-sequences:
- "###"
stop-patterns:
- "^[a-zA-Z]+:"
vars:
- code
- from language
- to language
preprocessors:
- pen-s onelineify
- cat
- cat
# Use s-preserve-trailing-whitespace within pen.el
# Chomp is needed because of stop-patterns
postprocessor: pen-s unonelineify | chomp
examples:
- min 1 2
- Haskell
- Clojure
var-defaults:
- "(pen-selected-text)"
- "(pen-detect-language-ask)"
- "(read-string-hist \"Pen to programming language: \")"
filter: on

Another demo