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 js and ts config support #218

Merged
merged 12 commits into from
May 17, 2024
9 changes: 9 additions & 0 deletions .changeset/ten-cheetahs-mate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
"empiricalrun": minor
"@empiricalrun/json-schema": minor
"@empiricalrun/types": minor
"@empiricalrun/typescript-config": patch
"web": patch
---

feat: add support for js and ts config
6 changes: 6 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
module.exports = {
ignorePatterns: ["apps/**", "packages/**"],
extends: ["@empiricalrun/eslint-config/library.js"],
ignorePatterns: [
// Ignore dotfiles
".*.js?(x)",
"node_modules/",
"examples/"
],
parser: "@typescript-eslint/parser",
parserOptions: {
project: true,
Expand Down
2 changes: 1 addition & 1 deletion apps/web/next.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/** @type {import('next').NextConfig} */
module.exports = {
output: "export",
distDir: "../../packages/cli/dist/webapp",
distDir: "../../packages/empiricalrun/dist/webapp",
productionBrowserSourceMaps: true,
optimizeFonts: false,
};
30 changes: 30 additions & 0 deletions examples/using-js-config/empiricalrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/** @type {import("empiricalrun").Config} */
export default {
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}}"
}
],
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"
}
]
};
18 changes: 18 additions & 0 deletions examples/using-js-config/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"name": "using-js-config",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"@empiricalrun/types": "workspace:^"
},
"dependencies": {
"empiricalrun": "workspace:^"
}
}
2 changes: 1 addition & 1 deletion packages/ai/src/providers/fireworks/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ describe("Fireworks provider tool calls", () => {
{
role: "user",
content:
"Extract data from message: Hi my name is John Doe. I'm 26 years old and I work in real estate.",
"Extract name from the following message: \n\n Message: Hi my name is John Doe. I'm 26 years old and I work in real estate.",
},
],
tools: [
Expand Down
6 changes: 0 additions & 6 deletions packages/cli/.npmignore

This file was deleted.

289 changes: 0 additions & 289 deletions packages/cli/CHANGELOG.md

This file was deleted.

8 changes: 0 additions & 8 deletions packages/cli/src/types/index.ts

This file was deleted.

Loading