Compare commits

...
9 Commits
Author SHA1 Message Date
Max Deichmann 60bf74698a chore: release v2.16.2
CI/CD / lint (push) Waiting to run
CI/CD / test-docker-build (push) Waiting to run
CI/CD / tests (20) (push) Waiting to run
CI/CD / e2e-tests (push) Waiting to run
CI/CD / all-ci-passed (push) Blocked by required conditions
CI/CD / push-docker-image (push) Blocked by required conditions
release.yml / release (push) Waiting to run
2024-04-05 21:21:21 +02:00
Max DeichmannandGitHub 5ac7dc969e fix: do not send io for traces on trpc.all route (#1514) 2024-04-05 21:16:26 +02:00
Marc KlingenandGitHub 3b152eda21 fix: updates to openapi spec, broken due to monorepo transition (#1603) 2024-04-05 21:16:02 +02:00
Max Deichmann bfde018060 chore: release v2.16.1
CI/CD / lint (push) Waiting to run
CI/CD / test-docker-build (push) Waiting to run
CI/CD / tests (20) (push) Waiting to run
CI/CD / e2e-tests (push) Waiting to run
CI/CD / all-ci-passed (push) Blocked by required conditions
CI/CD / push-docker-image (push) Blocked by required conditions
release.yml / release (push) Waiting to run
2024-04-05 18:39:10 +02:00
Max DeichmannandGitHub d83bc01b22 chore: upgrade fern (#1600) 2024-04-05 12:33:51 +02:00
Marc Klingen feb811ccbb fix: csp header script-src 2024-04-05 11:49:45 +02:00
dependabot[bot]andGitHub 5a2f478613 chore(deps): bump the patches group with 8 updates (#1596) 2024-04-05 06:39:19 +00:00
dependabot[bot]andGitHub 29c726499e chore(deps): bump the prisma group with 2 updates (#1595) 2024-04-05 06:21:02 +00:00
dependabot[bot]andGitHub c15435126d chore(deps): bump lucide-react from 0.330.0 to 0.364.0 (#1598) 2024-04-05 08:12:19 +02:00
15 changed files with 295 additions and 5168 deletions
+1 -1
View File
@@ -11,7 +11,7 @@ groups:
namespaceExport: Langfuse
allowCustomFetcher: true
- name: fernapi/fern-python-sdk
version: 1.0.1
version: 1.1.0-rc2
output:
location: local-file-system
path: ../../../generated/python
-104
View File
@@ -1,104 +0,0 @@
openapi: 3.0.1
info:
title: langfuse
version: ''
paths:
/api/public/scores:
post:
description: Add a score to the database, upserts on id
operationId: score_create
tags:
- Score
parameters: []
responses:
'200':
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/Score'
'400':
description: ''
content:
application/json:
schema:
type: string
'401':
description: ''
content:
application/json:
schema:
type: string
'403':
description: ''
content:
application/json:
schema:
type: string
'405':
description: ''
content:
application/json:
schema:
type: string
security:
- BearerAuth: []
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CreateScoreRequest'
components:
schemas:
CreateScoreRequest:
title: CreateScoreRequest
type: object
properties:
id:
type: string
traceId:
type: string
name:
type: string
value:
type: number
format: double
observationId:
type: string
comment:
type: string
required:
- traceId
- name
- value
Score:
title: Score
type: object
properties:
id:
type: string
traceId:
type: string
name:
type: string
value:
type: number
format: double
observationId:
type: string
timestamp:
type: string
format: date-time
comment:
type: string
required:
- id
- traceId
- name
- value
- timestamp
securitySchemes:
BearerAuth:
type: http
scheme: bearer
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -14,6 +14,6 @@
"eslint-plugin-only-warn": "^1.1.0",
"@typescript-eslint/parser": "^7.1.0",
"@typescript-eslint/eslint-plugin": "^7.1.0",
"typescript": "^5.4.3"
"typescript": "^5.4.4"
}
}
+7 -7
View File
@@ -28,14 +28,14 @@
"seed": "ts-node -r tsconfig-paths/register -r dotenv/config --compiler-options {\"module\":\"CommonJS\"} prisma/seed.ts"
},
"dependencies": {
"@langchain/anthropic": "^0.1.9",
"@langchain/core": "^0.1.53",
"@langchain/openai": "^0.0.25",
"@prisma/client": "^5.12.0",
"@langchain/anthropic": "^0.1.10",
"@langchain/core": "^0.1.54",
"@langchain/openai": "^0.0.26",
"@prisma/client": "^5.12.1",
"@types/bcryptjs": "^2.4.6",
"bcryptjs": "^2.4.3",
"kysely": "^0.27.3",
"langchain": "^0.1.30",
"langchain": "^0.1.31",
"prisma-extension-kysely": "^2.1.0",
"prisma-kysely": "^1.8.0",
"zod": "^3.22.4"
@@ -55,12 +55,12 @@
"kysely-codegen": "^0.11.0",
"nodemon": "^3.0.3",
"prettier": "^3.2.5",
"prisma": "^5.12.0",
"prisma": "^5.12.1",
"prisma-erd-generator": "^1.11.2",
"ts-node": "^10.9.2",
"tsc-watch": "^6.0.4",
"tsup": "^8.0.2",
"typescript": "^5.4.3",
"typescript": "^5.4.4",
"vitest": "^1.3.1"
}
}
+231 -224
View File
File diff suppressed because it is too large Load Diff
+17 -17
View File
@@ -12,7 +12,7 @@ import { env } from "./src/env.mjs";
*/
const cspHeader = `
default-src 'self' https://ph.langfuse.com https://*.posthog.com wss://*.crisp.chat https://*.crisp.chat;
script-src 'self' ${process.env.NODE_ENV === "development" ? "'unsafe-eval'" : ""} https://*.crisp.chat https://challenges.cloudflare.com https://ph.langfuse.com https://static.cloudflareinsights.com https://*.stripe.com;
script-src 'self' 'unsafe-eval' https://*.crisp.chat https://challenges.cloudflare.com https://ph.langfuse.com https://static.cloudflareinsights.com https://*.stripe.com;
style-src 'self' 'unsafe-inline' https://*.crisp.chat;
img-src 'self' https: blob: data:;
font-src 'self' https://*.crisp.chat;
@@ -77,22 +77,22 @@ const nextConfig = {
// Required to check authentication status from langfuse.com
...(env.NEXT_PUBLIC_LANGFUSE_CLOUD_REGION !== undefined
? [
{
source: "/api/auth/session",
headers: [
{
key: "Access-Control-Allow-Origin",
value: "https://langfuse.com",
},
{ key: "Access-Control-Allow-Credentials", value: "true" },
{ key: "Access-Control-Allow-Methods", value: "GET,POST" },
{
key: "Access-Control-Allow-Headers",
value: "Content-Type, Authorization",
},
],
},
]
{
source: "/api/auth/session",
headers: [
{
key: "Access-Control-Allow-Origin",
value: "https://langfuse.com",
},
{ key: "Access-Control-Allow-Credentials", value: "true" },
{ key: "Access-Control-Allow-Methods", value: "GET,POST" },
{
key: "Access-Control-Allow-Headers",
value: "Content-Type, Authorization",
},
],
},
]
: []),
];
},
+13 -13
View File
@@ -1,14 +1,14 @@
{
"name": "web",
"version": "2.16.0",
"version": "2.16.2",
"private": true,
"license": "MIT",
"engines": {
"node": ">=20"
},
"scripts": {
"prebuild": "cp generated/openapi-client/openapi.yml public/openapi-client.yml && cp generated/openapi-server/openapi.yml public/openapi-server.yml",
"build": "INLINE_RUNTIME_CHUNK=false dotenv -e ../.env -- next build",
"copy-openapi-spec": "cp generated/openapi-client/openapi.yml public/openapi-client.yml && cp generated/openapi-server/openapi.yml public/openapi-server.yml",
"build": "pnpm run copy-openapi-spec && INLINE_RUNTIME_CHUNK=false dotenv -e ../.env -- next build",
"dev": "dotenv -e ../.env -- next dev",
"lint": "dotenv -e ../.env -- next lint",
"lint:fix": "dotenv -e ../.env -- next lint --fix",
@@ -29,11 +29,11 @@
"@headlessui/react": "^1.7.18",
"@heroicons/react": "^2.1.3",
"@hookform/resolvers": "^3.3.4",
"@langchain/anthropic": "^0.1.9",
"@langchain/core": "^0.1.53",
"@langchain/openai": "^0.0.25",
"@langchain/anthropic": "^0.1.10",
"@langchain/core": "^0.1.54",
"@langchain/openai": "^0.0.26",
"@langfuse/shared": "workspace:*",
"@marsidev/react-turnstile": "^0.5.3",
"@marsidev/react-turnstile": "^0.5.4",
"@next-auth/prisma-adapter": "^1.0.7",
"@radix-ui/react-accordion": "^1.1.2",
"@radix-ui/react-alert-dialog": "^1.0.5",
@@ -72,7 +72,7 @@
"@trpc/next": "^10.45.0",
"@trpc/react-query": "^10.45.0",
"@trpc/server": "^10.45.0",
"ai": "^3.0.17",
"ai": "^3.0.18",
"bcryptjs": "^2.4.3",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.0",
@@ -84,16 +84,16 @@
"exponential-backoff": "^3.1.1",
"js-tiktoken": "^1.0.10",
"kysely": "^0.27.3",
"langchain": "^0.1.30",
"langchain": "^0.1.31",
"lodash": "^4.17.21",
"lucide-react": "^0.330.0",
"lucide-react": "^0.364.0",
"next": "^14.1.4",
"next-auth": "^4.24.7",
"next-query-params": "^5.0.0",
"nodemailer": "^6.9.13",
"posthog-js": "^1.105.9",
"posthog-node": "^3.6.3",
"prisma": "^5.12.0",
"prisma": "^5.12.1",
"react": "18.2.0",
"react-day-picker": "^8.10.0",
"react-dom": "18.2.0",
@@ -142,8 +142,8 @@
"tailwindcss": "^3.4.3",
"ts-node": "^10.9.2",
"tsconfig-paths": "^4.2.0",
"tsx": "^4.7.1",
"typescript": "^5.4.3"
"tsx": "^4.7.2",
"typescript": "^5.4.4"
},
"ct3aMetadata": {
"initVersion": "7.13.0"
+1
View File
@@ -0,0 +1 @@
openapi*.yml
-104
View File
@@ -1,104 +0,0 @@
openapi: 3.0.1
info:
title: langfuse
version: ''
paths:
/api/public/scores:
post:
description: Add a score to the database, upserts on id
operationId: score_create
tags:
- Score
parameters: []
responses:
'200':
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/Score'
'400':
description: ''
content:
application/json:
schema:
type: string
'401':
description: ''
content:
application/json:
schema:
type: string
'403':
description: ''
content:
application/json:
schema:
type: string
'405':
description: ''
content:
application/json:
schema:
type: string
security:
- BearerAuth: []
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CreateScoreRequest'
components:
schemas:
CreateScoreRequest:
title: CreateScoreRequest
type: object
properties:
id:
type: string
traceId:
type: string
name:
type: string
value:
type: number
format: double
observationId:
type: string
comment:
type: string
required:
- traceId
- name
- value
Score:
title: Score
type: object
properties:
id:
type: string
traceId:
type: string
name:
type: string
value:
type: number
format: double
observationId:
type: string
timestamp:
type: string
format: date-time
comment:
type: string
required:
- id
- traceId
- name
- value
- timestamp
securitySchemes:
BearerAuth:
type: http
scheme: bearer
File diff suppressed because it is too large Load Diff
+4 -21
View File
@@ -124,6 +124,7 @@ export default function TracesTable({
filter: filterState,
searchQuery,
orderBy: orderByState,
returnIO: false,
};
const traces = api.traces.all.useQuery(tracesAllQueryFilter);
@@ -650,22 +651,8 @@ const TracesIOCell = ({
traceId: string;
io: "input" | "output";
}) => {
const trace = api.traces.all.useQuery(
{
projectId: projectId,
filter: [
{
column: "id",
type: "string",
operator: "=",
value: traceId,
},
],
searchQuery: null,
orderBy: null,
page: 0,
limit: 1,
},
const trace = api.traces.byId.useQuery(
{ traceId: traceId },
{
enabled: typeof traceId === "string",
trpc: {
@@ -678,11 +665,7 @@ const TracesIOCell = ({
return (
<IOCell
isLoading={trace.isLoading}
data={
io === "output"
? trace.data?.traces[0]?.output
: trace.data?.traces[0]?.input
}
data={io === "output" ? trace.data?.output : trace.data?.input}
/>
);
};
+1 -1
View File
@@ -1 +1 @@
export const VERSION = "v2.16.0";
export const VERSION = "v2.16.2";
+18 -2
View File
@@ -34,6 +34,7 @@ const TraceFilterOptions = z.object({
searchQuery: z.string().nullable(),
filter: z.array(singleFilter).nullable(),
orderBy: orderBy,
returnIO: z.boolean().default(true),
...paginationZod,
});
@@ -48,6 +49,7 @@ export const traceRouter = createTRPCRouter({
all: protectedProjectProcedure
.input(TraceFilterOptions)
.query(async ({ input, ctx }) => {
const returnIO = input.returnIO;
const filterCondition = tableColumnsToSqlFilterAndPrefix(
input.filter ?? [],
tracesTableCols,
@@ -155,7 +157,17 @@ export const traceRouter = createTRPCRouter({
return {
traces: traces.map((trace) => {
const filteredScores = scores.filter((s) => s.traceId === trace.id);
return { ...trace, scores: filteredScores };
const { input, output, ...rest } = trace;
if (returnIO) {
return { ...rest, input, output, scores: filteredScores };
} else {
return {
...rest,
input: undefined,
output: undefined,
scores: filteredScores,
};
}
}),
totalCount: totalTraceCount ? Number(totalTraceCount) : undefined,
};
@@ -209,7 +221,11 @@ export const traceRouter = createTRPCRouter({
return res;
}),
byId: protectedGetTraceProcedure
.input(z.object({ traceId: z.string() }))
.input(
z.object({
traceId: z.string(),
}),
)
.query(async ({ input, ctx }) => {
const trace = await ctx.prisma.trace.findFirstOrThrow({
where: {
+1 -1
View File
@@ -57,7 +57,7 @@
"ts-node": "^10.9.2",
"tsc-watch": "^6.0.4",
"tsup": "^8.0.2",
"typescript": "^5.4.3",
"typescript": "^5.4.4",
"vitest": "^1.3.1"
}
}