-
Notifications
You must be signed in to change notification settings - Fork 145
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { type Example, Run } from "langsmith"; | ||
Check failure on line 1 in src/evals/general/index.ts
|
||
import { evaluate, EvaluationResult } from "langsmith/evaluation"; | ||
Check failure on line 2 in src/evals/general/index.ts
|
||
import "dotenv/config"; | ||
Check failure on line 3 in src/evals/general/index.ts
|
||
import { generatePostGraph } from "../../agent/subgraphs/generate-post/graph.js"; | ||
|
||
const runGraph = async ( | ||
input: Record<string, any> | ||
Check warning on line 7 in src/evals/general/index.ts
|
||
): Promise<Record<string, any>> => { | ||
Check warning on line 8 in src/evals/general/index.ts
|
||
return await generatePostGraph.invoke(input); | ||
}; | ||
|
||
const evaluatePost = (run: Run, example?: Example): EvaluationResult => { | ||
if (!example) { | ||
throw new Error("No example provided"); | ||
} | ||
if (!example.outputs) { | ||
throw new Error("No example outputs provided"); | ||
} | ||
if (!run.outputs) { | ||
throw new Error("No run outputs provided"); | ||
} | ||
|
||
// TODO: Implement evaluation logic | ||
throw new Error("Evaluation logic not implemented"); | ||
}; | ||
|
||
async function runEval() { | ||
const datasetName = "sma:generate-post:general"; | ||
await evaluate(runGraph, { | ||
data: datasetName, | ||
evaluators: [evaluatePost], | ||
experimentPrefix: "Post Generation - General", | ||
}); | ||
} | ||
|
||
runEval(); | ||
Check failure on line 36 in src/evals/general/index.ts
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { type Example, Run } from "langsmith"; | ||
Check failure on line 1 in src/evals/github/index.ts
|
||
import { evaluate, EvaluationResult } from "langsmith/evaluation"; | ||
Check failure on line 2 in src/evals/github/index.ts
|
||
import "dotenv/config"; | ||
Check failure on line 3 in src/evals/github/index.ts
|
||
import { generatePostGraph } from "../../agent/subgraphs/generate-post/graph.js"; | ||
|
||
const runGraph = async ( | ||
input: Record<string, any> | ||
Check warning on line 7 in src/evals/github/index.ts
|
||
): Promise<Record<string, any>> => { | ||
Check warning on line 8 in src/evals/github/index.ts
|
||
return await generatePostGraph.invoke(input); | ||
}; | ||
|
||
const evaluatePost = (run: Run, example?: Example): EvaluationResult => { | ||
if (!example) { | ||
throw new Error("No example provided"); | ||
} | ||
if (!example.outputs) { | ||
throw new Error("No example outputs provided"); | ||
} | ||
if (!run.outputs) { | ||
throw new Error("No run outputs provided"); | ||
} | ||
|
||
// TODO: Implement evaluation logic | ||
throw new Error("Evaluation logic not implemented"); | ||
}; | ||
|
||
async function runEval() { | ||
const datasetName = "sma:generate-post:github"; | ||
await evaluate(runGraph, { | ||
data: datasetName, | ||
evaluators: [evaluatePost], | ||
experimentPrefix: "Post Generation - Github", | ||
}); | ||
} | ||
|
||
runEval(); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { type Example, Run } from "langsmith"; | ||
import { evaluate, EvaluationResult } from "langsmith/evaluation"; | ||
import "dotenv/config"; | ||
import { generatePostGraph } from "../../agent/subgraphs/generate-post/graph.js"; | ||
|
||
const runGraph = async ( | ||
input: Record<string, any> | ||
Check warning on line 7 in src/evals/twitter/index.ts
|
||
): Promise<Record<string, any>> => { | ||
Check warning on line 8 in src/evals/twitter/index.ts
|
||
return await generatePostGraph.invoke(input); | ||
}; | ||
|
||
const evaluatePost = (run: Run, example?: Example): EvaluationResult => { | ||
if (!example) { | ||
throw new Error("No example provided"); | ||
} | ||
if (!example.outputs) { | ||
throw new Error("No example outputs provided"); | ||
} | ||
if (!run.outputs) { | ||
throw new Error("No run outputs provided"); | ||
} | ||
|
||
// TODO: Implement evaluation logic | ||
throw new Error("Evaluation logic not implemented"); | ||
}; | ||
|
||
async function runEval() { | ||
const datasetName = "sma:generate-post:twitter"; | ||
await evaluate(runGraph, { | ||
data: datasetName, | ||
evaluators: [evaluatePost], | ||
experimentPrefix: "Post Generation - Twitter", | ||
}); | ||
} | ||
|
||
runEval(); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { type Example, Run } from "langsmith"; | ||
import { evaluate, EvaluationResult } from "langsmith/evaluation"; | ||
import "dotenv/config"; | ||
import { generatePostGraph } from "../../agent/subgraphs/generate-post/graph.js"; | ||
|
||
const runGraph = async ( | ||
input: Record<string, any> | ||
Check warning on line 7 in src/evals/youtube/index.ts
|
||
): Promise<Record<string, any>> => { | ||
Check warning on line 8 in src/evals/youtube/index.ts
|
||
return await generatePostGraph.invoke(input); | ||
}; | ||
|
||
const evaluatePost = (run: Run, example?: Example): EvaluationResult => { | ||
if (!example) { | ||
throw new Error("No example provided"); | ||
} | ||
if (!example.outputs) { | ||
throw new Error("No example outputs provided"); | ||
} | ||
if (!run.outputs) { | ||
throw new Error("No run outputs provided"); | ||
} | ||
|
||
// TODO: Implement evaluation logic | ||
throw new Error("Evaluation logic not implemented"); | ||
}; | ||
|
||
async function runEval() { | ||
const datasetName = "sma:generate-post:youtube"; | ||
await evaluate(runGraph, { | ||
data: datasetName, | ||
evaluators: [evaluatePost], | ||
experimentPrefix: "Post Generation - YouTube", | ||
}); | ||
} | ||
|
||
runEval(); |