Public
Edited
Jun 17, 2023
Insert cell
Insert cell
journal = ({
type: "journal",
date: "June 2023",
areas: [
{
type: "highlight",
gambit: "Concord of Truth",
activity: "Anchored data strategy for anotherblock",
focus: [
{
label: "summarise oscar interview",
successDeferred: true,
note: "Got a good chunk in but not done, but still counting this as an epic day because I've gotten my get prompts really great"
},
{
label: "Update promptbrain with Erki, Bigert and Oscar highlights",
deferred: true
},
{ label: "Get it under version control", deferred: true }
]
},

{
type: "releaser",
gambit: "Atmospheric Accord",
activity: "Get reimbursed",
focus: [
{
label: "do 1 reimbursement",
successDeferred: true,
note: "sent two receipt to wint, canceled Tweetsmap/fedica account "
}
]
},

{
type: "important",
gambit: "Soma Spellbinders",
activity: "Prepare to Be flamboyant hosts of LK party",

focus: [
{
label: "shit to kitchen"
},
{
label: "Laundry: buy detergent",
successDeferred: true
},
{
label: "Make bed",
successDeferred: true
},
{
label: "Laundry: Do it and fold"
},
{
label: "put away shoes",
deferred: true
}
]
},
{
type: "releaser",
gambit: "Atmospheric Accord",
activity: "Get reimbursed",
focus: [
{
label: "do 1 reimbursement",
successDeferred: true,
note: "sent two receipt to wint, canceled Tweetsmap/fedica account "
}
]
},

{
type: "inbox",
gambit: "Unsorted",
activity: "Inbox activity",

focus: [
{
label: "Get tickets to nalen"
}
]
}
]
})
Insert cell
renderMD = {
let isCompleted = (item) => item.deferred || item.successDeferred;
let isAreaCompleted = (area) => area.focus.every(isCompleted);

let sortedAreas = [
...journal.areas.filter((area) => !isAreaCompleted(area)),
...journal.areas.filter(isAreaCompleted)
];

let markdown = `
# ${journal.type}
## Date: ${journal.date}

${sortedAreas
.map((area) => {
let getOpen = (area) => area.focus.filter((item) => !isCompleted(item));
let getCompleted = (area) => area.focus.filter(isCompleted);
let openFocus = getOpen(area);
let completedFocus = getCompleted(area);
let sortedFocus = [...openFocus, ...completedFocus];

const allCompleted = sortedFocus.every(isCompleted);
const color = allCompleted ? "gray" : "black";
return `
\n## <span style="color:${color}">${area.type}</span>\n
<span style="color:${color}">**Gambit:** ${area.gambit}</span>\n
<span style="color:${color}">**Activity:** ${area.activity}</span>\n
<span style="color:${color}">**Focus:**</span>\n
${sortedFocus
.map(
(item) =>
` - <span style="color:${isCompleted(item) ? "gray" : "black"}">${
item.successDeferred
? "**Success (Deferred)**"
: item.deferred
? "**Deferred**"
: '<span style="color:blue">**Open**</span>'
}: ${item.label} ${
item.note ? "( *Note*: " + item.note + ")" : ""
}</span>`
)
.join("\n")}
`;
})
.join("\n")}
`;

return markdown;
}
Insert cell
firstChoiceText = results.choices[0].text
Insert cell
Insert cell
viewof tokens = Inputs.range([100, 4000], {
label: "Result Tokens",
step: 100,
value: 200
})
Insert cell
viewof engine = Inputs.select(ENGINES, {
label: "Engine",
format: (d) => d.title,
value: DEFAULT_ENGINE
})
Insert cell
results = completions(
engine,
{
prompt,
max_tokens: tokens
},
OPENAI_API_SECRET
)
Insert cell
DEFAULT_ENGINE = {
title: "Text Davinci 002";
object: "engine";
id: "text-davinci-002";
ready: true;
owner: "openai";
permissions: null;
created: null;
}
Insert cell
import {
ENGINES,
ENGINE_MAP,
completions,
renderResults
} from "@trebor/gpt3-tools"
Insert cell
OPENAI_API_SECRET = "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"
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more