Skip to content

Commit

Permalink
feat: add empiricalrun create package to initialise ts/js config (#222)
Browse files Browse the repository at this point in the history
  • Loading branch information
saikatmitra91 authored May 20, 2024
1 parent 98ef6aa commit fa75124
Show file tree
Hide file tree
Showing 32 changed files with 4,087 additions and 17 deletions.
5 changes: 5 additions & 0 deletions .changeset/giant-taxis-end.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"create-empiricalrun": minor
---

feat: add support for initialising JS and TS empirical cofiguration
3 changes: 3 additions & 0 deletions examples/using-js-config/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

# Ignore outputs from Empirical
.empiricalrun
39 changes: 27 additions & 12 deletions examples/using-js-config/empiricalrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,41 @@ export default {
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}}"
}
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."
}
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."
}
}
]
user_message:
"This is Alice. I am a nurse from Maryland. I was born in 1990.",
},
},
],
},
scorers: [
{
type: "json-syntax"
}
]
};
type: "json-syntax",
},
],
};
Loading

0 comments on commit fa75124

Please sign in to comment.