Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4e44987e12 | ||
|
|
e0f605a0f2 | ||
|
|
05a4935a91 | ||
|
|
27e1dca4df | ||
|
|
53e4433032 | ||
|
|
c777d91f13 | ||
|
|
ce1e4318e4 |
@@ -292,7 +292,7 @@ jobs:
|
||||
labels: ${{ steps.meta-web.outputs.labels }}
|
||||
platforms: |
|
||||
linux/amd64
|
||||
linux/arm64
|
||||
${{ startsWith(github.ref, 'refs/tags/') && 'linux/arm64' || '' }}
|
||||
|
||||
- name: Extract metadata (tags, labels) for Docker
|
||||
id: meta-worker
|
||||
@@ -319,4 +319,4 @@ jobs:
|
||||
labels: ${{ steps.meta-worker.outputs.labels }}
|
||||
platforms: |
|
||||
linux/amd64
|
||||
linux/arm64
|
||||
${{ startsWith(github.ref, 'refs/tags/') && 'linux/arm64' || '' }}
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "langfuse",
|
||||
"version": "2.60.2",
|
||||
"version": "2.60.4",
|
||||
"author": "engineering@langfuse.com",
|
||||
"license": "MIT",
|
||||
"private": true,
|
||||
|
||||
@@ -363,7 +363,7 @@ view ObservationView {
|
||||
statusMessage String? @map("status_message")
|
||||
version String?
|
||||
createdAt DateTime @map("created_at")
|
||||
updateAt DateTime @map("updated_at")
|
||||
updatedAt DateTime @map("updated_at")
|
||||
|
||||
// GENERATION ONLY
|
||||
model String?
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "web",
|
||||
"version": "2.60.2",
|
||||
"version": "2.60.4",
|
||||
"private": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
|
||||
@@ -1 +1 @@
|
||||
export const VERSION = "v2.60.2";
|
||||
export const VERSION = "v2.60.4";
|
||||
|
||||
@@ -23,7 +23,7 @@ export const MetricTable = ({
|
||||
{
|
||||
projectId,
|
||||
from: env.NEXT_PUBLIC_LANGFUSE_CLOUD_REGION // Langfuse Cloud has already completed the cost backfill job, thus cost can be pulled directly from obs. table
|
||||
? "traces_observations"
|
||||
? "observations"
|
||||
: "traces_observationsview",
|
||||
select: [
|
||||
{ column: "calculatedTotalCost", agg: "SUM" },
|
||||
|
||||
@@ -37,7 +37,7 @@ export const ModelUsageChart = ({
|
||||
{
|
||||
projectId,
|
||||
from: env.NEXT_PUBLIC_LANGFUSE_CLOUD_REGION // Langfuse Cloud has already completed the cost backfill job, thus cost can be pulled directly from obs. table
|
||||
? "traces_observations"
|
||||
? "observations"
|
||||
: "traces_observationsview",
|
||||
select: [
|
||||
{ column: "totalTokens", agg: "SUM" },
|
||||
|
||||
@@ -68,7 +68,7 @@ const GetScoresDataBase = z.object({
|
||||
traceId: z.string(),
|
||||
observationId: z.string().nullish(),
|
||||
trace: z.object({
|
||||
userId: z.string(),
|
||||
userId: z.string().nullish(),
|
||||
}),
|
||||
configId: z.string().nullish(),
|
||||
});
|
||||
|
||||
@@ -137,6 +137,7 @@ export default withMiddlewares({
|
||||
if (result.success) {
|
||||
acc.push(result.data);
|
||||
} else {
|
||||
console.error("Score parsing error: ", result.error);
|
||||
Sentry.captureException(result.error);
|
||||
}
|
||||
return acc;
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "worker",
|
||||
"version": "2.60.2",
|
||||
"version": "2.60.4",
|
||||
"description": "",
|
||||
"license": "MIT",
|
||||
"private": true,
|
||||
|
||||
@@ -199,6 +199,104 @@ describe("create eval jobs", () => {
|
||||
expect(jobs[0].end_time).to.be.null;
|
||||
}, 10_000);
|
||||
|
||||
test("does not create job for inactive config", async () => {
|
||||
await pruneDatabase();
|
||||
const traceId = randomUUID();
|
||||
|
||||
await kyselyPrisma.$kysely
|
||||
.insertInto("traces")
|
||||
.values({
|
||||
id: traceId,
|
||||
project_id: "7a88fb47-b4e2-43b8-a06c-a5ce950dc53a",
|
||||
})
|
||||
.execute();
|
||||
|
||||
await prisma.jobConfiguration.create({
|
||||
data: {
|
||||
id: randomUUID(),
|
||||
projectId: "7a88fb47-b4e2-43b8-a06c-a5ce950dc53a",
|
||||
filter: JSON.parse("[]"),
|
||||
jobType: "EVAL",
|
||||
delay: 0,
|
||||
sampling: new Decimal("1"),
|
||||
targetObject: "traces",
|
||||
scoreName: "score",
|
||||
variableMapping: JSON.parse("[]"),
|
||||
status: "INACTIVE",
|
||||
},
|
||||
});
|
||||
|
||||
const payload = {
|
||||
projectId: "7a88fb47-b4e2-43b8-a06c-a5ce950dc53a",
|
||||
traceId: traceId,
|
||||
};
|
||||
|
||||
await createEvalJobs({ event: payload });
|
||||
|
||||
const jobs = await kyselyPrisma.$kysely
|
||||
.selectFrom("job_executions")
|
||||
.selectAll()
|
||||
.where("project_id", "=", "7a88fb47-b4e2-43b8-a06c-a5ce950dc53a")
|
||||
.execute();
|
||||
|
||||
expect(jobs.length).toBe(0);
|
||||
}, 10_000);
|
||||
|
||||
test("does not create eval job for 0 sample rate", async () => {
|
||||
await pruneDatabase();
|
||||
const traceId = randomUUID();
|
||||
|
||||
await kyselyPrisma.$kysely
|
||||
.insertInto("traces")
|
||||
.values({
|
||||
id: traceId,
|
||||
project_id: "7a88fb47-b4e2-43b8-a06c-a5ce950dc53a",
|
||||
})
|
||||
.execute();
|
||||
|
||||
await kyselyPrisma.$kysely
|
||||
.insertInto("llm_api_keys")
|
||||
.values({
|
||||
id: randomUUID(),
|
||||
project_id: "7a88fb47-b4e2-43b8-a06c-a5ce950dc53a",
|
||||
secret_key: encrypt(String(OPENAI_API_KEY)),
|
||||
provider: "openai",
|
||||
adapter: LLMAdapter.OpenAI,
|
||||
custom_models: [],
|
||||
display_secret_key: "123456",
|
||||
})
|
||||
.execute();
|
||||
|
||||
await prisma.jobConfiguration.create({
|
||||
data: {
|
||||
id: randomUUID(),
|
||||
projectId: "7a88fb47-b4e2-43b8-a06c-a5ce950dc53a",
|
||||
filter: JSON.parse("[]"),
|
||||
jobType: "EVAL",
|
||||
delay: 0,
|
||||
sampling: new Decimal("0"),
|
||||
targetObject: "traces",
|
||||
scoreName: "score",
|
||||
variableMapping: JSON.parse("[]"),
|
||||
},
|
||||
});
|
||||
|
||||
const payload = {
|
||||
projectId: "7a88fb47-b4e2-43b8-a06c-a5ce950dc53a",
|
||||
traceId: traceId,
|
||||
};
|
||||
|
||||
await createEvalJobs({ event: payload });
|
||||
|
||||
const jobs = await kyselyPrisma.$kysely
|
||||
.selectFrom("job_executions")
|
||||
.selectAll()
|
||||
.where("project_id", "=", "7a88fb47-b4e2-43b8-a06c-a5ce950dc53a")
|
||||
.execute();
|
||||
|
||||
expect(jobs.length).toBe(0);
|
||||
}, 10_000);
|
||||
|
||||
test("cancels a job if the second event deselects", async () => {
|
||||
await pruneDatabase();
|
||||
const traceId = randomUUID();
|
||||
|
||||
@@ -1 +1 @@
|
||||
export const VERSION = "v2.60.2";
|
||||
export const VERSION = "v2.60.4";
|
||||
|
||||
@@ -98,6 +98,19 @@ export const createEvalJobs = async ({
|
||||
continue;
|
||||
}
|
||||
|
||||
// apply sampling. Only if the job is sampled, we create a job
|
||||
// user supplies a number between 0 and 1, which is the probability of sampling
|
||||
|
||||
if (parseFloat(config.sampling) !== 1) {
|
||||
const random = Math.random();
|
||||
if (random > parseFloat(config.sampling)) {
|
||||
logger.info(
|
||||
`Eval job for config ${config.id} and trace ${event.traceId} was sampled out`
|
||||
);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
logger.info(
|
||||
`Creating eval job for config ${config.id} and trace ${event.traceId}`
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user