Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add empiricalrun create package to initialise ts/js config #222

Merged
merged 13 commits into from
May 20, 2024
Merged
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