Skip to content

Instantly share code, notes, and snippets.

View savelee's full-sized avatar

Lee Boonstra savelee

View GitHub Profile
@savelee
savelee / criteria-examples.csv
Last active June 10, 2024 10:24
LLM rating criteria
We can make this file beautiful and searchable if this error is corrected: It looks like row 10 should actually have 3 columns, instead of 1 in line 9.
Criterion,Description,Rating Scale (1-5)
Relevance,How well does the response directly address the prompt and answer the question or fulfill the request?,1 (Not relevant) - 5 (Highly relevant)
Accuracy,How factually correct and reliable is the information presented in the response?,1 (Inaccurate) - 5 (Highly accurate)
Coherence,How well-organized logical and easy to follow is the response?,1 (Incoherent) - 5 (Highly coherent)
Concisenes,How clear and to the point is the response without being overly verbose or redundant?,1 (Wordy) - 5 (Concise)
Fluency,How natural smooth and grammatically correct is the language used in the response?,1 (Disfluent) - 5 (Highly fluent)
Informativeness,How much new or useful information does the response provide?,1 (Uninformative) - 5 (Highly informative)
Helpfulness,How helpful is the response in achieving the user's goal or solving the problem at hand?,1 (Unhelpful) - 5 (Highly helpful)
Level of Harm,How much harm does a wrong answer do?,1 (No harm) - 5 (Very harmful)
Creativ
@savelee
savelee / json-schema-prompt.txt
Last active June 13, 2024 09:10
JSON Schema Prompts
Parse a customer's pizza order into valid JSON, using the following schema:
SCHEMA:
```
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"size": {
"type": "string"
@savelee
savelee / json-prompt.md
Created June 10, 2024 10:02
Few Shot JSON

Parse a customer's pizza order into valid JSON:

EXAMPLE: I want a small pizza with cheese, tomato sauce, and pepperoni.

JSON Response:

{
    "size": "small",
 "type": "normal",
@savelee
savelee / style-prompts.csv
Last active June 10, 2024 09:58
Using styles in role prompting
Result OK
Prompt Act as a humorous and persuasive store clerk in a kitchen supply store. A customer approaches you looking for a gift for a friend who loves to cook. How would you assist them? Answer in a single paragraph.
Output Well hello there culinary cupid! Looking for a gift to make your friend's spatula sing? Tell me are we talking gourmet chef or I set off the smoke alarm weekly enthusiast? No judgment here just trying to narrow down if they need a self-stirring pot or a fire extinguisher disguised as an apron! But seriously we've got everything from whimsical cookie cutters to professional-grade cookware so let's whip up the perfect present together! What's their cooking style and your budget? We'll find something so good they'll be sending you a thank you casserole for years to come!
@savelee
savelee / role-prompting1.csv
Last active June 10, 2024 09:53
Art of Prompt Engineering
Result OK
Name/Version 1.0 - Store Clerk
Goal Act as a store clerk in a kitchen supply store.
Model geminio-pro-1.5-001
Temperature 1
Token Limit 1024
Top-K 40
Top-P 0.8
Prompt Act as a store clerk in a kitchen supply store. A customer approaches you looking for a gift for a friend who loves to cook. How would you assist them? Answer in a single paragraph.
Output Hi there! Looking for the perfect gift for your culinary friend? What kind of things do they like to cook? We have everything from high-end chef knives and cookware to fun gadgets and beautiful serving dishes. Do they prefer baking, grilling, or maybe something more specific like pasta making? Tell me a little about their cooking style and I can point you in the right direction.
@savelee
savelee / documentation.csv
Created June 10, 2024 09:41
Prompt Engineering Documentation Example
Result OK/NOK
Name/Version [name and version of your prompt]
Goal [One sentence explanation of the goal of this attempt]
Model [name and version of the used model]
Temperature [value between 0 - 1]
Top-K [number]
Prompt [Write all the full prompt]
Output [Write out the output or multiple outputs]
@savelee
savelee / index.js
Created January 11, 2023 08:32
Example Dialogflow CX webhook as Node JS cloud function
const functions = require('@google-cloud/functions-framework');
// Here's where you set the entry point, it gets the request from Dialogflow CX
// and it holds the response which will be sent back to Dialogflow
functions.http('orderState', (req, res) => {
let msg;
let results = {};
//let item;
//Let's log whatever we receive from Dialogflow CX to understand things better
@savelee
savelee / actions.js
Created April 12, 2021 11:06
google assistant - for CX agents
{
"actions": [
{
"description": "Default Welcome Intent",
"name": "MAIN",
"fulfillment": {
"conversationName": "welcome"
},
"intent": {
"name": "actions.intent.MAIN",
@savelee
savelee / actions.json
Last active April 9, 2021 10:21
Actions on Google SDK
{
"actions": [
{
"description": "Default Welcome Intent",
"name": "MAIN",
"fulfillment": {
"conversationName": "welcome"
},
"intent": {
"name": "actions.intent.MAIN",