Skip to content

Instantly share code, notes, and snippets.

relevance_template = """
System:
You are an AI assistant. You will be given the definition of an evaluation metric for assessing the quality of an answer in a question-answering task. Your job is to compute an accurate evaluation score using the provided evaluation metric.
User:
Relevance measures how well the answer addresses the main aspects of the question, based on the context. Consider whether all and only the important aspects are contained in the answer when evaluating relevance. Given the context and question, score the relevance of the answer between one to five stars using the following rating scale:
One star: the answer completely lacks relevance
Two stars: the answer mostly lacks relevance
Three stars: the answer is partially relevant
Four stars: the answer is mostly relevant
@jacobdam
jacobdam / all.ts
Created September 17, 2023 05:24
WIP - Simple implementation of workflow engine
import assert from "node:assert";
import { AsyncLocalStorage } from "node:async_hooks";
// database
interface WorkflowInst {
completedSteps: number;
recordedStepCalls: { name: string; params: any }[]; // for debug only
}
const db: { [_: string]: WorkflowInst } = {};
async function getWorkflowInstanceFromDB(
class AuthService extends EventEmitter {
async initialize(){
this.accessToken = res['access_token'];
this._checkTokenExpiration();
// ...
}
isSignedIn(){
return !!this.accessToken;

Keybase proof

I hereby claim:

  • I am jacobdam on github.
  • I am jacobdam (https://keybase.io/jacobdam) on keybase.
  • I have a public key ASCqbyQsbLyw2j7iTMqfURPdzMo1025YtuC5Lh9HRbP0tQo

To claim this, I am signing this object:

@jacobdam
jacobdam / designer.html
Last active August 29, 2015 14:21
designer
<link rel="import" href="../cool-clock/cool-clock.html">
<link rel="import" href="../google-map/google-map.html">
<link rel="import" href="../paper-input/paper-input.html">
<link rel="import" href="../speech-mic/speech-mic.html">
<polymer-element name="my-element">
<template>
<style>
:host {
@jacobdam
jacobdam / gist:184e99819841bcf903ce
Created May 5, 2015 08:02
Lazy-lize class loading dependency
# bad
class Book
belongs_to :categoy, :class_name => BookCategory
end
# good
class Book
belongs_to :categoy, :class_name => 'BookCategory'
end
@jacobdam
jacobdam / __extend__.js
Created December 31, 2014 04:01
JS OOP
__hasProp = {}.hasOwnProperty;
__extends = function(child, parent) {
for (var key in parent) {
if (__hasProp.call(parent, key))
child[key] = parent[key];
}
function ctor() {
this.constructor = child;
require 'mysql2'
p Mysql2::VERSION # Make sure mysql2 version >= 0.3.12
Encoding::default_internal = Encoding::UTF_8
Encoding::default_external = Encoding::UTF_8
s = 'Test emoji 💝' # text with emoji character
c = Mysql2::Client.new(username: 'root', database: 'test', encoding: 'utf8mb4')
c.query("INSERT INTO test(`text`) VALUES('#{c.escape(s)}')")
For Jeff n Kelly 💝