Skip to content

Commit

Permalink
feat: add ts and js support
Browse files Browse the repository at this point in the history
  • Loading branch information
saikatmitra91 committed May 20, 2024
1 parent 8999142 commit 2d1bdb2
Show file tree
Hide file tree
Showing 21 changed files with 3,465 additions and 51 deletions.
6 changes: 6 additions & 0 deletions examples/using-js-config/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

# Ignore outputs from Empirical
.empiricalrun

# Ignore outputs from Empirical
.empiricalrun
30 changes: 0 additions & 30 deletions examples/using-js-config/empiricalrc.js

This file was deleted.

48 changes: 48 additions & 0 deletions examples/using-js-config/empiricalrc.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import { Config } from "empiricalrun";

const config: Config = {
runs: [
{
type: "model",
provider: "openai",
model: "gpt-3.5-turbo",
prompt:
"Extract the name, age and location from the message, and respond with a JSON object. If an entity is missing, respond with null.\n\nMessage: {{user_message}}",
},
{
type: "model",
provider: "openai",
model: "gpt-4-turbo-preview",
prompt:
"Extract the name, age and location from the message, and respond with a JSON object. If an entity is missing, respond with null.\n\nMessage: {{user_message}}",
parameters: {
response_format: {
type: "json_object",
},
},
},
],
dataset: {
samples: [
{
inputs: {
user_message:
"Hi my name is John Doe. I'm 26 years old and I work in real estate.",
},
},
{
inputs: {
user_message:
"This is Alice. I am a nurse from Maryland. I was born in 1990.",
},
},
],
},
scorers: [
{
type: "json-syntax",
},
],
};

export default config;
Loading

0 comments on commit 2d1bdb2

Please sign in to comment.