Compare commits

...
418 Commits
Author SHA1 Message Date
Max Deichmann a829447410 chore: release v2.2.0
CI/CD / lint (push) Waiting to run
CI/CD / test-docker-build (push) Waiting to run
CI/CD / tests (18) (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-02-07 11:06:35 +01:00
Hassieb PakzadandGitHub 53e7ff4e16 feat: expand generation model units (#1095) 2024-02-07 11:05:07 +01:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
4a85b4a4f2 chore(deps): bump the patches group with 3 updates (#1101)
Bumps the patches group with 3 updates: [posthog-node](https://github.com/PostHog/posthog-js-lite/tree/HEAD/posthog-node), [react-hook-form](https://github.com/react-hook-form/react-hook-form) and [@types/react](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react).


Updates `posthog-node` from 3.6.1 to 3.6.2
- [Release notes](https://github.com/PostHog/posthog-js-lite/releases)
- [Changelog](https://github.com/PostHog/posthog-js-lite/blob/main/posthog-node/CHANGELOG.md)
- [Commits](https://github.com/PostHog/posthog-js-lite/commits/posthog-node-v3.6.2/posthog-node)

Updates `react-hook-form` from 7.50.0 to 7.50.1
- [Release notes](https://github.com/react-hook-form/react-hook-form/releases)
- [Changelog](https://github.com/react-hook-form/react-hook-form/blob/master/CHANGELOG.md)
- [Commits](https://github.com/react-hook-form/react-hook-form/compare/v7.50.0...v7.50.1)

Updates `@types/react` from 18.2.54 to 18.2.55
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react)

---
updated-dependencies:
- dependency-name: posthog-node
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: patches
- dependency-name: react-hook-form
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: patches
- dependency-name: "@types/react"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: patches
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-07 03:16:05 +00:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
d2e6dca3d3 chore(deps-dev): bump @typescript-eslint/parser from 6.20.0 to 6.21.0 (#1103)
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 6.20.0 to 6.21.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.21.0/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-07 03:08:08 +00:00
Marc KlingenandGitHub cdbdc0af67 feat(api): add notice regarding hostname to default 401 (#1088) 2024-02-07 04:02:26 +01:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2af9b52213 chore(deps): bump @aws-sdk/s3-request-presigner from 3.504.0 to 3.507.0 (#1104)
Bumps [@aws-sdk/s3-request-presigner](https://github.com/aws/aws-sdk-js-v3/tree/HEAD/packages/s3-request-presigner) from 3.504.0 to 3.507.0.
- [Release notes](https://github.com/aws/aws-sdk-js-v3/releases)
- [Changelog](https://github.com/aws/aws-sdk-js-v3/blob/main/packages/s3-request-presigner/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-js-v3/commits/v3.507.0/packages/s3-request-presigner)

---
updated-dependencies:
- dependency-name: "@aws-sdk/s3-request-presigner"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-07 04:01:08 +01:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
894a3d1b32 chore(deps-dev): bump the patches group with 4 updates (#1083)
Bumps the patches group with 4 updates: [@testing-library/jest-dom](https://github.com/testing-library/jest-dom), [@types/react](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react), [postcss](https://github.com/postcss/postcss) and [prettier](https://github.com/prettier/prettier).


Updates `@testing-library/jest-dom` from 6.4.1 to 6.4.2
- [Release notes](https://github.com/testing-library/jest-dom/releases)
- [Changelog](https://github.com/testing-library/jest-dom/blob/main/CHANGELOG.md)
- [Commits](https://github.com/testing-library/jest-dom/compare/v6.4.1...v6.4.2)

Updates `@types/react` from 18.2.51 to 18.2.54
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react)

Updates `postcss` from 8.4.33 to 8.4.34
- [Release notes](https://github.com/postcss/postcss/releases)
- [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md)
- [Commits](https://github.com/postcss/postcss/compare/8.4.33...8.4.34)

Updates `prettier` from 3.2.4 to 3.2.5
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/3.2.4...3.2.5)

---
updated-dependencies:
- dependency-name: "@testing-library/jest-dom"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: patches
- dependency-name: "@types/react"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: patches
- dependency-name: postcss
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: patches
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: patches
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-06 02:53:42 +00:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
82f0134368 chore(deps): bump react-hook-form from 7.49.3 to 7.50.0 (#1084)
Bumps [react-hook-form](https://github.com/react-hook-form/react-hook-form) from 7.49.3 to 7.50.0.
- [Release notes](https://github.com/react-hook-form/react-hook-form/releases)
- [Changelog](https://github.com/react-hook-form/react-hook-form/blob/master/CHANGELOG.md)
- [Commits](https://github.com/react-hook-form/react-hook-form/compare/v7.49.3...v7.50.0)

---
updated-dependencies:
- dependency-name: react-hook-form
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-06 02:41:56 +00:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
e52ba46b0e chore(deps): bump lucide-react from 0.321.0 to 0.323.0 (#1085)
Bumps [lucide-react](https://github.com/lucide-icons/lucide/tree/HEAD/packages/lucide-react) from 0.321.0 to 0.323.0.
- [Release notes](https://github.com/lucide-icons/lucide/releases)
- [Commits](https://github.com/lucide-icons/lucide/commits/0.323.0/packages/lucide-react)

---
updated-dependencies:
- dependency-name: lucide-react
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-06 02:37:21 +00:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
6aca4954ef chore(deps): bump @aws-sdk/client-s3 from 3.504.0 to 3.507.0 (#1086)
Bumps [@aws-sdk/client-s3](https://github.com/aws/aws-sdk-js-v3/tree/HEAD/clients/client-s3) from 3.504.0 to 3.507.0.
- [Release notes](https://github.com/aws/aws-sdk-js-v3/releases)
- [Changelog](https://github.com/aws/aws-sdk-js-v3/blob/main/clients/client-s3/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-js-v3/commits/v3.507.0/clients/client-s3)

---
updated-dependencies:
- dependency-name: "@aws-sdk/client-s3"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-06 03:32:53 +01:00
Marc Klingen 9d5fa4e2f1 chore: fix discussion template 2024-02-05 10:51:50 +01:00
Marc Klingen c1db242edd chore: fix discussion template 2024-02-05 10:51:21 +01:00
Marc Klingen 91a2c63c88 chore: fix discussion template 2024-02-05 10:50:25 +01:00
Marc Klingen f7d9bd7297 chore: add template for gh discussions 2024-02-05 10:49:16 +01:00
Max DeichmannandGitHub d94e880520 fix: openai model prices (#1068) 2024-02-03 18:28:18 +01:00
Yash KhareandGitHub 74e9053f85 feat(dashboard): enable selection of score names in legend of chart + slider (#907) 2024-02-03 01:53:44 +00:00
Marc Klingen ae5260d808 docs: update example envs 2024-02-03 02:29:50 +01:00
Marc KlingenandGitHub f72f8b7e2c chore(deps): upgrade prisma and fix tests (#1064) 2024-02-03 01:34:05 +01:00
Marc Klingen 43108eccde docs: readme 2024-02-03 01:16:34 +01:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
c93c9560e1 chore(deps): bump the patches group with 1 update (#1060)
Bumps the patches group with 1 update: [@tanstack/react-table](https://github.com/TanStack/table/tree/HEAD/packages/react-table).


Updates `@tanstack/react-table` from 8.11.7 to 8.11.8
- [Release notes](https://github.com/TanStack/table/releases)
- [Commits](https://github.com/TanStack/table/commits/v8.11.8/packages/react-table)

---
updated-dependencies:
- dependency-name: "@tanstack/react-table"
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: patches
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-02 23:31:07 +00:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
ddad1afd7b chore(deps): bump @aws-sdk/client-s3 from 3.501.0 to 3.504.0 (#1061)
Bumps [@aws-sdk/client-s3](https://github.com/aws/aws-sdk-js-v3/tree/HEAD/clients/client-s3) from 3.501.0 to 3.504.0.
- [Release notes](https://github.com/aws/aws-sdk-js-v3/releases)
- [Changelog](https://github.com/aws/aws-sdk-js-v3/blob/main/clients/client-s3/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-js-v3/commits/v3.504.0/clients/client-s3)

---
updated-dependencies:
- dependency-name: "@aws-sdk/client-s3"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-02 23:21:19 +00:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2b70ae3742 chore(deps): bump @aws-sdk/s3-request-presigner from 3.501.0 to 3.504.0 (#1063)
Bumps [@aws-sdk/s3-request-presigner](https://github.com/aws/aws-sdk-js-v3/tree/HEAD/packages/s3-request-presigner) from 3.501.0 to 3.504.0.
- [Release notes](https://github.com/aws/aws-sdk-js-v3/releases)
- [Changelog](https://github.com/aws/aws-sdk-js-v3/blob/main/packages/s3-request-presigner/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-js-v3/commits/v3.504.0/packages/s3-request-presigner)

---
updated-dependencies:
- dependency-name: "@aws-sdk/s3-request-presigner"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-02 23:16:52 +00:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
b110fd7932 chore(deps): bump posthog-js from 1.103.1 to 1.104.4 (#1062)
Bumps [posthog-js](https://github.com/PostHog/posthog-js) from 1.103.1 to 1.104.4.
- [Release notes](https://github.com/PostHog/posthog-js/releases)
- [Changelog](https://github.com/PostHog/posthog-js/blob/main/CHANGELOG.md)
- [Commits](https://github.com/PostHog/posthog-js/compare/v1.103.1...v1.104.4)

---
updated-dependencies:
- dependency-name: posthog-js
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-03 00:12:21 +01:00
Marc Klingen cd537fb571 chore: release v2.1.2
CI/CD / push-docker-image (push) Blocked by required conditions
CI/CD / tests (18) (push) Failing after 53s
CI/CD / tests (20) (push) Failing after 42s
CI/CD / test-docker-build (push) Successful in 2m59s
CI/CD / e2e-tests (push) Failing after 45s
release.yml / release (push) Failing after 3s
CI/CD / lint (push) Failing after 22m27s
CI/CD / all-ci-passed (push) Waiting to run
2024-02-02 23:22:12 +01:00
Marc KlingenandGitHub 3cbd252980 chore(cloud): add environment labeling (#1058) 2024-02-02 23:02:19 +01:00
Max DeichmannandGitHub 0a99988e6e perf: do not load observation i/o from db on traces.byId (#1053) 2024-02-02 16:01:19 +00:00
Marc KlingenandGitHub a19d20d973 fix: remove Expires from S3 PutObject (#1047)
Fixes #1046
2024-02-02 03:56:47 +01:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
b86eab9e04 chore(deps-dev): bump the patches group with 1 update (#1037)
Bumps the patches group with 1 update: [@playwright/test](https://github.com/microsoft/playwright).


Updates `@playwright/test` from 1.41.1 to 1.41.2
- [Release notes](https://github.com/microsoft/playwright/releases)
- [Commits](https://github.com/microsoft/playwright/compare/v1.41.1...v1.41.2)

---
updated-dependencies:
- dependency-name: "@playwright/test"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: patches
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-02 00:57:37 +00:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
b36530ff96 chore(deps): bump lucide-react from 0.316.0 to 0.321.0 (#1039)
Bumps [lucide-react](https://github.com/lucide-icons/lucide/tree/HEAD/packages/lucide-react) from 0.316.0 to 0.321.0.
- [Release notes](https://github.com/lucide-icons/lucide/releases)
- [Commits](https://github.com/lucide-icons/lucide/commits/0.321.0/packages/lucide-react)

---
updated-dependencies:
- dependency-name: lucide-react
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-02 00:50:03 +00:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
1019298060 chore(deps-dev): bump @testing-library/react from 14.1.2 to 14.2.1 (#1040)
Bumps [@testing-library/react](https://github.com/testing-library/react-testing-library) from 14.1.2 to 14.2.1.
- [Release notes](https://github.com/testing-library/react-testing-library/releases)
- [Changelog](https://github.com/testing-library/react-testing-library/blob/main/CHANGELOG.md)
- [Commits](https://github.com/testing-library/react-testing-library/compare/v14.1.2...v14.2.1)

---
updated-dependencies:
- dependency-name: "@testing-library/react"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-02 00:45:30 +00:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
99a2ad30ce chore(deps-dev): bump @typescript-eslint/parser from 6.19.1 to 6.20.0 (#1038)
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 6.19.1 to 6.20.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.20.0/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-02 00:40:21 +00:00
Marc Klingen 9783a22abf chore: release v2.1.1
CI/CD / push-docker-image (push) Blocked by required conditions
CI/CD / test-docker-build (push) Successful in 2m42s
CI/CD / tests (18) (push) Failing after 1m13s
CI/CD / tests (20) (push) Failing after 42s
CI/CD / e2e-tests (push) Failing after 44s
CI/CD / lint (push) Successful in 4m9s
CI/CD / all-ci-passed (push) Waiting to run
release.yml / release (push) Failing after 17s
2024-02-02 00:48:34 +01:00
Marc KlingenandGitHub 68f63b3b90 fix(ui): generation exports from UI (#1042) 2024-02-02 00:18:58 +01:00
Marc Klingen 1189d13c14 chore: release v2.1.0
CI/CD / push-docker-image (push) Blocked by required conditions
CI/CD / tests (20) (push) Failing after 47s
CI/CD / e2e-tests (push) Failing after 44s
CI/CD / lint (push) Successful in 4m1s
CI/CD / test-docker-build (push) Successful in 3m43s
release.yml / release (push) Failing after 3s
CI/CD / tests (18) (push) Failing after 11m20s
CI/CD / all-ci-passed (push) Waiting to run
2024-02-01 21:08:59 +01:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
243a784480 chore(deps): bump the patches group with 4 updates (#1035)
Bumps the patches group with 4 updates: cmdk, [@testing-library/jest-dom](https://github.com/testing-library/jest-dom), [@types/jest](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jest) and [@types/react](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react).


Updates `cmdk` from 0.2.0 to 0.2.1

Updates `@testing-library/jest-dom` from 6.4.0 to 6.4.1
- [Release notes](https://github.com/testing-library/jest-dom/releases)
- [Changelog](https://github.com/testing-library/jest-dom/blob/main/CHANGELOG.md)
- [Commits](https://github.com/testing-library/jest-dom/compare/v6.4.0...v6.4.1)

Updates `@types/jest` from 29.5.11 to 29.5.12
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/jest)

Updates `@types/react` from 18.2.48 to 18.2.51
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react)

---
updated-dependencies:
- dependency-name: cmdk
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: patches
- dependency-name: "@testing-library/jest-dom"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: patches
- dependency-name: "@types/jest"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: patches
- dependency-name: "@types/react"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: patches
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-01 21:08:19 +01:00
c89b8c3bab fix(ui): update regex matching description (#1031)
---------

Co-authored-by: Marc Klingen <git@marcklingen.com>
2024-02-01 20:54:57 +01:00
b5172219af security: upgrade nodemailer from 6.9.8 to 6.9.9 (#1027)
* fix: package.json to reduce vulnerabilities

The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/SNYK-JS-NODEMAILER-6219989

* update

---------

Co-authored-by: snyk-bot <snyk-bot@snyk.io>
2024-02-01 20:53:40 +01:00
Marc Klingen db90f85041 fix(ui): disabled state of AddModel button 2024-02-01 17:41:19 +01:00
Marc KlingenandGitHub db9f90aa91 fix(models): allow price = 0 (#1030) 2024-02-01 15:56:51 +00:00
Marc KlingenandGitHub 41b19582cc feat(models): allow to set input/output/total price without restrictions (#1029) 2024-02-01 16:50:25 +01:00
766102797b feat(models): allow custom regex for user-defined models (#1022)
---------

Co-authored-by: Marc Klingen <git@marcklingen.com>
2024-02-01 16:42:21 +01:00
Max Deichmann 773cb1312b chore: release v2.0.1
CI/CD / push-docker-image (push) Blocked by required conditions
CI/CD / tests (18) (push) Failing after 1m0s
CI/CD / test-docker-build (push) Successful in 3m27s
CI/CD / e2e-tests (push) Failing after 49s
CI/CD / tests (20) (push) Failing after 1m39s
CI/CD / lint (push) Successful in 4m44s
CI/CD / all-ci-passed (push) Waiting to run
release.yml / release (push) Failing after 3s
2024-02-01 16:31:54 +01:00
Max DeichmannandGitHub bb593020d0 fix: gh action (#1028) 2024-02-01 16:27:06 +01:00
Max DeichmannandGitHub 33ffe62add fix: display total cost correctly (#1026) 2024-02-01 14:56:49 +00:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
6e1aabb2de chore(deps-dev): bump @testing-library/jest-dom from 6.2.1 to 6.4.0 (#988)
Bumps [@testing-library/jest-dom](https://github.com/testing-library/jest-dom) from 6.2.1 to 6.4.0.
- [Release notes](https://github.com/testing-library/jest-dom/releases)
- [Changelog](https://github.com/testing-library/jest-dom/blob/main/CHANGELOG.md)
- [Commits](https://github.com/testing-library/jest-dom/compare/v6.2.1...v6.4.0)

---
updated-dependencies:
- dependency-name: "@testing-library/jest-dom"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-31 22:14:20 +00:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
ab3bdebc57 chore(deps): bump the sentry group with 1 update (#1000)
Bumps the sentry group with 1 update: [@sentry/nextjs](https://github.com/getsentry/sentry-javascript).


Updates `@sentry/nextjs` from 7.95.0 to 7.99.0
- [Release notes](https://github.com/getsentry/sentry-javascript/releases)
- [Changelog](https://github.com/getsentry/sentry-javascript/blob/develop/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-javascript/compare/7.95.0...7.99.0)

---
updated-dependencies:
- dependency-name: "@sentry/nextjs"
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: sentry
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-31 22:09:55 +00:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
20d00e5ef2 chore(deps-dev): bump @mermaid-js/mermaid-cli from 10.6.1 to 10.7.0 (#1003)
Bumps [@mermaid-js/mermaid-cli](https://github.com/mermaid-js/mermaid-cli) from 10.6.1 to 10.7.0.
- [Release notes](https://github.com/mermaid-js/mermaid-cli/releases)
- [Commits](https://github.com/mermaid-js/mermaid-cli/compare/10.6.1...10.7.0)

---
updated-dependencies:
- dependency-name: "@mermaid-js/mermaid-cli"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-31 22:04:28 +00:00
Marc Klingen e689c1cacb chore: move github discussions to org level 2024-01-31 22:59:35 +01:00
Richard KrümmelandGitHub 37c0737624 feat(db): add openai fine tuned and vertex ai models (#995) 2024-01-31 14:19:17 +01:00
23bc448088 fix(ui): fix create new model label (#1005)
Co-authored-by: Max Deichmann <m.deichmann@tum.de>
2024-01-31 11:46:15 +01:00
Max Deichmann f1bdea98be chore: release v2.0.0
CI/CD / push-docker-image (push) Blocked by required conditions
CI/CD / tests (20) (push) Failing after 45s
CI/CD / tests (18) (push) Failing after 1m17s
CI/CD / e2e-tests (push) Failing after 45s
CI/CD / test-docker-build (push) Successful in 3m16s
CI/CD / lint (push) Successful in 4m1s
CI/CD / all-ci-passed (push) Waiting to run
release.yml / release (push) Failing after 4s
2024-01-30 19:56:07 +01:00
Max DeichmannandGitHub 9c00d1905f perf: reduce batch size (#997) 2024-01-30 17:47:31 +00:00
Max DeichmannandGitHub a31d737538 perf: improve migration script (#996) 2024-01-30 17:00:57 +00:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
7535872222 chore(deps-dev): bump @typescript-eslint/eslint-plugin from 6.19.1 to 6.20.0 (#985)
chore(deps-dev): bump @typescript-eslint/eslint-plugin

Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 6.19.1 to 6.20.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.20.0/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-30 15:47:44 +00:00
7e7bf99fac refactor: improve usage/cost (#992)
---------

Co-authored-by: Max Deichmann <m.deichmann@tum.de>
2024-01-30 15:43:08 +00:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
ac5a7a3171 chore(deps): bump the patches group with 1 update (#983)
Bumps the patches group with 1 update: [js-tiktoken](https://github.com/dqbd/tiktoken).


Updates `js-tiktoken` from 1.0.8 to 1.0.10
- [Release notes](https://github.com/dqbd/tiktoken/releases)
- [Changelog](https://github.com/dqbd/tiktoken/blob/main/CHANGELOG.md)
- [Commits](https://github.com/dqbd/tiktoken/compare/js-tiktoken@1.0.8...js-tiktoken@1.0.10)

---
updated-dependencies:
- dependency-name: js-tiktoken
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: patches
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-30 01:03:47 +00:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
eda5da635d chore(deps): bump clsx from 2.0.0 to 2.1.0 (#986)
Bumps [clsx](https://github.com/lukeed/clsx) from 2.0.0 to 2.1.0.
- [Release notes](https://github.com/lukeed/clsx/releases)
- [Commits](https://github.com/lukeed/clsx/compare/v2.0.0...v2.1.0)

---
updated-dependencies:
- dependency-name: clsx
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-30 01:56:29 +01:00
Max DeichmannandGitHub dc0cef5dbb feat: add cost to observations API (#947) 2024-01-29 19:09:16 +01:00
Marc KlingenandGitHub 24607c10ee chore(deps): bump dependencies (#979) 2024-01-29 15:23:15 +00:00
Marc KlingenandGitHub 8ddcfa8136 refactor: typing of AutoCompleteOption (#978) 2024-01-29 15:15:47 +00:00
Max DeichmannandGitHub 1f54043778 refactor: correct model migration command (#977) 2024-01-29 15:04:31 +00:00
Richard KrümmelandGitHub 97bec94093 feat(db): improve seeding script for prompts (#965) 2024-01-29 14:16:38 +01:00
93df11e043 feat: Add filtering by scores to the generations table (#880)
Co-authored-by: gitstart_bot <gitstart_bot@users.noreply.github.com>
Co-authored-by: gitstart-langfuse <gitstart-langfuse@users.noreply.github.com>
Co-authored-by: Max Deichmann <m.deichmann@tum.de>
2024-01-29 11:44:26 +01:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>Marc Klingen
327b66c241 chore(deps): bump the patches group with 13 updates (#970)
Bumps the patches group with 13 updates:

| Package | From | To |
| --- | --- | --- |
| [@headlessui/react](https://github.com/tailwindlabs/headlessui/tree/HEAD/packages/@headlessui-react) | `1.7.17` | `1.7.18` |
| [@react-email/components](https://github.com/resend/react-email/tree/HEAD/packages/components) | `0.0.12` | `0.0.14` |
| [@react-email/render](https://github.com/resend/react-email/tree/HEAD/packages/render) | `0.0.10` | `0.0.12` |
| [@tanstack/react-table](https://github.com/TanStack/table/tree/HEAD/packages/react-table) | `8.11.3` | `8.11.7` |
| [core-js](https://github.com/zloirock/core-js/tree/HEAD/packages/core-js) | `3.35.0` | `3.35.1` |
| [react-hook-form](https://github.com/react-hook-form/react-hook-form) | `7.49.2` | `7.49.3` |
| [tailwind-merge](https://github.com/dcastil/tailwind-merge) | `2.2.0` | `2.2.1` |
| [@types/eslint](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/eslint) | `8.56.1` | `8.56.2` |
| [@types/react](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react) | `18.2.46` | `18.2.48` |
| [@types/uuid](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/uuid) | `9.0.7` | `9.0.8` |
| [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) | `6.19.0` | `6.19.1` |
| [autoprefixer](https://github.com/postcss/autoprefixer) | `10.4.16` | `10.4.17` |
| [release-it](https://github.com/release-it/release-it) | `17.0.1` | `17.0.3` |


Updates `@headlessui/react` from 1.7.17 to 1.7.18
- [Release notes](https://github.com/tailwindlabs/headlessui/releases)
- [Changelog](https://github.com/tailwindlabs/headlessui/blob/main/packages/@headlessui-react/CHANGELOG.md)
- [Commits](https://github.com/tailwindlabs/headlessui/commits/@headlessui/react@v1.7.18/packages/@headlessui-react)

Updates `@react-email/components` from 0.0.12 to 0.0.14
- [Release notes](https://github.com/resend/react-email/releases)
- [Commits](https://github.com/resend/react-email/commits/v0.0.14/packages/components)

Updates `@react-email/render` from 0.0.10 to 0.0.12
- [Release notes](https://github.com/resend/react-email/releases)
- [Commits](https://github.com/resend/react-email/commits/v0.0.12/packages/render)

Updates `@tanstack/react-table` from 8.11.3 to 8.11.7
- [Release notes](https://github.com/TanStack/table/releases)
- [Commits](https://github.com/TanStack/table/commits/v8.11.7/packages/react-table)

Updates `core-js` from 3.35.0 to 3.35.1
- [Release notes](https://github.com/zloirock/core-js/releases)
- [Changelog](https://github.com/zloirock/core-js/blob/master/CHANGELOG.md)
- [Commits](https://github.com/zloirock/core-js/commits/v3.35.1/packages/core-js)

Updates `react-hook-form` from 7.49.2 to 7.49.3
- [Release notes](https://github.com/react-hook-form/react-hook-form/releases)
- [Changelog](https://github.com/react-hook-form/react-hook-form/blob/master/CHANGELOG.md)
- [Commits](https://github.com/react-hook-form/react-hook-form/compare/v7.49.2...v7.49.3)

Updates `tailwind-merge` from 2.2.0 to 2.2.1
- [Release notes](https://github.com/dcastil/tailwind-merge/releases)
- [Commits](https://github.com/dcastil/tailwind-merge/compare/v2.2.0...v2.2.1)

Updates `@types/eslint` from 8.56.1 to 8.56.2
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/eslint)

Updates `@types/react` from 18.2.46 to 18.2.48
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react)

Updates `@types/uuid` from 9.0.7 to 9.0.8
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/uuid)

Updates `@typescript-eslint/eslint-plugin` from 6.19.0 to 6.19.1
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.19.1/packages/eslint-plugin)

Updates `autoprefixer` from 10.4.16 to 10.4.17
- [Release notes](https://github.com/postcss/autoprefixer/releases)
- [Changelog](https://github.com/postcss/autoprefixer/blob/main/CHANGELOG.md)
- [Commits](https://github.com/postcss/autoprefixer/compare/10.4.16...10.4.17)

Updates `release-it` from 17.0.1 to 17.0.3
- [Release notes](https://github.com/release-it/release-it/releases)
- [Changelog](https://github.com/release-it/release-it/blob/main/CHANGELOG.md)
- [Commits](https://github.com/release-it/release-it/compare/17.0.1...17.0.3)

---
updated-dependencies:
- dependency-name: "@headlessui/react"
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: patches
- dependency-name: "@react-email/components"
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: patches
- dependency-name: "@react-email/render"
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: patches
- dependency-name: "@tanstack/react-table"
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: patches
- dependency-name: core-js
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: patches
- dependency-name: react-hook-form
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: patches
- dependency-name: tailwind-merge
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: patches
- dependency-name: "@types/eslint"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: patches
- dependency-name: "@types/react"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: patches
- dependency-name: "@types/uuid"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: patches
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: patches
- dependency-name: autoprefixer
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: patches
- dependency-name: release-it
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: patches
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Marc Klingen <git@marcklingen.com>
2024-01-27 19:08:09 +01:00
Marc KlingenandGitHub f3fd52fdbb feat(ui): custom model prices and tokenization (#954) 2024-01-27 18:52:31 +01:00
Marc KlingenandGitHub f3727c6209 revert(api): increase of max body size (#975) 2024-01-27 18:44:18 +01:00
Marc KlingenandGitHub 8a3281db03 chore: fix typo (#974) 2024-01-27 17:39:41 +00:00
Max Deichmann 19a21dca5a Merge branch 'main' of https://github.com/langfuse/langfuse 2024-01-26 23:45:06 +01:00
Max Deichmann 09dcad7427 perf: increase body size 2024-01-26 23:45:02 +01:00
Max DeichmannandGitHub 172cbed9b5 feat: add new openai model prices (#967) 2024-01-26 17:37:19 +00:00
Richard KrümmelandGitHub f7e20a9ff6 fix: error log for api prompts (#966) 2024-01-26 16:50:50 +01:00
Max DeichmannandGitHub 4b213151d1 fix: retrieve api prompts (#963) 2024-01-26 15:20:46 +00:00
Max DeichmannandGitHub dd99efe692 refactor: formatting (#962) 2024-01-26 13:41:40 +00:00
Richard KrümmelandGitHub ff303750cc feat(ui): add improved prompt ui (#961) 2024-01-26 14:20:58 +01:00
Max DeichmannandGitHub ef6e1e0bf4 perf: use js-tiktoken (#957) 2024-01-25 20:42:46 +01:00
Max DeichmannandGitHub c0ed93132f fix: support emoji in tokenizer (#956) 2024-01-25 11:18:53 +00:00
Max DeichmannandGitHub 3503537539 refactor: db logging in dev mode (#952) 2024-01-24 18:35:23 +00:00
Max DeichmannandGitHub b9a3f33e97 fix: fix token configuration (#951) 2024-01-24 18:14:28 +00:00
Max DeichmannandGitHub c2f612d0b8 fix: fix toktoken tokenizer for unexpected input (#950) 2024-01-24 15:55:24 +00:00
Marc KlingenandGitHub 9f492ecec9 fix(sessions): composite ids (#946) 2024-01-24 15:27:31 +01:00
Max DeichmannandGitHub d87432cce3 fix: pull metrics table from observations only (#945) 2024-01-24 12:46:41 +00:00
Max DeichmannandGitHub cf34c91734 fix: model usage chart (#944) 2024-01-24 12:20:34 +00:00
Max DeichmannandGitHub 851b54fa47 perf: Improve migration (#943) 2024-01-24 12:56:13 +01:00
Richard KrümmelandGitHub c858a1800b fix(security): add validation for html in inputs (#927) 2024-01-24 11:43:33 +01:00
Max DeichmannandGitHub f2405f1561 feat: revamp pricing and cost (#901) 2024-01-24 10:53:48 +01:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
deee890647 chore(deps-dev): bump @testing-library/jest-dom from 6.1.5 to 6.2.1 (#936)
Bumps [@testing-library/jest-dom](https://github.com/testing-library/jest-dom) from 6.1.5 to 6.2.1.
- [Release notes](https://github.com/testing-library/jest-dom/releases)
- [Changelog](https://github.com/testing-library/jest-dom/blob/main/CHANGELOG.md)
- [Commits](https://github.com/testing-library/jest-dom/compare/v6.1.5...v6.2.1)

---
updated-dependencies:
- dependency-name: "@testing-library/jest-dom"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-24 00:18:28 +00:00
Marc Klingen ebabf0e100 chore: release v1.34.1
CI/CD / push-docker-image (push) Blocked by required conditions
CI/CD / tests (18) (push) Failing after 50s
CI/CD / tests (20) (push) Failing after 55s
release.yml / release (push) Failing after 3s
CI/CD / e2e-tests (push) Failing after 45s
CI/CD / test-docker-build (push) Successful in 3m12s
CI/CD / lint (push) Successful in 4m0s
CI/CD / all-ci-passed (push) Waiting to run
2024-01-24 01:12:22 +01:00
Marc KlingenandGitHub e05d4693d2 fix(ui): encodeURIComponent for session and user ids (#940)
Before, special characters in those ids would break the UI as the ids are used as URI components
2024-01-24 01:11:37 +01:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
77d49adc00 chore(deps): bump react-icons from 4.12.0 to 5.0.1 (#935)
Bumps [react-icons](https://github.com/react-icons/react-icons) from 4.12.0 to 5.0.1.
- [Release notes](https://github.com/react-icons/react-icons/releases)
- [Commits](https://github.com/react-icons/react-icons/compare/v4.12.0...v5.0.1)

---
updated-dependencies:
- dependency-name: react-icons
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-23 23:55:10 +00:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
7dc45f0074 chore(deps): bump lucide-react from 0.306.0 to 0.314.0 (#937)
Bumps [lucide-react](https://github.com/lucide-icons/lucide/tree/HEAD/packages/lucide-react) from 0.306.0 to 0.314.0.
- [Release notes](https://github.com/lucide-icons/lucide/releases)
- [Commits](https://github.com/lucide-icons/lucide/commits/0.314.0/packages/lucide-react)

---
updated-dependencies:
- dependency-name: lucide-react
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-24 00:49:42 +01:00
44d1da3c9c fix: fix playwright test timeouts (#868)
Co-authored-by: gitstart_bot <gitstart_bot@users.noreply.github.com>
Co-authored-by: gitstart-langfuse <gitstart-langfuse@users.noreply.github.com>
Co-authored-by: Max Deichmann <m.deichmann@tum.de>
2024-01-23 23:47:53 +01:00
jhlopenandGitHub 564ba4bd68 chore: mitigate type truncation in VS Code tooltip (#932) 2024-01-23 23:38:30 +01:00
Marc Klingen 63df788908 chore: release v1.34.0
CI/CD / push-docker-image (push) Blocked by required conditions
CI/CD / tests (18) (push) Failing after 47s
CI/CD / tests (20) (push) Failing after 44s
release.yml / release (push) Failing after 2s
CI/CD / e2e-tests (push) Failing after 41s
CI/CD / test-docker-build (push) Successful in 3m14s
CI/CD / lint (push) Successful in 5m59s
CI/CD / all-ci-passed (push) Waiting to run
2024-01-23 22:59:17 +01:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
fb463cbf98 chore(deps): bump the sentry group with 2 updates (#931)
Bumps the sentry group with 2 updates: [@sentry/nextjs](https://github.com/getsentry/sentry-javascript) and [@sentry/profiling-node](https://github.com/getsentry/profiling-node).


Updates `@sentry/nextjs` from 7.92.0 to 7.95.0
- [Release notes](https://github.com/getsentry/sentry-javascript/releases)
- [Changelog](https://github.com/getsentry/sentry-javascript/blob/develop/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-javascript/compare/7.92.0...7.95.0)

Updates `@sentry/profiling-node` from 1.3.2 to 1.3.5
- [Release notes](https://github.com/getsentry/profiling-node/releases)
- [Changelog](https://github.com/getsentry/profiling-node/blob/main/CHANGES)
- [Commits](https://github.com/getsentry/profiling-node/compare/v1.3.2...v1.3.5)

---
updated-dependencies:
- dependency-name: "@sentry/nextjs"
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: sentry
- dependency-name: "@sentry/profiling-node"
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: sentry
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-23 21:56:41 +00:00
Marc KlingenandGitHub cfd99efd48 feat(ui): add ordering to sessions table (#930) 2024-01-23 21:33:12 +00:00
Marc KlingenandGitHub 3b2c5f8bf3 feat(ui): add ordering to generations table (#929) 2024-01-23 21:23:47 +00:00
Marc KlingenandGitHub d08a276b67 perf: revert splitting of generations trpc call (#928) 2024-01-23 21:03:17 +00:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
23bc2cd39c chore(deps): bump the next group with 2 updates (#924)
Bumps the next group with 2 updates: [next](https://github.com/vercel/next.js) and [eslint-config-next](https://github.com/vercel/next.js/tree/HEAD/packages/eslint-config-next).


Updates `next` from 14.0.4 to 14.1.0
- [Release notes](https://github.com/vercel/next.js/releases)
- [Changelog](https://github.com/vercel/next.js/blob/canary/release.js)
- [Commits](https://github.com/vercel/next.js/compare/v14.0.4...v14.1.0)

Updates `eslint-config-next` from 14.0.4 to 14.1.0
- [Release notes](https://github.com/vercel/next.js/releases)
- [Changelog](https://github.com/vercel/next.js/blob/canary/release.js)
- [Commits](https://github.com/vercel/next.js/commits/v14.1.0/packages/eslint-config-next)

---
updated-dependencies:
- dependency-name: next
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: next
- dependency-name: eslint-config-next
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: next
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-23 14:57:01 +00:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
a31eda8c68 chore(deps): bump date-fns from 3.1.0 to 3.3.1 (#926)
Bumps [date-fns](https://github.com/date-fns/date-fns) from 3.1.0 to 3.3.1.
- [Release notes](https://github.com/date-fns/date-fns/releases)
- [Changelog](https://github.com/date-fns/date-fns/blob/main/CHANGELOG.md)
- [Commits](https://github.com/date-fns/date-fns/compare/v3.1.0...v3.3.1)

---
updated-dependencies:
- dependency-name: date-fns
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-23 15:52:08 +01:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
d044ae51d1 chore(deps-dev): bump @typescript-eslint/parser from 6.16.0 to 6.19.1 (#922)
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 6.16.0 to 6.19.1.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.19.1/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-22 22:11:22 +00:00
Marc KlingenandGitHub 552578afc3 fix(ui): improve ui of tag manager (#921) 2024-01-22 21:41:52 +00:00
Marc Klingen 00997db325 chore: release v1.33.10
CI/CD / push-docker-image (push) Blocked by required conditions
CI/CD / tests (18) (push) Failing after 2m38s
CI/CD / tests (20) (push) Failing after 2m2s
CI/CD / test-docker-build (push) Successful in 5m10s
CI/CD / lint (push) Successful in 5m33s
CI/CD / e2e-tests (push) Failing after 2m17s
CI/CD / all-ci-passed (push) Waiting to run
release.yml / release (push) Failing after 3s
2024-01-22 22:17:00 +01:00
Marc KlingenandGitHub 550464cf0b perf: native db upserts for TraceProcessor and ObservationProcessor (#920) 2024-01-22 22:05:48 +01:00
Max DeichmannandGitHub e43568a3d2 fix: send error only in custom sentry alert (#919) 2024-01-22 18:21:17 +00:00
Max DeichmannandGitHub 4869e8a093 fix: remove sentry instrumentation (#918) 2024-01-22 18:16:27 +00:00
Max Deichmann d9b307ec87 chore: release v1.33.9
CI/CD / push-docker-image (push) Blocked by required conditions
CI/CD / tests (18) (push) Failing after 1m16s
CI/CD / tests (20) (push) Failing after 42s
release.yml / release (push) Failing after 3s
CI/CD / e2e-tests (push) Failing after 1m1s
CI/CD / test-docker-build (push) Successful in 3m52s
CI/CD / lint (push) Successful in 4m15s
CI/CD / all-ci-passed (push) Waiting to run
2024-01-22 13:11:40 +01:00
Max Deichmann 3abfbef4c3 refactor: update openapi docs 2024-01-22 13:08:06 +01:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>Max Deichmann
86aa1eb34f chore(deps): bump posthog-js from 1.96.1 to 1.100.0 (#885)
Bumps [posthog-js](https://github.com/PostHog/posthog-js) from 1.96.1 to 1.100.0.
- [Release notes](https://github.com/PostHog/posthog-js/releases)
- [Changelog](https://github.com/PostHog/posthog-js/blob/master/CHANGELOG.md)
- [Commits](https://github.com/PostHog/posthog-js/compare/v1.96.1...v1.100.0)

---
updated-dependencies:
- dependency-name: posthog-js
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Max Deichmann <m.deichmann@tum.de>
2024-01-22 11:35:24 +01:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>Max Deichmann
59edc9851a chore(deps): bump the prisma group with 2 updates (#884)
Bumps the prisma group with 2 updates: [@prisma/client](https://github.com/prisma/prisma/tree/HEAD/packages/client) and [prisma](https://github.com/prisma/prisma/tree/HEAD/packages/cli).


Updates `@prisma/client` from 5.7.1 to 5.8.1
- [Release notes](https://github.com/prisma/prisma/releases)
- [Commits](https://github.com/prisma/prisma/commits/5.8.1/packages/client)

Updates `prisma` from 5.7.1 to 5.8.1
- [Release notes](https://github.com/prisma/prisma/releases)
- [Commits](https://github.com/prisma/prisma/commits/5.8.1/packages/cli)

---
updated-dependencies:
- dependency-name: "@prisma/client"
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: prisma
- dependency-name: prisma
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: prisma
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Max Deichmann <m.deichmann@tum.de>
2024-01-22 10:17:09 +00:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
0e31dcef99 chore(deps-dev): bump @typescript-eslint/eslint-plugin from 6.17.0 to 6.19.0 (#887)
chore(deps-dev): bump @typescript-eslint/eslint-plugin

Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 6.17.0 to 6.19.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.19.0/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-22 11:12:11 +01:00
Max DeichmannandGitHub a67235ab8a feat: support ordering traces on the GET API (#913) 2024-01-19 13:37:31 +00:00
Max Deichmann eb88c9bdf8 chore: release v1.33.8
CI/CD / push-docker-image (push) Blocked by required conditions
CI/CD / tests (18) (push) Failing after 51s
CI/CD / tests (20) (push) Failing after 44s
release.yml / release (push) Failing after 3s
CI/CD / e2e-tests (push) Failing after 48s
CI/CD / lint (push) Successful in 4m17s
CI/CD / test-docker-build (push) Successful in 4m5s
CI/CD / all-ci-passed (push) Waiting to run
2024-01-19 11:58:20 +01:00
Richard KrümmelandGitHub 77e4791cbe feat(ui): add option to keep tracing side menu open (#912) 2024-01-19 11:54:44 +01:00
Max DeichmannandGitHub 5d922dfae7 fix: filter generations metadata correctly (#911) 2024-01-18 15:35:41 +00:00
Max DeichmannandGitHub c704c84451 fix: fix jsonl export to correctly append output (#909) 2024-01-18 13:14:37 +00:00
Max DeichmannandGitHub 6f23488438 fix: sentry reports only unknown errors (#908) 2024-01-18 12:14:54 +00:00
Max Deichmann ca50abb290 chore: release v1.33.7
CI/CD / push-docker-image (push) Blocked by required conditions
CI/CD / tests (18) (push) Failing after 46s
CI/CD / tests (20) (push) Failing after 42s
CI/CD / e2e-tests (push) Failing after 42s
release.yml / release (push) Failing after 2s
CI/CD / test-docker-build (push) Successful in 3m34s
CI/CD / lint (push) Successful in 4m6s
CI/CD / all-ci-passed (push) Waiting to run
2024-01-17 21:18:44 +01:00
Max DeichmannandGitHub 15067114a2 feat: support array of strings in model parameters (#905) 2024-01-17 20:13:12 +00:00
Max DeichmannandGitHub 645f14535b fic: use encoding once (#904) 2024-01-17 16:58:25 +00:00
Max Deichmann 250a5b03d2 chore: release v1.33.6
CI/CD / push-docker-image (push) Blocked by required conditions
CI/CD / tests (18) (push) Failing after 58s
CI/CD / tests (20) (push) Failing after 1m7s
release.yml / release (push) Failing after 3s
CI/CD / test-docker-build (push) Successful in 3m6s
CI/CD / e2e-tests (push) Failing after 48s
CI/CD / lint (push) Successful in 4m1s
CI/CD / all-ci-passed (push) Waiting to run
2024-01-17 16:25:56 +01:00
Max DeichmannandGitHub 5ee060dfc6 refactor: remove external id uniqueness constraint (#903) 2024-01-17 15:24:31 +00:00
Max DeichmannandGitHub f08502cde4 fix: upsert traces on ingestion only on the id (#900) 2024-01-17 13:55:32 +00:00
Max Deichmann 90ecb88249 chore: release v1.33.5
CI/CD / push-docker-image (push) Blocked by required conditions
CI/CD / tests (18) (push) Failing after 48s
CI/CD / tests (20) (push) Failing after 44s
release.yml / release (push) Failing after 2s
CI/CD / e2e-tests (push) Failing after 44s
CI/CD / test-docker-build (push) Successful in 2m47s
CI/CD / lint (push) Successful in 4m15s
CI/CD / all-ci-passed (push) Waiting to run
2024-01-17 14:05:47 +01:00
Max DeichmannandGitHub 16e60f74da fix: capture ingestion errors in sentry (#899) 2024-01-17 12:52:56 +00:00
Max Deichmann 0ab252cc7c chore: release v1.33.3
CI/CD / push-docker-image (push) Blocked by required conditions
CI/CD / tests (18) (push) Failing after 1m10s
CI/CD / tests (20) (push) Failing after 43s
CI/CD / e2e-tests (push) Failing after 42s
release.yml / release (push) Failing after 3s
CI/CD / test-docker-build (push) Successful in 3m39s
CI/CD / lint (push) Successful in 4m7s
CI/CD / all-ci-passed (push) Waiting to run
2024-01-17 13:36:03 +01:00
Max DeichmannandGitHub ebadbaf30d fix: increase ingestion API body size (#898) 2024-01-17 12:23:06 +00:00
Max Deichmann 7ce6b6817e chore: release v1.33.2
CI/CD / push-docker-image (push) Blocked by required conditions
CI/CD / tests (18) (push) Failing after 2m32s
CI/CD / tests (20) (push) Failing after 2m2s
CI/CD / e2e-tests (push) Failing after 2m11s
release.yml / release (push) Failing after 3s
CI/CD / test-docker-build (push) Successful in 5m16s
CI/CD / lint (push) Successful in 5m31s
CI/CD / all-ci-passed (push) Waiting to run
2024-01-17 11:39:23 +01:00
Max DeichmannandGitHub 6d4040d5ed fix: free tiktoken encoder to prevent OOM issues (#897) 2024-01-17 10:32:28 +00:00
Max DeichmannandGitHub 4a7a4c0add feat(infrastructure): add decimal.js support for trpc (#895) 2024-01-16 19:29:29 +01:00
Max Deichmann 883e53d8b5 chore: release v1.33.1
CI/CD / push-docker-image (push) Blocked by required conditions
CI/CD / tests (18) (push) Failing after 2m36s
CI/CD / tests (20) (push) Failing after 2m2s
CI/CD / e2e-tests (push) Failing after 2m14s
CI/CD / lint (push) Successful in 5m48s
CI/CD / test-docker-build (push) Successful in 6m10s
CI/CD / all-ci-passed (push) Waiting to run
release.yml / release (push) Failing after 3s
2024-01-16 18:17:46 +01:00
Richard KrümmelandGitHub a9e6b9ae5c fix: remove tags json view from TracePreview (#894) 2024-01-16 17:12:10 +00:00
Max Deichmann a61ee1f29f chore: release v1.33.0
CI/CD / push-docker-image (push) Blocked by required conditions
CI/CD / tests (18) (push) Failing after 2m50s
CI/CD / tests (20) (push) Failing after 2m2s
CI/CD / test-docker-build (push) Successful in 4m42s
CI/CD / lint (push) Successful in 5m33s
CI/CD / e2e-tests (push) Failing after 2m19s
CI/CD / all-ci-passed (push) Waiting to run
release.yml / release (push) Failing after 3s
2024-01-16 17:44:50 +01:00
Richard KrümmelandGitHub eefdf60e31 feat(ui): add ui for tags on traces (#879) 2024-01-16 17:44:16 +01:00
Max DeichmannandGitHub 19a633a756 fix: add new cost visualisation to trace detail header (#893)
add new cost to traces
2024-01-16 15:49:55 +00:00
Max DeichmannandGitHub e84c1a3ab8 fix: upgrade decimal on export (#892) 2024-01-16 15:32:53 +00:00
Max Deichmann 4d41aa7e53 chore: release v1.32.3
CI/CD / push-docker-image (push) Blocked by required conditions
CI/CD / tests (18) (push) Failing after 2m31s
CI/CD / tests (20) (push) Failing after 2m21s
CI/CD / test-docker-build (push) Successful in 4m44s
CI/CD / e2e-tests (push) Failing after 2m13s
CI/CD / lint (push) Successful in 5m48s
CI/CD / all-ci-passed (push) Waiting to run
release.yml / release (push) Failing after 3s
2024-01-16 16:09:48 +01:00
Max DeichmannandGitHub a4c28cc324 fix: generations table latency (#891) 2024-01-16 15:09:28 +00:00
Max DeichmannandGitHub 187f2e7b1d fix: convert decimals on trpc to number (#890) 2024-01-16 14:50:52 +00:00
Max Deichmann b355825295 chore: release v1.32.2
CI/CD / push-docker-image (push) Blocked by required conditions
CI/CD / tests (18) (push) Failing after 2m37s
CI/CD / tests (20) (push) Failing after 2m4s
CI/CD / e2e-tests (push) Failing after 2m11s
CI/CD / test-docker-build (push) Successful in 5m14s
CI/CD / lint (push) Successful in 5m35s
CI/CD / all-ci-passed (push) Waiting to run
release.yml / release (push) Failing after 4s
2024-01-16 14:47:50 +01:00
Max DeichmannandGitHub 33dc18356a fix: increase decimal places for exports and unify across UI (#889) 2024-01-16 13:35:50 +00:00
Max Deichmann c804d90f6a chore: release v1.32.1
CI/CD / push-docker-image (push) Blocked by required conditions
CI/CD / tests (18) (push) Failing after 2m32s
CI/CD / tests (20) (push) Failing after 2m3s
CI/CD / e2e-tests (push) Failing after 2m11s
CI/CD / test-docker-build (push) Successful in 5m4s
CI/CD / lint (push) Successful in 5m30s
CI/CD / all-ci-passed (push) Waiting to run
release.yml / release (push) Failing after 3s
2024-01-15 19:36:51 +01:00
Max DeichmannandGitHub 09aa547de1 fix: use async sentry span (#883) 2024-01-15 18:35:37 +00:00
Max Deichmann 57839eae5c chore: release v1.32.0
CI/CD / push-docker-image (push) Blocked by required conditions
CI/CD / tests (18) (push) Failing after 2m35s
CI/CD / tests (20) (push) Failing after 2m3s
release.yml / release (push) Failing after 2s
CI/CD / e2e-tests (push) Failing after 2m11s
CI/CD / test-docker-build (push) Successful in 5m4s
CI/CD / lint (push) Successful in 5m33s
CI/CD / all-ci-passed (push) Waiting to run
2024-01-15 19:10:40 +01:00
Max DeichmannandGitHub a43f5f38a1 fix: fix return types on traces router (#882) 2024-01-15 18:09:58 +00:00
8220d07057 feat(ui): add navigation to datasets and dataset items (#871)
* Add DetailPageNav component to Dataset item page

* Add useDetailPageLists hook and useEffect in DatasetItemsTable

* Add useDetailPageLists hook and useEffect in DatasetsTable

* Add DetailPageNav component to Dataset page

* Add DetailPageNav component to DatasetItems

* Add useDetailPageLists hook and useEffect to DatasetRunsTable

* Fix: only show navigation when there is more than one item

* Add DetailPageNav component to DatasetRunItemsTable

* Seed db with two datasets each with two runs and fix CL logging

---------

Co-authored-by: Max Deichmann <m.deichmann@tum.de>
2024-01-15 19:01:40 +01:00
Max Deichmann 89ffe20363 chore: release v1.31.4
CI/CD / push-docker-image (push) Blocked by required conditions
CI/CD / tests (18) (push) Failing after 2m36s
CI/CD / tests (20) (push) Failing after 2m4s
release.yml / release (push) Failing after 2s
CI/CD / e2e-tests (push) Failing after 2m13s
CI/CD / test-docker-build (push) Successful in 5m8s
CI/CD / lint (push) Successful in 5m33s
CI/CD / all-ci-passed (push) Waiting to run
2024-01-15 18:45:23 +01:00
Max DeichmannandGitHub 9a3adf54b1 fix: traces table performance (#881) 2024-01-15 17:44:57 +00:00
Max Deichmann 459129118e chore: release v1.31.3
CI/CD / push-docker-image (push) Blocked by required conditions
CI/CD / tests (18) (push) Failing after 2m32s
CI/CD / tests (20) (push) Failing after 2m2s
release.yml / release (push) Failing after 2s
CI/CD / e2e-tests (push) Failing after 2m8s
CI/CD / test-docker-build (push) Successful in 5m9s
CI/CD / lint (push) Successful in 5m36s
CI/CD / all-ci-passed (push) Waiting to run
2024-01-15 11:26:03 +01:00
Max DeichmannandGitHub 0862370ad6 feat(ui): add time to first token to observation detail view (#878)
add time to first token
2024-01-15 10:25:09 +00:00
Max Deichmann 1bddde99f0 chore: release v1.31.2
CI/CD / push-docker-image (push) Blocked by required conditions
CI/CD / tests (18) (push) Failing after 2m34s
CI/CD / tests (20) (push) Failing after 2m3s
release.yml / release (push) Failing after 3s
CI/CD / e2e-tests (push) Failing after 2m12s
CI/CD / lint (push) Successful in 5m44s
CI/CD / test-docker-build (push) Successful in 5m53s
CI/CD / all-ci-passed (push) Waiting to run
2024-01-11 21:01:07 +01:00
Max DeichmannandGitHub fe2e7681da fix: generations table performance (#872) 2024-01-11 20:50:49 +01:00
Marc Klingen d209766f01 docs: add comment to optimistic update 2024-01-11 18:05:51 +01:00
Richard KrümmelandGitHub 82bfe03dba feat: use react query for optimistic updates (#862) 2024-01-11 16:55:28 +00:00
Marc Klingen 15fc8e4c3c chore: release v1.31.1
CI/CD / push-docker-image (push) Blocked by required conditions
CI/CD / tests (18) (push) Failing after 2m33s
CI/CD / tests (20) (push) Failing after 2m3s
release.yml / release (push) Failing after 3s
CI/CD / e2e-tests (push) Failing after 2m13s
CI/CD / lint (push) Successful in 5m32s
CI/CD / test-docker-build (push) Successful in 6m21s
CI/CD / all-ci-passed (push) Waiting to run
2024-01-11 17:44:18 +01:00
Marc KlingenandGitHub 374dbf9716 feat(tokenization): support alternative model name, gpt-35* instead of gpt-3.5* (#869) 2024-01-11 15:58:16 +00:00
jhlopenandGitHub 6819988f90 perf: return immediately if trace not found (#861) 2024-01-11 15:15:34 +00:00
e3079afb2f fix: assign unique keys to sibling items (#860)
Co-authored-by: Max Deichmann <m.deichmann@tum.de>
2024-01-11 15:10:25 +00:00
HarpinderandGitHub 3b6689f44b fix: correct repo in issue template. (#867)
It pointed to scalar and not langfuse causing confusion while creating issues.
2024-01-11 13:51:45 +01:00
Max DeichmannandGitHub fdf417e961 fix: fix cd pipeline (#863) 2024-01-10 21:18:58 +00:00
Max DeichmannandGitHub a751f1f0f1 refactor: reduce sentry sampling (#858) 2024-01-10 13:57:36 +00:00
Marc KlingenandGitHub 5bf348b55e feat(cloud): add self-serve pricing/checkout page (#857) 2024-01-10 11:39:13 +01:00
Marc Klingen 4ffadc8124 chore: release v1.31.0
CI/CD / push-docker-image (push) Blocked by required conditions
CI/CD / tests (18) (push) Failing after 2m25s
release.yml / release (push) Failing after 2s
CI/CD / tests (20) (push) Failing after 2m20s
CI/CD / e2e-tests (push) Failing after 2m9s
CI/CD / lint (push) Successful in 5m31s
CI/CD / all-ci-passed (push) Waiting to run
2024-01-09 12:01:33 +01:00
Marc KlingenandGitHub 8069fb7ddd feat(cloud): ask new users for referral source, SSO and email/pw (#831) 2024-01-09 10:54:19 +00:00
Marc KlingenandGitHub 133fc90718 feat(ui): nested main navigation for tracing (#834) 2024-01-09 11:50:16 +01:00
Marc KlingenandGitHub 32a2a7956d feat(datasets): delete unused datasets instead of archiving them (#830) 2024-01-09 11:42:38 +01:00
Marc Klingen 01cc9832c1 chore: release v1.30.1
CI/CD / push-docker-image (push) Blocked by required conditions
CI/CD / tests (20) (push) Failing after 2m10s
release.yml / release (push) Failing after 2s
CI/CD / tests (18) (push) Failing after 2m33s
CI/CD / e2e-tests (push) Failing after 2m21s
CI/CD / lint (push) Successful in 5m23s
CI/CD / all-ci-passed (push) Waiting to run
2024-01-09 02:32:58 +01:00
Marc Klingen 6127ea6442 fix: next try to fix docker build problem 2024-01-09 02:22:44 +01:00
Marc Klingen 22fbc2a89d fix: revert 2d8cc2baa3 2024-01-09 02:08:36 +01:00
Marc Klingen 1ed2e230e0 fix: revert to prev @sentry/profiling-node to fix docker build issue 2024-01-09 01:57:42 +01:00
Marc Klingen 6563716f21 chore(deps): bump @sentry/types to fix build issues 2024-01-09 01:03:14 +01:00
Marc KlingenandGitHub 487e0a77d6 fix(ui): scroll behavior of large traces (#846)
fix(ui): scroll behvaior of large traces
2024-01-09 00:00:47 +00:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
c084d42b4a chore(deps): bump lucide-react from 0.306.0 to 0.307.0 (#841)
Bumps [lucide-react](https://github.com/lucide-icons/lucide/tree/HEAD/packages/lucide-react) from 0.306.0 to 0.307.0.
- [Release notes](https://github.com/lucide-icons/lucide/releases)
- [Commits](https://github.com/lucide-icons/lucide/commits/0.307.0/packages/lucide-react)

---
updated-dependencies:
- dependency-name: lucide-react
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-08 23:08:01 +00:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2d8cc2baa3 chore(deps): bump the patches group with 4 updates (#839)
Bumps the patches group with 4 updates: [@headlessui/react](https://github.com/tailwindlabs/headlessui/tree/HEAD/packages/@headlessui-react), [@sentry/profiling-node](https://github.com/getsentry/profiling-node), [react-hook-form](https://github.com/react-hook-form/react-hook-form) and [@types/react](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react).


Updates `@headlessui/react` from 1.7.17 to 1.7.18
- [Release notes](https://github.com/tailwindlabs/headlessui/releases)
- [Changelog](https://github.com/tailwindlabs/headlessui/blob/main/packages/@headlessui-react/CHANGELOG.md)
- [Commits](https://github.com/tailwindlabs/headlessui/commits/@headlessui/react@v1.7.18/packages/@headlessui-react)

Updates `@sentry/profiling-node` from 1.3.2 to 1.3.3
- [Release notes](https://github.com/getsentry/profiling-node/releases)
- [Changelog](https://github.com/getsentry/profiling-node/blob/main/CHANGES)
- [Commits](https://github.com/getsentry/profiling-node/compare/v1.3.2...v1.3.3)

Updates `react-hook-form` from 7.49.2 to 7.49.3
- [Release notes](https://github.com/react-hook-form/react-hook-form/releases)
- [Changelog](https://github.com/react-hook-form/react-hook-form/blob/master/CHANGELOG.md)
- [Commits](https://github.com/react-hook-form/react-hook-form/compare/v7.49.2...v7.49.3)

Updates `@types/react` from 18.2.46 to 18.2.47
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react)

---
updated-dependencies:
- dependency-name: "@headlessui/react"
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: patches
- dependency-name: "@sentry/profiling-node"
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: patches
- dependency-name: react-hook-form
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: patches
- dependency-name: "@types/react"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: patches
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-09 00:03:56 +01:00
Marc Klingen 47630f7c5f chore: issue creation should be enabled 2024-01-08 22:41:06 +01:00
Marc Klingen 082dfaf339 docs: add note on database schema to contributing.md 2024-01-07 17:25:29 +01:00
Max DeichmannandGitHub f8efbd51da style: add db diagram to contributing.md (#833) 2024-01-07 14:13:15 +00:00
Marc Klingen 22d98256ce chore: issue templates 2024-01-06 19:05:27 +01:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
00caa680f2 chore(deps-dev): bump the patches group with 2 updates (#823)
Bumps the patches group with 2 updates: [prettier-plugin-tailwindcss](https://github.com/tailwindlabs/prettier-plugin-tailwindcss) and [tailwindcss](https://github.com/tailwindlabs/tailwindcss).


Updates `prettier-plugin-tailwindcss` from 0.5.10 to 0.5.11
- [Release notes](https://github.com/tailwindlabs/prettier-plugin-tailwindcss/releases)
- [Changelog](https://github.com/tailwindlabs/prettier-plugin-tailwindcss/blob/main/CHANGELOG.md)
- [Commits](https://github.com/tailwindlabs/prettier-plugin-tailwindcss/compare/v0.5.10...v0.5.11)

Updates `tailwindcss` from 3.4.0 to 3.4.1
- [Release notes](https://github.com/tailwindlabs/tailwindcss/releases)
- [Changelog](https://github.com/tailwindlabs/tailwindcss/blob/v3.4.1/CHANGELOG.md)
- [Commits](https://github.com/tailwindlabs/tailwindcss/compare/v3.4.0...v3.4.1)

---
updated-dependencies:
- dependency-name: prettier-plugin-tailwindcss
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: patches
- dependency-name: tailwindcss
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: patches
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-06 02:03:37 +00:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
48d35eb637 chore(deps-dev): bump @typescript-eslint/eslint-plugin from 6.16.0 to 6.17.0 (#824)
chore(deps-dev): bump @typescript-eslint/eslint-plugin

Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 6.16.0 to 6.17.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.17.0/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-06 01:56:09 +00:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
61786fedfb chore(deps): bump date-fns from 3.0.6 to 3.1.0 (#825)
Bumps [date-fns](https://github.com/date-fns/date-fns) from 3.0.6 to 3.1.0.
- [Release notes](https://github.com/date-fns/date-fns/releases)
- [Changelog](https://github.com/date-fns/date-fns/blob/main/CHANGELOG.md)
- [Commits](https://github.com/date-fns/date-fns/compare/v3.0.6...v3.1.0)

---
updated-dependencies:
- dependency-name: date-fns
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-06 01:51:47 +00:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
1f3e3603be chore(deps): bump lucide-react from 0.304.0 to 0.306.0 (#826)
Bumps [lucide-react](https://github.com/lucide-icons/lucide/tree/HEAD/packages/lucide-react) from 0.304.0 to 0.306.0.
- [Release notes](https://github.com/lucide-icons/lucide/releases)
- [Commits](https://github.com/lucide-icons/lucide/commits/0.306.0/packages/lucide-react)

---
updated-dependencies:
- dependency-name: lucide-react
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-06 01:47:38 +00:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
cee2c797c4 chore(deps): bump @aws-sdk/s3-request-presigner from 3.478.0 to 3.485.0 (#827)
Bumps [@aws-sdk/s3-request-presigner](https://github.com/aws/aws-sdk-js-v3/tree/HEAD/packages/s3-request-presigner) from 3.478.0 to 3.485.0.
- [Release notes](https://github.com/aws/aws-sdk-js-v3/releases)
- [Changelog](https://github.com/aws/aws-sdk-js-v3/blob/main/packages/s3-request-presigner/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-js-v3/commits/v3.485.0/packages/s3-request-presigner)

---
updated-dependencies:
- dependency-name: "@aws-sdk/s3-request-presigner"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-06 01:43:38 +00:00
Marc Klingen 35668469f0 chore: release v1.30.0
CI/CD / push-docker-image (push) Blocked by required conditions
CI/CD / tests (18) (push) Failing after 2m25s
CI/CD / tests (20) (push) Failing after 2m15s
release.yml / release (push) Failing after 3s
CI/CD / e2e-tests (push) Failing after 2m3s
CI/CD / lint (push) Successful in 5m28s
CI/CD / all-ci-passed (push) Waiting to run
2024-01-06 02:35:57 +01:00
Marc Klingen 3cfe7df03e docs: add help tooltips to all major pages 2024-01-06 02:35:04 +01:00
Marc Klingen 3301475810 chore: remove filter page which was meant for development 2024-01-06 02:28:01 +01:00
Marc Klingen 04f703dec0 chore: upgrade fern 2024-01-06 02:20:27 +01:00
Marc KlingenandGitHub bc064bd65b docs: add npm run dx to CONTRIBUTING.md 2024-01-05 21:52:00 +01:00
Marc KlingenandGitHub 917bb8931e feat(api): get traces by tag (#820) 2024-01-05 18:39:28 +01:00
Max Deichmann 150651334c chore: release v1.29.0
CI/CD / push-docker-image (push) Blocked by required conditions
CI/CD / tests (18) (push) Failing after 2m25s
CI/CD / tests (20) (push) Failing after 2m14s
CI/CD / e2e-tests (push) Failing after 1m59s
release.yml / release (push) Failing after 2s
CI/CD / lint (push) Successful in 5m29s
CI/CD / all-ci-passed (push) Waiting to run
2024-01-05 15:02:56 +01:00
858a72aaa1 feat: add tags for traces (#801)
Co-authored-by: gitstart_bot <gitstart_bot@users.noreply.github.com>
Co-authored-by: gitstart-langfuse <gitstart-langfuse@users.noreply.github.com>
2024-01-05 13:58:13 +00:00
Marc Klingen 22134f3917 fix(ui): change icon 2024-01-05 14:39:38 +01:00
Marc Klingen 62a0d87d77 chore: add npm run dx to quickly checkout branch 2024-01-05 14:15:07 +01:00
Marc Klingen e158039639 chore: release v1.28.1
CI/CD / push-docker-image (push) Blocked by required conditions
CI/CD / tests (20) (push) Failing after 2m8s
CI/CD / tests (18) (push) Failing after 2m17s
CI/CD / e2e-tests (push) Failing after 2m6s
release.yml / release (push) Failing after 3s
CI/CD / lint (push) Successful in 5m42s
CI/CD / all-ci-passed (push) Waiting to run
2024-01-05 11:49:31 +01:00
Marc Klingen f62752dfa7 fix(ui): do not parse stringified numbers in JSON view 2024-01-05 11:48:47 +01:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2214d7d0ee chore(deps): bump the sentry group with 1 update (#814)
Bumps the sentry group with 1 update: [@sentry/nextjs](https://github.com/getsentry/sentry-javascript).


Updates `@sentry/nextjs` from 7.91.0 to 7.92.0
- [Release notes](https://github.com/getsentry/sentry-javascript/releases)
- [Changelog](https://github.com/getsentry/sentry-javascript/blob/develop/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-javascript/compare/7.91.0...7.92.0)

---
updated-dependencies:
- dependency-name: "@sentry/nextjs"
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: sentry
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-04 23:09:14 +00:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
0c8a7e97ba chore(deps): bump core-js from 3.34.0 to 3.35.0 (#815)
Bumps [core-js](https://github.com/zloirock/core-js/tree/HEAD/packages/core-js) from 3.34.0 to 3.35.0.
- [Release notes](https://github.com/zloirock/core-js/releases)
- [Changelog](https://github.com/zloirock/core-js/blob/master/CHANGELOG.md)
- [Commits](https://github.com/zloirock/core-js/commits/v3.35.0/packages/core-js)

---
updated-dependencies:
- dependency-name: core-js
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-04 23:04:30 +00:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
ee39eef953 chore(deps): bump @aws-sdk/client-s3 from 3.478.0 to 3.485.0 (#816)
Bumps [@aws-sdk/client-s3](https://github.com/aws/aws-sdk-js-v3/tree/HEAD/clients/client-s3) from 3.478.0 to 3.485.0.
- [Release notes](https://github.com/aws/aws-sdk-js-v3/releases)
- [Changelog](https://github.com/aws/aws-sdk-js-v3/blob/main/clients/client-s3/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-js-v3/commits/v3.485.0/clients/client-s3)

---
updated-dependencies:
- dependency-name: "@aws-sdk/client-s3"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-04 23:00:11 +00:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
8d10e66744 chore(deps): bump date-fns from 2.30.0 to 3.0.6 (#817)
Bumps [date-fns](https://github.com/date-fns/date-fns) from 2.30.0 to 3.0.6.
- [Release notes](https://github.com/date-fns/date-fns/releases)
- [Changelog](https://github.com/date-fns/date-fns/blob/main/CHANGELOG.md)
- [Commits](https://github.com/date-fns/date-fns/compare/v2.30.0...v3.0.6)

---
updated-dependencies:
- dependency-name: date-fns
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-04 22:55:58 +00:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
92900672c8 chore(deps): bump lucide-react from 0.302.0 to 0.304.0 (#818)
Bumps [lucide-react](https://github.com/lucide-icons/lucide/tree/HEAD/packages/lucide-react) from 0.302.0 to 0.304.0.
- [Release notes](https://github.com/lucide-icons/lucide/releases)
- [Commits](https://github.com/lucide-icons/lucide/commits/0.304.0/packages/lucide-react)

---
updated-dependencies:
- dependency-name: lucide-react
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-04 22:52:04 +00:00
Marc Klingen e59808c1a1 feat(ui): link to github release page from version in logo 2024-01-04 23:43:17 +01:00
704ea7b6ca feat(ui): add toggle to show/hide password on sign in/up form (#796)
---------

Co-authored-by: Marc Klingen <git@marcklingen.com>
2024-01-04 22:15:42 +00:00
Marc Klingen 8aac4dbccf chore: release v1.28.0
CI/CD / push-docker-image (push) Blocked by required conditions
CI/CD / tests (18) (push) Failing after 2m22s
release.yml / release (push) Failing after 3s
CI/CD / tests (20) (push) Failing after 2m14s
CI/CD / e2e-tests (push) Failing after 2m8s
CI/CD / lint (push) Successful in 5m17s
CI/CD / all-ci-passed (push) Waiting to run
2024-01-04 22:44:39 +01:00
Marc Klingen 78676b48a9 fix(ui): margins on observation tree 2024-01-04 22:43:30 +01:00
Marc KlingenandGitHub 0077058241 chore: remove unused dependencies (#813) 2024-01-04 22:33:23 +01:00
Max DeichmannandGitHub 343b4b9ff1 refactor: add indices to models (#812) 2024-01-04 21:19:11 +00:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
b09bc03837 chore(deps): bump the patches group with 8 updates (#811)
Bumps the patches group with 8 updates:

| Package | From | To |
| --- | --- | --- |
| [@emotion/react](https://github.com/emotion-js/emotion) | `11.11.1` | `11.11.3` |
| [@hookform/resolvers](https://github.com/react-hook-form/resolvers) | `3.3.2` | `3.3.4` |
| [@tanstack/react-table](https://github.com/tanstack/table) | `8.11.2` | `8.11.3` |
| [nodemailer](https://github.com/nodemailer/nodemailer) | `6.9.7` | `6.9.8` |
| [@types/eslint](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/eslint) | `8.56.0` | `8.56.1` |
| [@types/react](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react) | `18.2.45` | `18.2.46` |
| [postcss](https://github.com/postcss/postcss) | `8.4.32` | `8.4.33` |
| [prettier-plugin-tailwindcss](https://github.com/tailwindlabs/prettier-plugin-tailwindcss) | `0.5.9` | `0.5.10` |


Updates `@emotion/react` from 11.11.1 to 11.11.3
- [Release notes](https://github.com/emotion-js/emotion/releases)
- [Changelog](https://github.com/emotion-js/emotion/blob/main/CHANGELOG.md)
- [Commits](https://github.com/emotion-js/emotion/compare/@emotion/react@11.11.1...@emotion/react@11.11.3)

Updates `@hookform/resolvers` from 3.3.2 to 3.3.4
- [Release notes](https://github.com/react-hook-form/resolvers/releases)
- [Commits](https://github.com/react-hook-form/resolvers/compare/v3.3.2...v3.3.4)

Updates `@tanstack/react-table` from 8.11.2 to 8.11.3
- [Release notes](https://github.com/tanstack/table/releases)
- [Commits](https://github.com/tanstack/table/compare/v8.11.2...v8.11.3)

Updates `nodemailer` from 6.9.7 to 6.9.8
- [Release notes](https://github.com/nodemailer/nodemailer/releases)
- [Changelog](https://github.com/nodemailer/nodemailer/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nodemailer/nodemailer/compare/v6.9.7...v6.9.8)

Updates `@types/eslint` from 8.56.0 to 8.56.1
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/eslint)

Updates `@types/react` from 18.2.45 to 18.2.46
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react)

Updates `postcss` from 8.4.32 to 8.4.33
- [Release notes](https://github.com/postcss/postcss/releases)
- [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md)
- [Commits](https://github.com/postcss/postcss/compare/8.4.32...8.4.33)

Updates `prettier-plugin-tailwindcss` from 0.5.9 to 0.5.10
- [Release notes](https://github.com/tailwindlabs/prettier-plugin-tailwindcss/releases)
- [Changelog](https://github.com/tailwindlabs/prettier-plugin-tailwindcss/blob/main/CHANGELOG.md)
- [Commits](https://github.com/tailwindlabs/prettier-plugin-tailwindcss/compare/v0.5.9...v0.5.10)

---
updated-dependencies:
- dependency-name: "@emotion/react"
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: patches
- dependency-name: "@hookform/resolvers"
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: patches
- dependency-name: "@tanstack/react-table"
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: patches
- dependency-name: nodemailer
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: patches
- dependency-name: "@types/eslint"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: patches
- dependency-name: "@types/react"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: patches
- dependency-name: postcss
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: patches
- dependency-name: prettier-plugin-tailwindcss
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: patches
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-04 21:14:28 +00:00
Marc KlingenandGitHub b83e285a87 chore: remove unused axios dependency (#810) 2024-01-04 22:05:19 +01:00
Marc KlingenandGitHub 40fcede095 feat(ui): show/hide metrics and scores on observation tree (#809) 2024-01-04 20:49:40 +00:00
Max DeichmannandGitHub 1ef3c7d328 security: bump axios and remove follow-redirects (#805)
bump axios
2024-01-04 11:35:39 +00:00
Marc KlingenandGitHub 30ebbf96f7 feat(ui): navigate between traces of a session with prev/next btn (#804) 2024-01-04 11:09:46 +00:00
Marc KlingenandGitHub 2c6a3c31c1 fix: typos 2024-01-04 09:16:50 +01:00
Max Deichmann 4a4fa811a2 chore: release v1.27.3
CI/CD / push-docker-image (push) Blocked by required conditions
CI/CD / tests (20) (push) Failing after 2m7s
release.yml / release (push) Failing after 2s
CI/CD / tests (18) (push) Failing after 2m37s
CI/CD / e2e-tests (push) Failing after 2m1s
CI/CD / lint (push) Successful in 5m19s
CI/CD / all-ci-passed (push) Waiting to run
2024-01-03 23:48:20 +01:00
Max DeichmannandGitHub 381ef1d690 fix: performance improvements on traces table (#802) 2024-01-03 22:45:55 +00:00
Max Deichmann 47686034a1 chore: release v1.27.2
CI/CD / push-docker-image (push) Blocked by required conditions
CI/CD / tests (20) (push) Failing after 2m1s
release.yml / release (push) Failing after 2s
CI/CD / tests (18) (push) Failing after 2m37s
CI/CD / e2e-tests (push) Failing after 1m59s
CI/CD / lint (push) Successful in 5m29s
CI/CD / all-ci-passed (push) Waiting to run
2024-01-03 23:00:00 +01:00
Max DeichmannandGitHub 7258cfdba5 refactor(api): query scores individually (#800) 2024-01-03 17:02:51 +00:00
Max Deichmann 87611fc4f8 chore: release v1.27.1
CI/CD / push-docker-image (push) Blocked by required conditions
CI/CD / tests (20) (push) Failing after 1m58s
release.yml / release (push) Failing after 3s
CI/CD / tests (18) (push) Failing after 2m42s
CI/CD / e2e-tests (push) Failing after 2m9s
CI/CD / lint (push) Successful in 5m23s
CI/CD / all-ci-passed (push) Waiting to run
2024-01-03 15:48:38 +01:00
3886821091 fix(api): pricing for gpt-3.5-turbo-1106 and gpt-3.5-turbo-instruct (#780)
Co-authored-by: Max Deichmann <m.deichmann@tum.de>
2024-01-03 14:45:42 +00:00
Max DeichmannandGitHub 523ec0dd1f refactor: reduce sentry sample rate (#798)
sample
2024-01-03 13:37:41 +00:00
Marc Klingen 071becb796 chore: release v1.27.0
CI/CD / push-docker-image (push) Blocked by required conditions
CI/CD / tests (20) (push) Failing after 1m59s
CI/CD / tests (18) (push) Failing after 2m29s
release.yml / release (push) Failing after 2s
CI/CD / e2e-tests (push) Failing after 2m0s
CI/CD / lint (push) Successful in 5m26s
CI/CD / all-ci-passed (push) Waiting to run
2024-01-02 19:56:50 +01:00
Yash KhareandGitHub 2fe920bbba bug(ui): close sidebar after click on mobile (#788) 2024-01-02 17:46:33 +01:00
Marc Klingen 509dc92539 refactor(ui): use CodeView for prompt rendering 2024-01-02 16:18:38 +01:00
1116783587 feat(ui, api): Add Ordering functionality to traces (#750)
Co-authored-by: Max Deichmann <m.deichmann@tum.de>
2024-01-02 15:00:07 +01:00
Marc Klingen 5b3e8bd9d1 chore: release v1.26.0
CI/CD / push-docker-image (push) Blocked by required conditions
CI/CD / tests (20) (push) Failing after 2m3s
CI/CD / tests (18) (push) Failing after 2m41s
CI/CD / e2e-tests (push) Failing after 2m15s
release.yml / release (push) Failing after 3s
CI/CD / lint (push) Successful in 5m27s
CI/CD / all-ci-passed (push) Waiting to run
2024-01-02 14:51:58 +01:00
Marc KlingenandGitHub daa3292814 fix(ui): show linebreaks in prompts (#794) 2024-01-02 14:45:18 +01:00
Max DeichmannandGitHub 6abea1a028 refactor: upgrade follow-redirects library (#793)
upgrade follow-redirects
2024-01-02 12:47:42 +00:00
Marc KlingenandGitHub 660a238731 feat(api): return langfuse version on /health (#792)
Fixes #787
2024-01-02 10:16:44 +00:00
Marc Klingen 1c24604228 feat(cloud): link to langfuse.com/pricing in settings 2024-01-02 10:48:25 +01:00
Max Deichmann ba50a6f45d chore: release v1.25.0
CI/CD / push-docker-image (push) Blocked by required conditions
CI/CD / e2e-tests (push) Failing after 1m58s
CI/CD / tests (18) (push) Failing after 2m24s
CI/CD / tests (20) (push) Failing after 2m14s
release.yml / release (push) Failing after 3s
CI/CD / lint (push) Successful in 5m39s
CI/CD / all-ci-passed (push) Waiting to run
2023-12-31 14:51:14 +01:00
Marc KlingenandGitHub b65b055630 fix(rbac): add/fix rbac scopes for prompt mgmt (#786) 2023-12-31 14:05:13 +01:00
Marc Klingen c7c72efeac fix(rbac): VIEWER has access to prompts:read 2023-12-31 14:04:31 +01:00
Marc KlingenandGitHub 6489d2f27e feat(rbac): hide features in main menu based on rbac scopes (#785) 2023-12-31 13:01:40 +00:00
Marc KlingenandGitHub 2d8a239d6d feat(ui): ui improvements of prompt mgmt (#784) 2023-12-31 12:46:20 +00:00
Max DeichmannandGitHub 71a1f81b4d feat: allow fetching specific prompt version (#781) 2023-12-30 16:46:54 +00:00
Max DeichmannandGitHub 8574d028c0 feat: prompt management (#777) 2023-12-30 17:28:19 +01:00
Marc Klingen 0be0628d33 docs: Contributing.md 2023-12-28 18:44:28 +01:00
782e119add fix(UI): username and logo goes down as no. of projects increases (#759)
Co-authored-by: Max Deichmann <m.deichmann@tum.de>
2023-12-28 11:11:10 +01:00
Max DeichmannandGitHub 9079ffcdb1 refactor: upgrade axios (#771)
upgrade
2023-12-27 18:09:18 +00:00
Marc Klingen a7c1ad1b0d chore: release v1.24.2
CI/CD / push-docker-image (push) Blocked by required conditions
CI/CD / tests (18) (push) Failing after 2m27s
CI/CD / tests (20) (push) Failing after 2m20s
CI/CD / e2e-tests (push) Failing after 2m12s
release.yml / release (push) Failing after 3s
CI/CD / lint (push) Successful in 5m15s
CI/CD / all-ci-passed (push) Waiting to run
2023-12-27 16:00:11 +01:00
Marc Klingen 091757973f feat(ui): display id in tooltip on table link 2023-12-27 15:59:08 +01:00
Marc Klingen 762ac24f47 feat(ui): improve compact data tables 2023-12-27 15:52:20 +01:00
Marc Klingen 6f8ac2b796 chore: improve tailwind class 2023-12-27 15:52:00 +01:00
Marc Klingen 5157b3f599 feat(ui): extend openai message schema
* content json
* name
2023-12-27 15:32:07 +01:00
Marc Klingen 760879a183 feat(ui): less table padding 2023-12-27 12:42:07 +01:00
Marc Klingen 63e3dda268 fix: more test ids on wrong forms 2023-12-27 09:50:20 +01:00
Marc Klingen 284d38f3c3 fix: test ids on wrong forms 2023-12-27 09:50:03 +01:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
cc72964343 chore(deps-dev): bump @typescript-eslint/parser from 6.15.0 to 6.16.0 (#763)
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 6.15.0 to 6.16.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.16.0/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-26 22:58:02 +00:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
de4984cef6 chore(deps-dev): bump @typescript-eslint/eslint-plugin from 6.15.0 to 6.16.0 (#764)
chore(deps-dev): bump @typescript-eslint/eslint-plugin

Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 6.15.0 to 6.16.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.16.0/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-26 22:54:05 +00:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
dba56de614 chore(deps): bump lucide-react from 0.300.0 to 0.302.0 (#765)
Bumps [lucide-react](https://github.com/lucide-icons/lucide/tree/HEAD/packages/lucide-react) from 0.300.0 to 0.302.0.
- [Release notes](https://github.com/lucide-icons/lucide/releases)
- [Commits](https://github.com/lucide-icons/lucide/commits/0.302.0/packages/lucide-react)

---
updated-dependencies:
- dependency-name: lucide-react
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-26 22:50:04 +00:00
Max DeichmannandGitHub bb102ba986 refactoring(ui): upgrade shadcn components (#767) 2023-12-26 16:23:03 +01:00
Marc Klingen 199bbcd6ae docs: add note regarding authentication to the openapi spec 2023-12-24 13:31:31 +01:00
Marc Klingen c8ee036dd2 chore: release v1.24.1
CI/CD / push-docker-image (push) Blocked by required conditions
CI/CD / tests (18) (push) Failing after 2m15s
CI/CD / tests (20) (push) Failing after 2m18s
release.yml / release (push) Failing after 3s
CI/CD / e2e-tests (push) Failing after 1m59s
CI/CD / lint (push) Successful in 5m30s
CI/CD / all-ci-passed (push) Waiting to run
2023-12-24 05:26:45 +01:00
Marc KlingenandGitHub dfff42074d fix(ui): add missing array polyfills for better browser compatibility (#757)
- Fixes #653
- methods: .toReversed, .toSorted, .toSpliced
- Fix until they are included in next-core: https://github.com/vercel/next.js/issues/58242
2023-12-24 04:23:26 +00:00
Marc Klingen 565893307e chore: release v1.24.0
CI/CD / push-docker-image (push) Blocked by required conditions
CI/CD / tests (18) (push) Failing after 41s
CI/CD / tests (20) (push) Failing after 44s
CI/CD / e2e-tests (push) Failing after 35s
release.yml / release (push) Failing after 3s
CI/CD / lint (push) Successful in 3m58s
CI/CD / all-ci-passed (push) Waiting to run
2023-12-24 03:35:53 +01:00
Marc KlingenandGitHub ff32270464 feat(auth): add AzureAD (#396) 2023-12-24 03:28:13 +01:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
98a91830f2 chore(deps): bump the sentry group with 1 update (#748)
Bumps the sentry group with 1 update: [@sentry/nextjs](https://github.com/getsentry/sentry-javascript).


Updates `@sentry/nextjs` from 7.90.0 to 7.91.0
- [Release notes](https://github.com/getsentry/sentry-javascript/releases)
- [Changelog](https://github.com/getsentry/sentry-javascript/blob/develop/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-javascript/compare/7.90.0...7.91.0)

---
updated-dependencies:
- dependency-name: "@sentry/nextjs"
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: sentry
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-24 00:52:04 +00:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
f72707ead5 chore(deps): bump lucide-react from 0.299.0 to 0.300.0 (#749)
Bumps [lucide-react](https://github.com/lucide-icons/lucide/tree/HEAD/packages/lucide-react) from 0.299.0 to 0.300.0.
- [Release notes](https://github.com/lucide-icons/lucide/releases)
- [Commits](https://github.com/lucide-icons/lucide/commits/0.300.0/packages/lucide-react)

---
updated-dependencies:
- dependency-name: lucide-react
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-24 01:47:03 +01:00
Marc KlingenandGitHub 963cf945cb feat(cloud): display custom plan limits in project settings (#756) 2023-12-24 01:41:21 +01:00
Marc Klingen d5aa809ff9 chore: release v1.23.0
CI/CD / push-docker-image (push) Blocked by required conditions
CI/CD / tests (18) (push) Failing after 40s
CI/CD / tests (20) (push) Failing after 34s
CI/CD / e2e-tests (push) Failing after 37s
CI/CD / lint (push) Successful in 3m58s
CI/CD / all-ci-passed (push) Waiting to run
release.yml / release (push) Failing after 3s
2023-12-22 19:36:57 +01:00
1dd9a0e04e feat(ui): display host name on project settings page (#746)
* feat(ui): added hostName on the settings page

* simplify component

---------

Co-authored-by: Marc Klingen <git@marcklingen.com>
2023-12-22 18:35:58 +00:00
Marc KlingenandGitHub dbf16ba433 feat(ui): use native <a/> in tables to support middle click / open in new window (#747)
Fixes #744
2023-12-22 18:28:58 +00:00
Max DeichmannandGitHub d421c1e106 fix: add openai model for auto tokenisation (#745) 2023-12-22 17:37:25 +00:00
Marc Klingen 50cf25d949 chore: release v1.22.0
CI/CD / push-docker-image (push) Blocked by required conditions
CI/CD / tests (18) (push) Failing after 49s
CI/CD / tests (20) (push) Failing after 42s
CI/CD / e2e-tests (push) Failing after 38s
CI/CD / lint (push) Successful in 3m57s
CI/CD / all-ci-passed (push) Waiting to run
release.yml / release (push) Failing after 2s
2023-12-22 12:37:32 +01:00
Marc Klingen 1aeec5329e chore: pr/issue comments on new releases 2023-12-22 12:37:03 +01:00
Marc KlingenandGitHub 80120b0455 feat(docker): optionally set SHADOW_DATABASE_URL (#743)
Fixes #738
2023-12-22 12:10:28 +01:00
Marc Klingen 3f5ee4664a feat(ui): display current application version 2023-12-22 07:46:06 +01:00
Marc Klingen 659003d8e2 chore: release v1.21.0
CI/CD / push-docker-image (push) Blocked by required conditions
CI/CD / tests (18) (push) Failing after 38s
CI/CD / e2e-tests (push) Failing after 34s
CI/CD / tests (20) (push) Failing after 43s
CI/CD / lint (push) Successful in 3m58s
CI/CD / all-ci-passed (push) Waiting to run
release.yml / release (push) Failing after 2s
2023-12-22 07:36:41 +01:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2f48b4b33e chore(deps): bump lucide-react from 0.298.0 to 0.299.0 (#740)
Bumps [lucide-react](https://github.com/lucide-icons/lucide/tree/HEAD/packages/lucide-react) from 0.298.0 to 0.299.0.
- [Release notes](https://github.com/lucide-icons/lucide/releases)
- [Commits](https://github.com/lucide-icons/lucide/commits/0.299.0/packages/lucide-react)

---
updated-dependencies:
- dependency-name: lucide-react
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-22 06:28:03 +00:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
1830e0285a chore(deps): bump tailwind-merge from 2.1.0 to 2.2.0 (#741)
Bumps [tailwind-merge](https://github.com/dcastil/tailwind-merge) from 2.1.0 to 2.2.0.
- [Release notes](https://github.com/dcastil/tailwind-merge/releases)
- [Commits](https://github.com/dcastil/tailwind-merge/compare/v2.1.0...v2.2.0)

---
updated-dependencies:
- dependency-name: tailwind-merge
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-22 06:24:08 +00:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
d31b8ebc8b chore(deps): bump @tanstack/react-table from 8.10.7 to 8.11.2 (#742)
Bumps [@tanstack/react-table](https://github.com/tanstack/table) from 8.10.7 to 8.11.2.
- [Release notes](https://github.com/tanstack/table/releases)
- [Commits](https://github.com/tanstack/table/compare/v8.10.7...v8.11.2)

---
updated-dependencies:
- dependency-name: "@tanstack/react-table"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-22 07:18:03 +01:00
Marc Klingen acb431e77f docs: add infra chart to contributing 2023-12-21 22:56:27 +01:00
Marc Klingen bfd3665d70 docs: more details on used technologies 2023-12-21 21:41:28 +01:00
Marc Klingen a181eb13f5 docs: improve architecture overview 2023-12-21 21:12:10 +01:00
Marc KlingenandGitHub 43dd396a64 feat(docker): optionally set DIRECT_URL (#739)
Helpful to run migrations using a direct db connection when using pgbouncer on DATABASE_URL
2023-12-21 19:27:55 +01:00
Marc KlingenandGitHub 921d4fa1d3 feat: optionally use S3 for data exports (#735) 2023-12-21 17:46:52 +00:00
Max Deichmann 91aec645ba chore: release v1.20.0
CI/CD / push-docker-image (push) Blocked by required conditions
CI/CD / tests (20) (push) Failing after 35s
CI/CD / tests (18) (push) Failing after 46s
CI/CD / e2e-tests (push) Failing after 37s
release.yml / release (push) Failing after 3s
CI/CD / lint (push) Successful in 3m50s
CI/CD / all-ci-passed (push) Waiting to run
2023-12-21 16:38:32 +01:00
Max Deichmann c209e338d4 fix: add object to api docs 2023-12-21 16:38:12 +01:00
Max DeichmannandGitHub 0ba3e4f9e1 feat: add sdk log event to ingestion API (#737) 2023-12-21 14:55:08 +00:00
Marc Klingen 253b0cc38b Revert "fix(cloud): no response limit for trpc routes"
This reverts commit 8d6b57ec21.
2023-12-21 04:47:28 +01:00
dependabot[bot]andGitHub 8c7c7a34e5 chore(deps-dev): bump @typescript-eslint/eslint-plugin from 6.14.0 to 6.15.0 (#723) 2023-12-21 02:11:33 +00:00
Marc Klingen 8d6b57ec21 fix(cloud): no response limit for trpc routes
Fixes production bug of failing exports with responses > 4MB
2023-12-21 03:04:18 +01:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
8994a9c663 chore(deps): bump the sentry group with 1 update (#730)
Bumps the sentry group with 1 update: [@sentry/nextjs](https://github.com/getsentry/sentry-javascript).


Updates `@sentry/nextjs` from 7.88.0 to 7.90.0
- [Release notes](https://github.com/getsentry/sentry-javascript/releases)
- [Changelog](https://github.com/getsentry/sentry-javascript/blob/develop/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-javascript/compare/7.88.0...7.90.0)

---
updated-dependencies:
- dependency-name: "@sentry/nextjs"
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: sentry
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-21 01:00:19 +00:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
c048372928 chore(deps-dev): bump @types/eslint from 8.44.9 to 8.56.0 (#731)
Bumps [@types/eslint](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/eslint) from 8.44.9 to 8.56.0.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/eslint)

---
updated-dependencies:
- dependency-name: "@types/eslint"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-21 00:56:05 +00:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
0271582c0d chore(deps-dev): bump tailwindcss from 3.3.6 to 3.4.0 (#733)
Bumps [tailwindcss](https://github.com/tailwindlabs/tailwindcss) from 3.3.6 to 3.4.0.
- [Release notes](https://github.com/tailwindlabs/tailwindcss/releases)
- [Changelog](https://github.com/tailwindlabs/tailwindcss/blob/master/CHANGELOG.md)
- [Commits](https://github.com/tailwindlabs/tailwindcss/compare/v3.3.6...v3.4.0)

---
updated-dependencies:
- dependency-name: tailwindcss
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-21 01:51:49 +01:00
Marc KlingenandGitHub a4b71e0805 fix: remove console log 2023-12-20 14:33:01 +01:00
Max DeichmannandGitHub 66ac595850 style: add comment on filter state (#729) 2023-12-20 13:16:15 +00:00
Max Deichmann d4f037f2a5 chore: release v1.19.4
CI/CD / push-docker-image (push) Blocked by required conditions
CI/CD / tests (20) (push) Failing after 1m0s
CI/CD / tests (18) (push) Failing after 1m15s
release.yml / release (push) Failing after 3s
CI/CD / e2e-tests (push) Failing after 1m0s
CI/CD / lint (push) Successful in 4m15s
CI/CD / all-ci-passed (push) Waiting to run
2023-12-20 13:53:32 +01:00
Max Deichmann c1fe9e0ace fix table filter 2023-12-20 13:46:48 +01:00
dependabot[bot]andGitHub a8a108e3fd chore(deps): bump the prisma group with 2 updates (#720) 2023-12-20 01:41:11 +00:00
dependabot[bot]andGitHub 0d1c6bb062 chore(deps-dev): bump @typescript-eslint/parser from 6.14.0 to 6.15.0 (#722) 2023-12-20 01:36:53 +00:00
dependabot[bot]andGitHub 071ec219ce chore(deps): bump @heroicons/react from 2.0.18 to 2.1.1 (#724) 2023-12-20 01:32:41 +00:00
dependabot[bot]andGitHub 626eab5258 chore(deps): bump the patches group with 1 update (#727) 2023-12-20 02:28:06 +01:00
Max Deichmann f683678224 chore: release v1.19.3
CI/CD / push-docker-image (push) Blocked by required conditions
CI/CD / tests (18) (push) Failing after 1m10s
release.yml / release (push) Failing after 2s
CI/CD / tests (20) (push) Failing after 1m5s
CI/CD / e2e-tests (push) Failing after 1m0s
CI/CD / lint (push) Successful in 4m12s
CI/CD / all-ci-passed (push) Waiting to run
2023-12-19 13:13:49 +01:00
Max DeichmannandGitHub 2d88bdb27f fix: remove log (#726) 2023-12-19 12:11:32 +00:00
Max DeichmannandGitHub 0b9481b7c4 feat: add cost column to generations table (#725) 2023-12-19 11:55:21 +00:00
Max Deichmann 603bd2a740 chore: release v1.19.2
CI/CD / push-docker-image (push) Blocked by required conditions
CI/CD / tests (18) (push) Failing after 1m7s
release.yml / release (push) Failing after 3s
CI/CD / tests (20) (push) Failing after 1m0s
CI/CD / e2e-tests (push) Failing after 59s
CI/CD / lint (push) Successful in 4m13s
CI/CD / all-ci-passed (push) Waiting to run
2023-12-18 17:09:57 +01:00
Max DeichmannandGitHub 576b7387be fix: downgrade tremor react (#718) 2023-12-18 16:09:00 +00:00
Marc Klingen e6662a9b18 chore: release v1.19.1
CI/CD / push-docker-image (push) Blocked by required conditions
CI/CD / tests (20) (push) Failing after 1m0s
CI/CD / tests (18) (push) Failing after 1m9s
release.yml / release (push) Failing after 2s
CI/CD / e2e-tests (push) Failing after 1m5s
CI/CD / lint (push) Successful in 4m12s
CI/CD / all-ci-passed (push) Waiting to run
2023-12-18 09:26:37 +01:00
Marc Klingen f2d2234c51 feat(ui): remove beta label from sessions 2023-12-18 09:26:14 +01:00
Max DeichmannandGitHub 24f20bd54f refactor: remove logs (#715)
remove logs
2023-12-18 07:56:56 +00:00
Marc KlingenandGitHub bd6821347f chore(deps): bump deps (#709) 2023-12-17 23:29:11 +00:00
Marc Klingen 15d4f5b262 chore: release v1.19.0
CI/CD / push-docker-image (push) Blocked by required conditions
CI/CD / tests (18) (push) Failing after 1m10s
CI/CD / tests (20) (push) Failing after 1m5s
release.yml / release (push) Failing after 3s
CI/CD / e2e-tests (push) Failing after 1m0s
CI/CD / lint (push) Successful in 4m13s
CI/CD / all-ci-passed (push) Waiting to run
2023-12-18 00:06:26 +01:00
Marc Klingen eb2c1fc9fe feat(analytics): add trace deletions events 2023-12-18 00:02:30 +01:00
b00e473e40 feat(ui): Multi select deletion on trace table (#580)
---------

Co-authored-by: Marc Klingen <git@marcklingen.com>
2023-12-17 23:50:29 +01:00
Felix WuandGitHub b70d554756 fix(db): use utc time in prisma datetime filter (#708) 2023-12-17 21:09:32 +00:00
Marc Klingen 50d3fbfaf5 Revert "feat: tag legacy endpoints in events table"
This reverts commit 01bce79e6f.
2023-12-17 21:54:19 +01:00
Marc Klingen 1fb58ea9fa chore(deps): revert to tremor 3.11.1 to fix license warnings 2023-12-17 21:23:29 +01:00
Marc Klingen 01bce79e6f feat: tag legacy endpoints in events table 2023-12-17 21:07:51 +01:00
Felix WuandGitHub 0b4388107e feat(ui): search tables upon hitting enter (#704) 2023-12-17 20:52:37 +01:00
Marc KlingenandGitHub d8ef8aa560 refactor: add strict-type-checked lint rule and clean up types (#706) 2023-12-17 20:44:05 +01:00
Felix WuandGitHub 373f6de51e docs: fix Contributing guide link (#705) 2023-12-17 20:02:24 +01:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
58e87f57ec chore(deps-dev): bump eslint from 8.55.0 to 8.56.0 (#702)
Bumps [eslint](https://github.com/eslint/eslint) from 8.55.0 to 8.56.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v8.55.0...v8.56.0)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-17 16:23:04 +01:00
Marc Klingen 63ed992ef6 ci: add merge_group trigger 2023-12-17 16:02:26 +01:00
Max DeichmannandGitHub 977f006a74 feat: add metadata to ingestion api (#703)
add metadata to ingestion api
2023-12-17 15:26:36 +01:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
f81fe96997 chore(deps): bump @tremor/react from 3.11.1 to 3.12.0 (#693)
Bumps [@tremor/react](https://github.com/tremorlabs/tremor) from 3.11.1 to 3.12.0.
- [Release notes](https://github.com/tremorlabs/tremor/releases)
- [Commits](https://github.com/tremorlabs/tremor/compare/v3.11.1...v3.12.0)

---
updated-dependencies:
- dependency-name: "@tremor/react"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-16 04:48:07 +00:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
d77b4a09e6 chore(deps-dev): bump the patches group with 1 update (#700)
Bumps the patches group with 1 update: [@types/react-dom](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react-dom).

- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react-dom)

---
updated-dependencies:
- dependency-name: "@types/react-dom"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: patches
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-16 04:44:03 +00:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
86ab1a0cf3 chore(deps): bump the sentry group with 1 update (#701)
Bumps the sentry group with 1 update: [@sentry/nextjs](https://github.com/getsentry/sentry-javascript).

- [Release notes](https://github.com/getsentry/sentry-javascript/releases)
- [Changelog](https://github.com/getsentry/sentry-javascript/blob/develop/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-javascript/compare/7.87.0...7.88.0)

---
updated-dependencies:
- dependency-name: "@sentry/nextjs"
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: sentry
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-16 04:34:51 +00:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
b3139ae853 chore(deps): bump @sentry/types from 7.87.0 to 7.88.0 (#695)
Bumps [@sentry/types](https://github.com/getsentry/sentry-javascript) from 7.87.0 to 7.88.0.
- [Release notes](https://github.com/getsentry/sentry-javascript/releases)
- [Changelog](https://github.com/getsentry/sentry-javascript/blob/develop/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-javascript/compare/7.87.0...7.88.0)

---
updated-dependencies:
- dependency-name: "@sentry/types"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-16 04:30:40 +00:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
c9c0a4c207 chore(deps): bump posthog-js from 1.94.2 to 1.96.1 (#698)
Bumps [posthog-js](https://github.com/PostHog/posthog-js) from 1.94.2 to 1.96.1.
- [Release notes](https://github.com/PostHog/posthog-js/releases)
- [Changelog](https://github.com/PostHog/posthog-js/blob/master/CHANGELOG.md)
- [Commits](https://github.com/PostHog/posthog-js/compare/v1.94.2...v1.96.1)

---
updated-dependencies:
- dependency-name: posthog-js
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-16 04:26:11 +00:00
Marc Klingen ead12b3838 chore: dependabot fix sentry group 2023-12-16 05:22:10 +01:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2849954f71 chore(deps): bump lucide-react from 0.295.0 to 0.297.0 (#699)
Bumps [lucide-react](https://github.com/lucide-icons/lucide/tree/HEAD/packages/lucide-react) from 0.295.0 to 0.297.0.
- [Release notes](https://github.com/lucide-icons/lucide/releases)
- [Commits](https://github.com/lucide-icons/lucide/commits/0.297.0/packages/lucide-react)

---
updated-dependencies:
- dependency-name: lucide-react
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-16 05:20:40 +01:00
Max Deichmann 06305385f7 chore: release v1.18.1
CI/CD / push-docker-image (push) Blocked by required conditions
CI/CD / tests (18) (push) Failing after 1m7s
CI/CD / tests (20) (push) Failing after 1m6s
CI/CD / e2e-tests (push) Failing after 1m1s
CI/CD / lint (push) Successful in 4m14s
CI/CD / all-ci-passed (push) Waiting to run
release.yml / release (push) Failing after 3s
2023-12-15 11:34:11 +01:00
Max DeichmannandGitHub e25c29e654 fix(api): handle empty usage object gracefully (#696) 2023-12-15 10:33:35 +00:00
Max Deichmann 1a037e84e6 chore: release v1.18.0
CI/CD / push-docker-image (push) Blocked by required conditions
CI/CD / tests (18) (push) Failing after 1m10s
CI/CD / tests (20) (push) Failing after 1m7s
CI/CD / e2e-tests (push) Failing after 1m1s
CI/CD / lint (push) Successful in 4m13s
CI/CD / all-ci-passed (push) Waiting to run
release.yml / release (push) Failing after 3s
2023-12-15 10:20:26 +01:00
Max DeichmannandGitHub 45f091eeee feat(api): support v2 SDKs (#644) (#656) 2023-12-15 09:06:36 +00:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
41a9e4f38c chore(deps): bump lucide-react from 0.294.0 to 0.295.0 (#689)
Bumps [lucide-react](https://github.com/lucide-icons/lucide/tree/HEAD/packages/lucide-react) from 0.294.0 to 0.295.0.
- [Release notes](https://github.com/lucide-icons/lucide/releases)
- [Commits](https://github.com/lucide-icons/lucide/commits/0.295.0/packages/lucide-react)

---
updated-dependencies:
- dependency-name: lucide-react
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-14 23:01:48 +00:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
b50c7e4e80 chore(deps-dev): bump @typescript-eslint/parser from 6.13.2 to 6.14.0 (#681)
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 6.13.2 to 6.14.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.14.0/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-14 01:18:38 +00:00
74fbdac607 fix: upgrade sentry (#687)
* upgrade

* add sentry as a dependabto group

* add @sentry/types

---------

Co-authored-by: Marc Klingen <git@marcklingen.com>
2023-12-14 02:13:24 +01:00
Marc Klingen f86d24669e chore: release v1.17.3
CI/CD / push-docker-image (push) Blocked by required conditions
CI/CD / tests (18) (push) Failing after 1m6s
CI/CD / tests (20) (push) Failing after 1m8s
CI/CD / e2e-tests (push) Failing after 1m1s
CI/CD / lint (push) Successful in 4m15s
CI/CD / all-ci-passed (push) Waiting to run
release.yml / release (push) Failing after 2s
2023-12-14 01:38:44 +01:00
Marc Klingen 9cb9e64aba fix(ui): no pretty obervation rendering if other properties exist 2023-12-14 01:37:58 +01:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
5866048be8 chore(deps): bump the patches group with 3 updates (#688)
Bumps the patches group with 3 updates: [react-hook-form](https://github.com/react-hook-form/react-hook-form), [@types/eslint](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/eslint) and [@types/react](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react).


Updates `react-hook-form` from 7.49.0 to 7.49.2
- [Release notes](https://github.com/react-hook-form/react-hook-form/releases)
- [Changelog](https://github.com/react-hook-form/react-hook-form/blob/master/CHANGELOG.md)
- [Commits](https://github.com/react-hook-form/react-hook-form/compare/v7.49.0...v7.49.2)

Updates `@types/eslint` from 8.44.8 to 8.44.9
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/eslint)

Updates `@types/react` from 18.2.43 to 18.2.45
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react)

---
updated-dependencies:
- dependency-name: react-hook-form
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: patches
- dependency-name: "@types/eslint"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: patches
- dependency-name: "@types/react"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: patches
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-14 00:35:04 +00:00
Marc Klingen b18e75d5a4 fix(ui): scroll on single trace view 2023-12-14 01:22:09 +01:00
Marc Klingen 0e433b5f5c feat: improve display of time intervals 2023-12-13 19:37:46 +01:00
Marc Klingen 6274cc442d chore: release v1.17.2
CI/CD / push-docker-image (push) Blocked by required conditions
CI/CD / tests (18) (push) Failing after 1m12s
CI/CD / tests (20) (push) Failing after 1m7s
CI/CD / e2e-tests (push) Failing after 1m2s
CI/CD / lint (push) Successful in 4m14s
CI/CD / all-ci-passed (push) Waiting to run
release.yml / release (push) Failing after 2s
2023-12-13 12:19:49 +01:00
Marc Klingen f2e468893f fix(ui): trpc error sessions.all if no userid 2023-12-13 12:14:53 +01:00
Marc Klingen f3817a4aa7 chore: remove unused searchQuery 2023-12-13 12:13:47 +01:00
Marc KlingenandGitHub cb99998c53 chore: remove unused export (#684) 2023-12-13 10:44:03 +00:00
Max Deichmann f6a6f99954 chore: release v1.17.1
CI/CD / push-docker-image (push) Blocked by required conditions
CI/CD / tests (18) (push) Failing after 1m10s
CI/CD / tests (20) (push) Failing after 1m7s
CI/CD / e2e-tests (push) Failing after 1m3s
CI/CD / lint (push) Successful in 4m16s
CI/CD / all-ci-passed (push) Waiting to run
release.yml / release (push) Failing after 3s
2023-12-13 10:44:52 +01:00
Max DeichmannandGitHub 248bd1ea88 fix(api): add logging to sessions router (#683) 2023-12-13 09:40:51 +00:00
Marc Klingen 13a79c4206 chore: release v1.17.0
CI/CD / push-docker-image (push) Blocked by required conditions
CI/CD / tests (18) (push) Failing after 1m9s
CI/CD / tests (20) (push) Failing after 1m0s
CI/CD / e2e-tests (push) Failing after 1m2s
CI/CD / lint (push) Successful in 4m15s
CI/CD / all-ci-passed (push) Waiting to run
release.yml / release (push) Failing after 3s
2023-12-13 03:25:45 +01:00
Marc Klingen 425e3ca0e4 fix: session filters 2023-12-13 03:21:59 +01:00
Marc Klingen d1c4eff4fc fix(ui): sessionduration in seconds 2023-12-13 02:17:42 +01:00
Marc KlingenandGitHub e6bd4e926d feat(ui): in-app help popups re sessions (#678) 2023-12-12 20:06:44 +00:00
Marc KlingenandGitHub 35422e9793 feat(ui): show score comments on hover across ui (#677)
* refactor: tooltip provider in _app

* feat(ui): show score comments on hover across ui
2023-12-12 19:42:18 +00:00
Marc Klingen e106fef923 feat(cloud): include link to chatbot demo in staging 2023-12-12 19:40:14 +01:00
Max DeichmannandGitHub 41ef404699 fix(logging): remove log from trpc router (#675)
remove log
2023-12-12 15:20:39 +00:00
Marc KlingenandGitHub 45e31c0b3f docs: update SECURITY.md 2023-12-12 16:12:14 +01:00
Max DeichmannandGitHub 0df4c97819 fix(fern): fix python generator (#674) 2023-12-12 15:52:22 +01:00
Max DeichmannandGitHub 77b448a7f7 feat(docs): architecture overview added to contributing file (#673) 2023-12-12 14:41:23 +00:00
Marc KlingenandGitHub 4e520f7e52 feat: add sessions and i/o on traces (#588) 2023-12-12 14:27:57 +00:00
Marc Klingen df0f01eae2 chore: release v1.16.0
CI/CD / push-docker-image (push) Blocked by required conditions
CI/CD / tests (18) (push) Failing after 1m16s
CI/CD / e2e-tests (push) Failing after 1m2s
CI/CD / tests (20) (push) Failing after 1m5s
CI/CD / lint (push) Successful in 4m15s
CI/CD / all-ci-passed (push) Waiting to run
release.yml / release (push) Failing after 3s
2023-12-12 14:55:26 +01:00
Marc KlingenandGitHub 82626a0d57 feat: improve project renaming (#670) 2023-12-12 13:36:03 +00:00
Marc KlingenandGitHub 0c36c4166f feat(security): add x-frame-options header (#669) 2023-12-12 13:20:00 +00:00
Max DeichmannandGitHub 57c6bcd5bb fix(ui): pretty project settings UI (#667) 2023-12-12 11:25:25 +00:00
16d8665cd2 feat: rename project (#613) (#666)
Co-authored-by: Adrian Stobbe <stobbe.adrian@gmail.com>
Co-authored-by: Marc Klingen <git@marcklingen.com>
2023-12-12 12:20:21 +01:00
Max Deichmann 34373dc841 chore: release v1.15.1
CI/CD / push-docker-image (push) Blocked by required conditions
CI/CD / tests (18) (push) Failing after 1m8s
CI/CD / tests (20) (push) Failing after 1m1s
CI/CD / e2e-tests (push) Failing after 1m6s
CI/CD / lint (push) Successful in 4m28s
CI/CD / all-ci-passed (push) Waiting to run
release.yml / release (push) Failing after 3s
2023-12-12 09:59:58 +01:00
Max DeichmannandGitHub 8410315920 fix(api): remove middleware (#665) 2023-12-12 09:59:11 +01:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
78db8d339a chore(deps-dev): bump the patches group with 2 updates (#659)
Bumps the patches group with 2 updates: [@types/react](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react) and [prettier](https://github.com/prettier/prettier).


Updates `@types/react` from 18.2.42 to 18.2.43
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react)

Updates `prettier` from 3.1.0 to 3.1.1
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/3.1.0...3.1.1)

---
updated-dependencies:
- dependency-name: "@types/react"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: patches
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: patches
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-11 22:54:19 +00:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
39cd086024 chore(deps-dev): bump @typescript-eslint/eslint-plugin from 6.13.2 to 6.14.0 (#663)
chore(deps-dev): bump @typescript-eslint/eslint-plugin

Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 6.13.2 to 6.14.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.14.0/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-11 22:45:03 +00:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
82c379d273 chore(deps): bump react-hook-form from 7.48.2 to 7.49.0 (#660)
Bumps [react-hook-form](https://github.com/react-hook-form/react-hook-form) from 7.48.2 to 7.49.0.
- [Release notes](https://github.com/react-hook-form/react-hook-form/releases)
- [Changelog](https://github.com/react-hook-form/react-hook-form/blob/master/CHANGELOG.md)
- [Commits](https://github.com/react-hook-form/react-hook-form/compare/v7.48.2...v7.49.0)

---
updated-dependencies:
- dependency-name: react-hook-form
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-11 22:39:11 +00:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
20e27bb652 chore(deps): bump posthog-js from 1.93.6 to 1.94.2 (#661)
Bumps [posthog-js](https://github.com/PostHog/posthog-js) from 1.93.6 to 1.94.2.
- [Release notes](https://github.com/PostHog/posthog-js/releases)
- [Changelog](https://github.com/PostHog/posthog-js/blob/master/CHANGELOG.md)
- [Commits](https://github.com/PostHog/posthog-js/compare/v1.93.6...v1.94.2)

---
updated-dependencies:
- dependency-name: posthog-js
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-11 23:33:50 +01:00
Marc Klingen a7e74a8937 chore: release v1.15.0
CI/CD / push-docker-image (push) Blocked by required conditions
CI/CD / tests (18) (push) Failing after 1m3s
CI/CD / tests (20) (push) Failing after 57s
CI/CD / e2e-tests (push) Failing after 1m0s
CI/CD / lint (push) Successful in 4m40s
CI/CD / all-ci-passed (push) Waiting to run
release.yml / release (push) Failing after 3s
2023-12-11 20:55:22 +01:00
Marc KlingenandGitHub 77f5a92901 feat(ui): add level, status message, metadata to generations table (#658) 2023-12-11 19:44:15 +00:00
Marc KlingenandGitHub 6256bf0dd5 refactor: improve column visibility interfaces (#655) 2023-12-11 09:55:09 +00:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
ecc5a58d2b chore(deps): bump the patches group with 7 updates (#654)
Bumps the patches group with 7 updates:

| Package | From | To |
| --- | --- | --- |
| [next](https://github.com/vercel/next.js) | `14.0.3` | `14.0.4` |
| [@types/jest](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jest) | `29.5.10` | `29.5.11` |
| [eslint-config-next](https://github.com/vercel/next.js/tree/HEAD/packages/eslint-config-next) | `14.0.3` | `14.0.4` |
| [prettier-plugin-tailwindcss](https://github.com/tailwindlabs/prettier-plugin-tailwindcss) | `0.5.8` | `0.5.9` |
| [release-it](https://github.com/release-it/release-it) | `17.0.0` | `17.0.1` |
| [ts-node](https://github.com/TypeStrong/ts-node) | `10.9.1` | `10.9.2` |
| [typescript](https://github.com/Microsoft/TypeScript) | `5.3.2` | `5.3.3` |


Updates `next` from 14.0.3 to 14.0.4
- [Release notes](https://github.com/vercel/next.js/releases)
- [Changelog](https://github.com/vercel/next.js/blob/canary/release.js)
- [Commits](https://github.com/vercel/next.js/compare/v14.0.3...v14.0.4)

Updates `@types/jest` from 29.5.10 to 29.5.11
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/jest)

Updates `eslint-config-next` from 14.0.3 to 14.0.4
- [Release notes](https://github.com/vercel/next.js/releases)
- [Changelog](https://github.com/vercel/next.js/blob/canary/release.js)
- [Commits](https://github.com/vercel/next.js/commits/v14.0.4/packages/eslint-config-next)

Updates `prettier-plugin-tailwindcss` from 0.5.8 to 0.5.9
- [Release notes](https://github.com/tailwindlabs/prettier-plugin-tailwindcss/releases)
- [Changelog](https://github.com/tailwindlabs/prettier-plugin-tailwindcss/blob/main/CHANGELOG.md)
- [Commits](https://github.com/tailwindlabs/prettier-plugin-tailwindcss/compare/v0.5.8...v0.5.9)

Updates `release-it` from 17.0.0 to 17.0.1
- [Release notes](https://github.com/release-it/release-it/releases)
- [Changelog](https://github.com/release-it/release-it/blob/main/CHANGELOG.md)
- [Commits](https://github.com/release-it/release-it/compare/17.0.0...17.0.1)

Updates `ts-node` from 10.9.1 to 10.9.2
- [Release notes](https://github.com/TypeStrong/ts-node/releases)
- [Changelog](https://github.com/TypeStrong/ts-node/blob/main/development-docs/release-template.md)
- [Commits](https://github.com/TypeStrong/ts-node/compare/v10.9.1...v10.9.2)

Updates `typescript` from 5.3.2 to 5.3.3
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](https://github.com/Microsoft/TypeScript/compare/v5.3.2...v5.3.3)

---
updated-dependencies:
- dependency-name: next
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: patches
- dependency-name: "@types/jest"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: patches
- dependency-name: eslint-config-next
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: patches
- dependency-name: prettier-plugin-tailwindcss
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: patches
- dependency-name: release-it
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: patches
- dependency-name: ts-node
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: patches
- dependency-name: typescript
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: patches
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-11 10:51:44 +01:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2cccdceda7 chore(deps): bump the prisma group with 2 updates (#646)
Bumps the prisma group with 2 updates: [@prisma/client](https://github.com/prisma/prisma/tree/HEAD/packages/client) and [prisma](https://github.com/prisma/prisma/tree/HEAD/packages/cli).


Updates `@prisma/client` from 5.6.0 to 5.7.0
- [Release notes](https://github.com/prisma/prisma/releases)
- [Commits](https://github.com/prisma/prisma/commits/5.7.0/packages/client)

Updates `prisma` from 5.6.0 to 5.7.0
- [Release notes](https://github.com/prisma/prisma/releases)
- [Commits](https://github.com/prisma/prisma/commits/5.7.0/packages/cli)

---
updated-dependencies:
- dependency-name: "@prisma/client"
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: prisma
- dependency-name: prisma
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: prisma
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-06 22:54:53 +00:00
Marc Klingen f7993152b7 chore: release v1.14.0
CI/CD / push-docker-image (push) Blocked by required conditions
CI/CD / tests (18) (push) Failing after 1m9s
CI/CD / e2e-tests (push) Failing after 1m0s
CI/CD / tests (20) (push) Failing after 1m24s
CI/CD / lint (push) Successful in 4m14s
CI/CD / all-ci-passed (push) Waiting to run
release.yml / release (push) Failing after 2s
2023-12-06 23:44:36 +01:00
Marc KlingenandGitHub cf0bbfd93f feat(ui): filter traces by latency (#645) 2023-12-06 22:07:28 +00:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
803a19ff3b chore(deps): bump posthog-node from 3.1.3 to 3.2.0 (#641)
Bumps [posthog-node](https://github.com/PostHog/posthog-node) from 3.1.3 to 3.2.0.
- [Release notes](https://github.com/PostHog/posthog-node/releases)
- [Commits](https://github.com/PostHog/posthog-node/commits)

---
updated-dependencies:
- dependency-name: posthog-node
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-06 11:08:55 +00:00
Max DeichmannandGitHub 44e4010e15 feat: skip batching trpc routes for dashboards (#643) 2023-12-06 12:03:53 +01:00
Max DeichmannandGitHub 5cbcf00595 feat: upgrade fern python settings and versions (#642) 2023-12-05 23:02:25 +00:00
Marc Klingen 49e75e15e5 chore: release v1.13.3
CI/CD / push-docker-image (push) Blocked by required conditions
CI/CD / tests (18) (push) Failing after 1m17s
CI/CD / tests (20) (push) Failing after 57s
CI/CD / e2e-tests (push) Failing after 1m6s
release.yml / release (push) Failing after 3s
CI/CD / lint (push) Successful in 4m21s
CI/CD / all-ci-passed (push) Waiting to run
2023-12-05 21:45:54 +01:00
Bernd StrehlandGitHub 1a3fcc0041 feat: add separate db variables as alternative to connection string (#639) 2023-12-05 21:44:00 +01:00
Marc Klingen 9b76029686 chore: release v1.13.2
CI/CD / push-docker-image (push) Blocked by required conditions
CI/CD / tests (18) (push) Failing after 1m5s
CI/CD / tests (20) (push) Failing after 1m2s
CI/CD / e2e-tests (push) Failing after 1m1s
CI/CD / lint (push) Successful in 4m13s
CI/CD / all-ci-passed (push) Waiting to run
release.yml / release (push) Failing after 3s
2023-12-05 20:09:28 +01:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
d6902e124d chore(deps): bump the patches group with 8 updates (#638)
Bumps the patches group with 8 updates:

| Package | From | To |
| --- | --- | --- |
| [posthog-js](https://github.com/PostHog/posthog-js) | `1.93.3` | `1.93.6` |
| [ts-pattern](https://github.com/gvergnaud/ts-pattern) | `5.0.5` | `5.0.6` |
| [@types/react](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react) | `18.2.40` | `18.2.42` |
| [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) | `6.13.1` | `6.13.2` |
| [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) | `6.13.1` | `6.13.2` |
| [postcss](https://github.com/postcss/postcss) | `8.4.31` | `8.4.32` |
| [prettier-plugin-tailwindcss](https://github.com/tailwindlabs/prettier-plugin-tailwindcss) | `0.5.7` | `0.5.8` |
| [tailwindcss](https://github.com/tailwindlabs/tailwindcss) | `3.3.5` | `3.3.6` |


Updates `posthog-js` from 1.93.3 to 1.93.6
- [Release notes](https://github.com/PostHog/posthog-js/releases)
- [Changelog](https://github.com/PostHog/posthog-js/blob/master/CHANGELOG.md)
- [Commits](https://github.com/PostHog/posthog-js/compare/v1.93.3...v1.93.6)

Updates `ts-pattern` from 5.0.5 to 5.0.6
- [Release notes](https://github.com/gvergnaud/ts-pattern/releases)
- [Commits](https://github.com/gvergnaud/ts-pattern/compare/v5.0.5...v5.0.6)

Updates `@types/react` from 18.2.40 to 18.2.42
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react)

Updates `@typescript-eslint/eslint-plugin` from 6.13.1 to 6.13.2
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.13.2/packages/eslint-plugin)

Updates `@typescript-eslint/parser` from 6.13.1 to 6.13.2
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.13.2/packages/parser)

Updates `postcss` from 8.4.31 to 8.4.32
- [Release notes](https://github.com/postcss/postcss/releases)
- [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md)
- [Commits](https://github.com/postcss/postcss/compare/8.4.31...8.4.32)

Updates `prettier-plugin-tailwindcss` from 0.5.7 to 0.5.8
- [Release notes](https://github.com/tailwindlabs/prettier-plugin-tailwindcss/releases)
- [Changelog](https://github.com/tailwindlabs/prettier-plugin-tailwindcss/blob/main/CHANGELOG.md)
- [Commits](https://github.com/tailwindlabs/prettier-plugin-tailwindcss/compare/v0.5.7...v0.5.8)

Updates `tailwindcss` from 3.3.5 to 3.3.6
- [Release notes](https://github.com/tailwindlabs/tailwindcss/releases)
- [Changelog](https://github.com/tailwindlabs/tailwindcss/blob/master/CHANGELOG.md)
- [Commits](https://github.com/tailwindlabs/tailwindcss/compare/v3.3.5...v3.3.6)

---
updated-dependencies:
- dependency-name: posthog-js
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: patches
- dependency-name: ts-pattern
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: patches
- dependency-name: "@types/react"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: patches
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: patches
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: patches
- dependency-name: postcss
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: patches
- dependency-name: prettier-plugin-tailwindcss
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: patches
- dependency-name: tailwindcss
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: patches
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-05 16:57:34 +00:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
075deb99c2 chore(deps): bump tailwind-merge from 2.0.0 to 2.1.0 (#632)
Bumps [tailwind-merge](https://github.com/dcastil/tailwind-merge) from 2.0.0 to 2.1.0.
- [Release notes](https://github.com/dcastil/tailwind-merge/releases)
- [Commits](https://github.com/dcastil/tailwind-merge/compare/v2.0.0...v2.1.0)

---
updated-dependencies:
- dependency-name: tailwind-merge
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-05 16:30:18 +00:00
Marc KlingenandGitHub 6da21c6c22 refactor: sequential database access (#637) 2023-12-05 16:23:33 +00:00
Marc Klingen 59ef3e898e Merge branch 'main' of github.com:langfuse/langfuse 2023-12-05 16:50:07 +01:00
Marc Klingen c737447a83 chore: add middleware 2023-12-05 16:50:03 +01:00
Max Deichmann 474a1e28ff chore: release v1.13.1
CI/CD / push-docker-image (push) Blocked by required conditions
CI/CD / tests (18) (push) Failing after 1m16s
CI/CD / tests (20) (push) Failing after 1m7s
CI/CD / e2e-tests (push) Failing after 1m2s
CI/CD / lint (push) Successful in 4m22s
CI/CD / all-ci-passed (push) Waiting to run
release.yml / release (push) Failing after 3s
2023-12-04 17:34:25 +01:00
Max DeichmannandGitHub a0b84773dc fix(ingestion): filter NULL string values from ingested events (#628) 2023-12-04 17:23:04 +01:00
Marc Klingen 00547bf93d chore: release v1.13.0
CI/CD / push-docker-image (push) Blocked by required conditions
CI/CD / tests (18) (push) Failing after 1m17s
CI/CD / tests (20) (push) Failing after 1m1s
CI/CD / e2e-tests (push) Failing after 1m7s
CI/CD / lint (push) Successful in 4m23s
CI/CD / all-ci-passed (push) Waiting to run
release.yml / release (push) Failing after 3s
2023-12-04 13:22:22 +01:00
Marc Klingen feb964f12b fix(ui): move column selector to the right of the toolbar 2023-12-04 12:57:33 +01:00
Max DeichmannandGitHub be72460af2 fix: remove custom hook for column selector (#627) 2023-12-04 10:57:25 +00:00
Marc KlingenandGitHub d5a86d394c feat(api): publish trace (#626) 2023-12-04 09:30:42 +00:00
Max DeichmannGitHub@RichardKruemmel
4e89d7d65a feature: configure table column visibility (#623) (#624)
Co-authored-by: @RichardKruemmel
2023-12-04 10:09:14 +01:00
Marc Klingen 28b7eab060 chore: release v1.12.0
CI/CD / push-docker-image (push) Blocked by required conditions
CI/CD / tests (18) (push) Failing after 1m18s
CI/CD / tests (20) (push) Failing after 57s
CI/CD / e2e-tests (push) Failing after 1m8s
CI/CD / lint (push) Successful in 4m21s
CI/CD / all-ci-passed (push) Waiting to run
release.yml / release (push) Failing after 4s
2023-12-03 01:00:37 +01:00
Marc KlingenandGitHub 2ccd140e9a feat(ui): copy formatted json (#621)
Fixes #617
2023-12-02 22:31:59 +00:00
Marc Klingen d47a4d67d4 chore: release v1.11.1
CI/CD / push-docker-image (push) Blocked by required conditions
CI/CD / tests (18) (push) Failing after 1m18s
CI/CD / tests (20) (push) Failing after 1m3s
CI/CD / e2e-tests (push) Failing after 1m7s
CI/CD / lint (push) Successful in 4m14s
CI/CD / all-ci-passed (push) Waiting to run
release.yml / release (push) Failing after 3s
2023-12-02 01:20:59 +01:00
Marc Klingen e20ad85a13 fix(ui): main menu css 2023-12-02 01:20:26 +01:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
1f3beabbdf chore(deps-dev): bump eslint from 8.54.0 to 8.55.0 (#620)
Bumps [eslint](https://github.com/eslint/eslint) from 8.54.0 to 8.55.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v8.54.0...v8.55.0)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-01 23:11:44 +00:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2353c90cc1 chore(deps): bump the patches group with 3 updates (#619)
Bumps the patches group with 3 updates: [@react-email/components](https://github.com/resendlabs/react-email/tree/HEAD/packages/components), [@react-email/render](https://github.com/resendlabs/react-email/tree/HEAD/packages/render) and [@types/react](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react).


Updates `@react-email/components` from 0.0.11 to 0.0.12
- [Release notes](https://github.com/resendlabs/react-email/releases)
- [Changelog](https://github.com/resendlabs/react-email/blob/canary/docs/changelog.mdx)
- [Commits](https://github.com/resendlabs/react-email/commits/v0.0.12/packages/components)

Updates `@react-email/render` from 0.0.9 to 0.0.10
- [Release notes](https://github.com/resendlabs/react-email/releases)
- [Changelog](https://github.com/resendlabs/react-email/blob/canary/docs/changelog.mdx)
- [Commits](https://github.com/resendlabs/react-email/commits/HEAD/packages/render)

Updates `@types/react` from 18.2.39 to 18.2.40
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react)

---
updated-dependencies:
- dependency-name: "@react-email/components"
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: patches
- dependency-name: "@react-email/render"
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: patches
- dependency-name: "@types/react"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: patches
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-02 00:07:41 +01:00
Marc Klingen df6c0cfa8a chore: release v1.11.0
CI/CD / push-docker-image (push) Blocked by required conditions
CI/CD / tests (18) (push) Failing after 1m17s
CI/CD / tests (20) (push) Failing after 1m7s
CI/CD / e2e-tests (push) Failing after 57s
CI/CD / lint (push) Successful in 4m21s
CI/CD / all-ci-passed (push) Waiting to run
release.yml / release (push) Failing after 4s
2023-12-01 23:48:00 +01:00
Marc KlingenandGitHub 2e8a9062f4 feat: improved rbac error message (#618) 2023-12-01 22:22:50 +00:00
7cc52b3c8e feat(ui): keep logo static on large screens while scrolling the main menu (#571)
---------

Co-authored-by: Marc Klingen <git@marcklingen.com>
2023-12-01 22:45:23 +01:00
Marc KlingenandGitHub 92d2def19f docs: update CONTRIBUTING.md 2023-12-01 21:16:46 +01:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
3cd7f6b3a9 chore(deps-dev): bump @adobe/css-tools from 4.3.1 to 4.3.2 (#614)
Bumps [@adobe/css-tools](https://github.com/adobe/css-tools) from 4.3.1 to 4.3.2.
- [Changelog](https://github.com/adobe/css-tools/blob/main/History.md)
- [Commits](https://github.com/adobe/css-tools/commits)

---
updated-dependencies:
- dependency-name: "@adobe/css-tools"
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-01 19:54:22 +00:00
Marc KlingenandGitHub 65c4fbf9e8 fix: improved state during trace deletion (#615) 2023-12-01 17:24:28 +00:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
5c5accf4f8 chore(deps-dev): bump the patches group with 2 updates (#609)
Bumps the patches group with 2 updates: [@testing-library/jest-dom](https://github.com/testing-library/jest-dom) and [@types/eslint](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/eslint).


Updates `@testing-library/jest-dom` from 6.1.4 to 6.1.5
- [Release notes](https://github.com/testing-library/jest-dom/releases)
- [Changelog](https://github.com/testing-library/jest-dom/blob/main/CHANGELOG.md)
- [Commits](https://github.com/testing-library/jest-dom/compare/v6.1.4...v6.1.5)

Updates `@types/eslint` from 8.44.7 to 8.44.8
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/eslint)

---
updated-dependencies:
- dependency-name: "@testing-library/jest-dom"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: patches
- dependency-name: "@types/eslint"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: patches
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-01 17:11:36 +00:00
5bfb02b48a feat(auth): Add access to default project upon sign-up (#611)
* Add access to default project upon sign-up

* refactor: createProjectMembershipsOnSignup

---------

Co-authored-by: Marc Klingen <git@marcklingen.com>
2023-12-01 18:00:48 +01:00
Marc KlingenandGitHub e0650469c8 chore: remove next-swagger-doc (#612) 2023-12-01 01:54:50 +00:00
b20d4da827 feat: add html email template for project invitations (#601)
---------

Co-authored-by: Marc Klingen <git@marcklingen.com>
2023-12-01 02:14:20 +01:00
Marc Klingen 029577bb0d chore: release v1.10.0
CI/CD / push-docker-image (push) Blocked by required conditions
CI/CD / tests (20) (push) Failing after 56s
CI/CD / tests (18) (push) Failing after 1m9s
CI/CD / e2e-tests (push) Failing after 56s
release.yml / release (push) Failing after 2s
CI/CD / lint (push) Successful in 4m30s
CI/CD / all-ci-passed (push) Waiting to run
2023-11-30 23:48:42 +01:00
Marc KlingenandGitHub 86851322c9 feat(api): upsert and get dataset items (#606) 2023-11-30 22:44:50 +00:00
Marc KlingenandGitHub cd665d8fd5 fix(ui): extend checks to not trigger keyboard shortcuts when editing inputs (#607) 2023-11-30 21:26:12 +00:00
Marc Klingen f547fd710c Revert "chore(deps): bump sentry"
This reverts commit da7699fa68.
2023-11-30 22:21:34 +01:00
Marc Klingen da7699fa68 chore(deps): bump sentry 2023-11-30 22:17:26 +01:00
Max Deichmann b4a4f5683e chore: release v1.9.2
CI/CD / push-docker-image (push) Blocked by required conditions
CI/CD / tests (18) (push) Failing after 50s
CI/CD / tests (20) (push) Failing after 38s
CI/CD / e2e-tests (push) Failing after 1m5s
CI/CD / lint (push) Successful in 4m1s
CI/CD / all-ci-passed (push) Waiting to run
release.yml / release (push) Failing after 2s
2023-11-30 13:51:28 +01:00
Max DeichmannandGitHub 6ed893de18 fix(core): add start time to patches of ingestion events (#605) 2023-11-30 13:50:33 +01:00
Max Deichmann 92e834e490 chore: release v1.9.1
CI/CD / push-docker-image (push) Blocked by required conditions
CI/CD / tests (20) (push) Failing after 36s
CI/CD / tests (18) (push) Failing after 50s
CI/CD / e2e-tests (push) Failing after 36s
CI/CD / lint (push) Successful in 3m56s
CI/CD / all-ci-passed (push) Waiting to run
release.yml / release (push) Failing after 3s
2023-11-30 11:48:01 +01:00
Max DeichmannandGitHub ed9d647d31 fix(core): add logging to trace router (#603) 2023-11-30 10:41:49 +00:00
Marc Klingen 58f807b7de feat(cloud): demo project link to q&a chatbot 2023-11-29 13:07:19 +01:00
Veniamin ViflyantsevandGitHub 2a623ba65b fix: NEXTAUTH_URL environment variable in docker compose files (#596) 2023-11-29 11:48:08 +01:00
Marc Klingen de7919b7ec fix: auth url on Langfuse Cloud (staging) 2023-11-29 04:15:33 +01:00
Marc Klingen 88f96a37c1 fix: auth url on Langfuse Cloud 2023-11-29 04:12:57 +01:00
Marc Klingen e4f58de9ba chore: release v1.9.0
CI/CD / push-docker-image (push) Blocked by required conditions
CI/CD / tests (18) (push) Failing after 48s
CI/CD / e2e-tests (push) Failing after 35s
CI/CD / tests (20) (push) Failing after 42s
CI/CD / lint (push) Successful in 3m57s
CI/CD / all-ci-passed (push) Waiting to run
release.yml / release (push) Failing after 3s
2023-11-29 03:50:43 +01:00
Marc Klingen c00c1833dd chore(deps): bump 2023-11-29 03:47:46 +01:00
Marc Klingen 8657c61bb8 fix: remove user invite alert 2023-11-29 03:33:15 +01:00
144aada5ec feat(auth): invite users to a project that do not have an account yet (#574)
---------

Co-authored-by: Marc Klingen <git@marcklingen.com>
2023-11-29 03:17:25 +01:00
311 changed files with 20930 additions and 7319 deletions
+2 -1
View File
@@ -1,3 +1,4 @@
[codespell]
skip = .git,*.pdf,*.svg,package-lock.json,*.prisma
ignore-words-list = afterall
ignore-words-list = afterall,vertx
+14 -1
View File
@@ -16,4 +16,17 @@ NEXTAUTH_SECRET="secret"
# Langfuse experimental features
LANGFUSE_ENABLE_EXPERIMENTAL_FEATURES="true"
SALT="salt"
# Salt for API key hashing
SALT="salt"
# Email
EMAIL_FROM_ADDRESS="" # Defines the email address to use as the from address.
SMTP_CONNECTION_URL="" # Defines the connection url for smtp server.
# S3 storage
S3_ENDPOINT=
S3_ACCESS_KEY_ID=
S3_SECRET_ACCESS_KEY=
S3_BUCKET_NAME=
S3_REGION=
+2 -4
View File
@@ -1,16 +1,14 @@
# When adding additional environment variables, the schema in "/src/env.mjs"
# should be updated accordingly.
# Prisma
# https://www.prisma.io/docs/reference/database-reference/connection-urls#env
DIRECT_URL="postgresql://postgres:postgres@db:5432/postgres"
DATABASE_URL="postgresql://postgres:postgres@db:5432/postgres"
# Next Auth
# You can generate a new secret on the command line with:
# openssl rand -base64 32
# https://next-auth.js.org/configuration/options#secret
NEXTAUTH_SECRET="secret"
NEXTAUTH_URL="http://localhost:3000"
# feature flag to enable experimental features locally
LANGFUSE_ENABLE_EXPERIMENTAL_FEATURES="false"
SALT="salt"
SALT="salt"
+68 -24
View File
@@ -1,31 +1,72 @@
# Assuming deployment on Vercel with Postgres database on Supabase
NEXT_PUBLIC_LANGFUSE_CLOUD_REGION="US"
NEXTAUTH_COOKIE_DOMAIN=".langfuse.com"
# More information: https://langfuse.com/docs/deployment/self-host
# When adding additional environment variables, the schema in "/src/env.mjs"
# should be updated accordingly.
# Prisma
# https://www.prisma.io/docs/reference/database-reference/connection-urls#env
DIRECT_URL="postgresql://postgres:[pw]@db.[db_id].supabase.co:5432/postgres"
DATABASE_URL="postgres://postgres:[pw]@db.[db_id].supabase.co:6543/postgres?pgbouncer=true&connection_limit=1"
# DATABASE_URL supports pooled connections, but then you need to set DIRECT_URL
DATABASE_URL="postgresql://postgres:postgres@db:5432/postgres"
# DIRECT_URL="postgresql://postgres:postgres@db:5432/postgres"
# SHADOW_DATABASE_URL=
# Next Auth
# NEXTAUTH_URL does not need to be set when deploying on Vercel
# NEXTAUTH_URL="http://localhost:3000"
# AUTH_REDIRECT_PROXY_URL used to proxy oauth callbacks on e.g. preview deployments. optional.
# AUTH_REDIRECT_PROXY_URL="https://example.com/api/auth"
NEXTAUTH_URL="http://localhost:3000"
# You can generate a new secret on the command line with:
# openssl rand -base64 32
# https://next-auth.js.org/configuration/options#secret
NEXTAUTH_SECRET="secret"
SALT="salt"
# Sentry; set via Vercel integration
# NEXT_PUBLIC_SENTRY_DSN=
# NEXT_SENTRY_ORG=
# NEXT_SENTRY_PROJECT=
# SENTRY_AUTH_TOKEN=
# Docker only, optional
# PORT=3000
# HOSTNAME=localhost
# Default project, optional
# LANGFUSE_DEFAULT_PROJECT_ID=
# LANGFUSE_DEFAULT_PROJECT_ROLE=
# Enable experimental features, optional
# NEXT_PUBLIC_ENABLE_EXPERIMENTAL_FEATURES
# Auth, optional configuration
# AUTH_DOMAINS_WITH_SSO_ENFORCEMENT=domain1.com,domain2.com
# AUTH_DISABLE_USERNAME_PASSWORD=true
# SSO, each group is optional
# AUTH_GOOGLE_CLIENT_ID=
# AUTH_GOOGLE_CLIENT_SECRET=
# AUTH_GITHUB_CLIENT_ID=
# AUTH_GITHUB_CLIENT_SECRET=
# AUTH_AZURE_AD_CLIENT_ID=
# AUTH_AZURE_AD_CLIENT_SECRET=
# AUTH_AZURE_AD_TENANT_ID=
# Transactional email, optional
# Defines the email address to use as the from address.
# EMAIL_FROM_ADDRESS=
# Defines the connection url for smtp server.
# SMTP_CONNECTION_URL=
# S3 storage, optional, used for exports from the UI
# S3_ENDPOINT=
# S3_ACCESS_KEY_ID=
# S3_SECRET_ACCESS_KEY=
# S3_BUCKET_NAME=
# S3_REGION=
### START Langfuse Cloud Config
# Used for Langfuse Cloud deployments
# Not recommended for self-hosted deployments as these are NOT COVERED BY SEMVER
# NEXT_PUBLIC_LANGFUSE_CLOUD_REGION="US"
# NEXTAUTH_COOKIE_DOMAIN=".langfuse.com"
# LANGFUSE_TEAM_SLACK_WEBHOOK=
# LANGFUSE_NEW_USER_SIGNUP_WEBHOOK=
@@ -34,13 +75,16 @@ SALT="salt"
# NEXT_PUBLIC_POSTHOG_HOST=
# NEXT_PUBLIC_POSTHOG_KEY=
# Id of demo project to automatically assign new users to
# Sentry
# NEXT_PUBLIC_SENTRY_DSN=
# NEXT_SENTRY_ORG=
# NEXT_SENTRY_PROJECT=
# SENTRY_AUTH_TOKEN=
# Demo project that users can use to try the platform
# NEXT_PUBLIC_DEMO_PROJECT_ID=
# Auth, each group is optional
AUTH_GOOGLE_CLIENT_ID=
AUTH_GOOGLE_CLIENT_SECRET=
AUTH_GITHUB_CLIENT_ID=
AUTH_GITHUB_CLIENT_SECRET=
# AUTH_DOMAINS_WITH_SSO_ENFORCEMENT=domain1.com,domain2.com
# AUTH_DISABLE_USERNAME_PASSWORD=true
# Crisp chat
# NEXT_PUBLIC_CRISP_WEBSITE_ID=
### END Langfuse Cloud Config
+14 -2
View File
@@ -6,12 +6,17 @@ const config = {
overrides: [
{
extends: [
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/strict-type-checked",
],
files: ["*.ts", "*.tsx"],
parserOptions: {
project: path.join(__dirname, "tsconfig.json"),
},
rules: {
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-confusing-void-expression": "off",
},
},
],
parser: "@typescript-eslint/parser",
@@ -19,7 +24,8 @@ const config = {
project: path.join(__dirname, "tsconfig.json"),
},
plugins: ["@typescript-eslint"],
extends: ["next/core-web-vitals", "plugin:@typescript-eslint/recommended"],
extends: ["next/core-web-vitals"],
ignorePatterns: ["generated/**/*"],
rules: {
"@typescript-eslint/consistent-type-imports": [
"warn",
@@ -29,6 +35,12 @@ const config = {
},
],
"@typescript-eslint/no-unused-vars": ["warn", { argsIgnorePattern: "^_" }],
"react/jsx-key": [
"error",
{
warnOnDuplicates: true,
},
],
},
};
+18
View File
@@ -0,0 +1,18 @@
body:
- type: textarea
attributes:
label: Describe the feature or potential improvement
description: Please describe the change as clear and concise as possible. Remember to add context as to why you believe this is needed.
validations:
required: true
- type: textarea
attributes:
label: Additional information
description: Add any other information related to the change here. If your idea is related to any issues or discussions, link them here.
- type: checkboxes
id: contribute
attributes:
label: Contribute
description: Are you willing to contribute to the implementation of this idea?
options:
- label: Yes, I can implement this and raise a PR
+7
View File
@@ -0,0 +1,7 @@
contact_links:
- name: 💡 Feature Request
url: https://github.com/orgs/langfuse/discussions/new?category=ideas
about: Suggest any ideas you have using our discussion forums.
- name: 🤗 Get Help
url: https://github.com/orgs/langfuse/discussions/new?category=support
about: If you cant get something to work the way you expect, open a question in our discussion forums.
@@ -1,36 +0,0 @@
# This template is heavily inspired by the Next.js's template:
# See here: https://github.com/vercel/next.js/blob/canary/.github/ISSUE_TEMPLATE/3.feature_request.yml
name: 🛠 Feature Request
description: Create a feature request for the core packages
title: "feat: "
labels: ["✨ enhancement"]
body:
- type: markdown
attributes:
value: |
Thank you for taking the time to file a feature request. Please fill out this form as completely as possible.
- type: textarea
attributes:
label: Describe the feature you'd like to request
description: Please describe the feature as clear and concise as possible. Remember to add context as to why you believe this feature is needed.
validations:
required: true
- type: textarea
attributes:
label: Describe the solution you'd like to see
description: Please describe the solution you would like to see. Adding example usage is a good way to provide context.
validations:
required: true
- type: textarea
attributes:
label: Additional information
description: Add any other information related to the feature here. If your feature request is related to any issues or discussions, link them here.
- type: checkboxes
id: contribute
attributes:
label: Contribute
description: Are you willing to contribute to the implementation of this feature?
options:
- label: Yes, I can implement this and raise a PR
+1 -1
View File
@@ -27,7 +27,7 @@ Fixes # (issue)
<!-- Remove bullet points below that don't apply to you -->
- I haven't read the [contributing guide](https://github.com/calcom/cal.com/blob/main/CONTRIBUTING.md)
- I haven't read the [contributing guide](https://github.com/langfuse/langfuse/blob/main/CONTRIBUTING.md)
- My code doesn't follow the style guidelines of this project (`npm run prettier`)
- I haven't commented my code, particularly in hard-to-understand areas
- I haven't checked if my PR needs changes to the documentation
+3
View File
@@ -18,6 +18,9 @@ updates:
- dependency-name: "@types/node"
- dependency-name: "@trpc/*"
groups:
sentry:
patterns:
- "@sentry/*"
prisma:
patterns:
- "prisma"
+1
View File
@@ -4,6 +4,7 @@ on:
push:
branches:
- "main"
merge_group:
pull_request:
branches:
- "main"
+37 -1
View File
@@ -7,6 +7,7 @@ on:
- "main"
tags:
- "v*"
merge_group:
pull_request:
branches:
- "main"
@@ -29,12 +30,47 @@ jobs:
- name: lint
run: npm run lint
test-docker-build:
runs-on: ubuntu-latest
env:
DATABASE_URL: postgresql://postgres:postgres@localhost:5432/postgres
NEXTAUTH_SECRET: "secret"
SALT: "salt"
NEXTAUTH_URL: "http://localhost:3030"
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
steps:
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 20
- name: Checkout
uses: actions/checkout@v3
- name: Build Docker image
uses: docker/build-push-action@v4
with:
context: .
push: false
build-args: |
DATABASE_URL=${{ env.DATABASE_URL }}
NEXTAUTH_SECRET=${{ env.NEXTAUTH_SECRET }}
NEXTAUTH_URL=${{ env.NEXTAUTH_URL }}
SALT=${{ env.SALT }}
tests:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18, 20]
steps:
- name: Set Swap Space
uses: pierotofy/set-swap-space@master
with:
swap-size-gb: 10
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
@@ -100,7 +136,7 @@ jobs:
all-ci-passed:
# This allows us to have a branch protection rule for tests and deploys with matrix
runs-on: ubuntu-latest
needs: [lint, tests, e2e-tests]
needs: [lint, tests, e2e-tests, test-docker-build]
if: always()
steps:
- name: Successful deploy
+3 -2
View File
@@ -1,6 +1,6 @@
{
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
"source.fixAll.eslint": "explicit"
},
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
@@ -28,5 +28,6 @@
"docwriter.style": "JSDoc",
"[prisma]": {
"editor.defaultFormatter": "Prisma.prisma"
}
},
"eslint.lintTask.enable": true
}
+102 -2
View File
@@ -21,10 +21,87 @@ _Before making any significant changes, please [open an issue](https://github.co
Once we've discussed your changes and you've got your code ready, make sure that tests are passing and open your pull request.
## Getting started
A good first step is to search for open [issues](https://github.com/langfuse/langfuse/issues). Issues are labeled, and some good issues to start with are labeled: [good first issue](https://github.com/langfuse/langfuse/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22).
## Project Overview
### Technologies we use
- Application (this repository)
- NextJS 14, pages router
- NextAuth.js / Auth.js
- tRPC: Frontend APIs
- Prisma ORM
- Zod
- Tailwind CSS
- shadcn/ui tailwind components (using Radix and tanstack)
- Fern: generate OpenAPI spec and Pydantic models
- JS SDK ([langfuse/langfuse-js](https://github.com/langfuse/langfuse-js))
- openapi-typescript to generated types based on OpenAPI spec
- Python SDK ([langfuse/langfuse-python](https://github.com/langfuse/langfuse-python))
- Pydantic for input validation, models generated by fern
### Architecture Overview
```mermaid
flowchart TB
subgraph s4["Clients"]
subgraph s2["langfuse/langfuse-python"]
Python["Python SDK"]
OAI["OpenAI drop-in replacement"] -->|extends| Python
LCPYTHON["Langchain Python Integration"] -->|extends| Python
Langflow -->|uses| LCPYTHON
LiteLLM -->|uses| Python
end
subgraph s3["langfuse/langfuse-js"]
JS["JS SDK"]
LCJS["Langchain JS Integration"] -->|extends| JS
Flowise -->|uses| LCJS
end
end
DB[Postgres Database]
subgraph s1["Application (langfuse/langfuse)"]
API[Public HTTP API]
G[TRPC API]
I[NextAuth]
H[React Frontend]
Prisma[Prisma ORM]
H --> G
H --> I
G --> I
G --- Prisma
API --- Prisma
I --- Prisma
end
Prisma --- DB
JS --- API
Python --- API
```
### Database Overview
The diagram below may not show all relationships if the foreign key is not defined in the database schema. For instance, `trace_id` in the `observation` table is not defined as a foreign key to the `trace` table to allow unordered ingestion of these objects, but it is still a foreign key in the application code.
Full database schema: [prisma/schema.prisma](prisma/schema.prisma)
<img src="./prisma/database.svg">
### Infrastructure & Network Overview
```mermaid
flowchart LR
Browser ---|Web UI & TRPC API| App
Integrations/SDKs ---|Public HTTP API| App
subgraph i1["Application Network"]
App["Langfuse Application (Docker or Serverless)"]
end
subgraph i2["Database Network"]
DB["Postgres Database"]
end
App --- DB
```
## Development Setup
Requirements
@@ -69,10 +146,31 @@ Requirements
npm run dev
```
> [!NOTE]
> If you frequently switch branches, use `npm run dx` instead of `npm run dev`. This command will install dependencies, reset the database (wipe and apply all migrations), and run the database seeder with example data before starting the development server.
## Commit messages
On the main branch, we adhere to the best practices of [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/). All pull requests and branches are squash-merged to maintain a clean and readable history. This approach ensures the addition of a conventional commit message when merging contributions.
## Test the public API
The API is tested using Jest. With the development server running, you can run the tests with:
Run all
```bash
npm run test
```
Run interactively in watch mode
```bash
npm run test:watch
```
These tests are also run in CI.
## CI/CD
We use GitHub Actions for CI/CD, the configuration is in [`.github/workflows/pipeline.yml`](.github/workflows/pipeline.yml)
@@ -108,3 +206,5 @@ When a new release is tagged on the `main` branch (excluding prereleases), it tr
## License
Langfuse is MIT licensed, except for `ee/` folder. See [LICENSE](LICENSE) and [docs](https://langfuse.com/docs/open-source) for more details.
When contributing to the Langfuse codebase, you need to agree to the [Contributor License Agreement](https://cla-assistant.io/langfuse/langfuse). You only need to do this once and the CLA bot will remind you if you haven't signed it yet.
+10 -1
View File
@@ -13,6 +13,14 @@
</div>
</br>
<div>
<a href="https://cloud.langfuse.com">
<strong>Langfuse Cloud »</strong>
</a>
</br>
<a href="https://langfuse.com/docs/deployment/self-host">
<strong>Self Host Langfuse »</strong>
</a>
</br>
<a href="https://discord.gg/7NXusRtqYU">
<strong>Join the Langfuse Discord »</strong>
</a>
@@ -26,11 +34,12 @@
<a href="https://github.com/langfuse/langfuse/issues/new?labels=%F0%9F%90%9E%E2%9D%94+unconfirmed+bug&projects=&template=bug_report.yml&title=bug%3A+">
<strong>Report Bug</strong>
</a> ·
<a href="https://github.com/langfuse/langfuse/issues/new?assignees=&labels=%E2%9C%A8+enhancement&projects=&template=feature_request.yml&title=feat%3A+">
<a href="https://github.com/orgs/langfuse/discussions/new?category=ideas">
<strong>Feature Request</strong>
</a>
</div>
</br>
</br>
<div>
<img src="https://img.shields.io/badge/License-MIT-red.svg?style=flat-square" alt="MIT License">
<a href="https://discord.gg/7NXusRtqYU"><img src="https://img.shields.io/discord/1111061815649124414?style=flat-square&logo=Discord&logoColor=white&label=Discord&color=%23434EE4" alt="Discord"></a>
+4
View File
@@ -0,0 +1,4 @@
## Security Policy
We strongly recommend using the latest version of Langfuse to receive all security updates.
For more information, please refer to the [Data Security & Privacy](https://langfuse.com/docs/data-security-privacy) page in the documentation or contact security@langfuse.com.
+2 -2
View File
@@ -8,7 +8,7 @@ services:
- DATABASE_URL=postgresql://postgres:postgres@db:5432/postgres
- NEXTAUTH_SECRET=mysecret
- SALT=mysalt
- NEXTAUTH_URL=http:localhost:3000
- NEXTAUTH_URL=http://localhost:3000
depends_on:
- db
ports:
@@ -18,7 +18,7 @@ services:
- DATABASE_URL=postgresql://postgres:postgres@db:5432/postgres
- NEXTAUTH_SECRET=mysecret
- SALT=mysalt
- NEXTAUTH_URL=http:localhost:3000
- NEXTAUTH_URL=http://localhost:3000
- TELEMETRY_ENABLED=${TELEMETRY_ENABLED:-true}
- NEXT_PUBLIC_SIGN_UP_DISABLED=${NEXT_PUBLIC_SIGN_UP_DISABLED:-false}
- LANGFUSE_ENABLE_EXPERIMENTAL_FEATURES=${LANGFUSE_ENABLE_EXPERIMENTAL_FEATURES:-false}
+1 -1
View File
@@ -12,7 +12,7 @@ services:
- DATABASE_URL=postgresql://postgres:postgres@db:5432/postgres
- NEXTAUTH_SECRET=mysecret
- SALT=mysalt
- NEXTAUTH_URL=http:localhost:3000
- NEXTAUTH_URL=http://localhost:3000
- TELEMETRY_ENABLED=${TELEMETRY_ENABLED:-true}
- NEXT_PUBLIC_SIGN_UP_DISABLED=${NEXT_PUBLIC_SIGN_UP_DISABLED:-false}
- LANGFUSE_ENABLE_EXPERIMENTAL_FEATURES=${LANGFUSE_ENABLE_EXPERIMENTAL_FEATURES:-false}
+17 -2
View File
@@ -1,7 +1,22 @@
#!/bin/sh
# Set DIRECT_URL to the value of DATABASE_URL, required for migrations
export DIRECT_URL=$DATABASE_URL
# Check if DATABASE_URL is not set
if [ -z "$DATABASE_URL" ]; then
# Check if all required variables are provided
if [ -n "$DATABASE_HOST" ] && [ -n "$DATABASE_USERNAME" ] && [ -n "$DATABASE_PASSWORD" ] && [ -n "$DATABASE_NAME" ]; then
# Construct DATABASE_URL from the provided variables
DATABASE_URL="postgresql://${DATABASE_USERNAME}:${DATABASE_PASSWORD}@${DATABASE_HOST}/${DATABASE_NAME}"
export DATABASE_URL
else
echo "Error: Required database environment variables are not set. Provide a postgres url for DATABASE_URL."
exit 1
fi
fi
# Set DIRECT_URL to the value of DATABASE_URL if it is not set, required for migrations
if [ -z "$DIRECT_URL" ]; then
export DIRECT_URL=$DATABASE_URL
fi
# Apply migrations
prisma migrate deploy
+7
View File
@@ -1,4 +1,11 @@
name: langfuse
docs: |
## Authentication
Authenticate with the API using Basic Auth, get API keys in the project settings:
- username: Langfuse Public Key
- password: Langfuse Secret Key
error-discrimination:
strategy: status-code
auth: basic
+48 -38
View File
@@ -1,32 +1,4 @@
types:
# Create Bodies
CreateEventRequest:
properties:
id: optional<string>
traceId: optional<string>
name: optional<string>
startTime: optional<datetime>
metadata: optional<unknown>
input: optional<unknown>
output: optional<unknown>
level: optional<ObservationLevel>
statusMessage: optional<string>
parentObservationId: optional<string>
version: optional<string>
CreateSpanRequest:
extends: CreateEventRequest
properties:
endTime: optional<datetime>
CreateGenerationRequest:
extends: CreateSpanRequest
properties:
completionStartTime: optional<datetime>
model: optional<string>
modelParameters: optional<map<string, MapValue>>
prompt: optional<unknown>
completion: optional<unknown>
usage: optional<LLMUsage>
# Objects
Trace:
properties:
@@ -35,10 +7,17 @@ types:
docs: The unique identifier of a trace
timestamp: datetime
name: optional<string>
input: optional<unknown>
output: optional<unknown>
sessionId: optional<string>
release: optional<string>
version: optional<string>
userId: optional<string>
metadata: optional<unknown>
tags: optional<list<string>>
public:
type: optional<boolean>
docs: Public traces are accessible via url without login
TraceWithDetails:
extends: Trace
properties:
@@ -51,8 +30,17 @@ types:
TraceWithFullDetails:
extends: Trace
properties:
observations: list<Observation>
observations: list<ObservationsView>
scores: list<Score>
Session:
properties:
id: string
createdAt: datetime
projectId: string
SessionWithTraces:
extends: Session
properties:
traces: list<Trace>
Observation:
properties:
id: string
@@ -68,12 +56,32 @@ types:
version: optional<string>
metadata: optional<unknown>
output: optional<unknown>
promptTokens: integer
completionTokens: integer
totalTokens: integer
usage: optional<Usage>
level: ObservationLevel
statusMessage: optional<string>
parentObservationId: optional<string>
promptId: optional<string>
ObservationsView:
extends: Observation
properties:
modelId: optional<string>
inputPrice: optional<double>
outputPrice: optional<double>
totalPrice: optional<double>
calculatedInputCost: optional<double>
calculatedOutputCost: optional<double>
calculatedTotalCost: optional<double>
Usage:
properties:
input: optional<integer>
output: optional<integer>
total: optional<integer>
unit: optional<ModelUsageUnit>
inputCost: optional<double>
outputCost: optional<double>
totalCost: optional<double>
Score:
properties:
id: string
@@ -87,7 +95,6 @@ types:
properties:
id: string
name: string
status: DatasetStatus
projectId: string
createdAt: datetime
updatedAt: datetime
@@ -121,6 +128,13 @@ types:
datasetRunItems: list<DatasetRunItem>
# Utilities
ModelUsageUnit:
enum:
- CHARACTERS
- TOKENS
- MILLISECONDS
- SECONDS
- IMAGES
ObservationLevel:
enum:
- DEBUG
@@ -133,11 +147,7 @@ types:
- optional<string>
- optional<integer>
- optional<boolean>
LLMUsage:
properties:
promptTokens: optional<integer>
completionTokens: optional<integer>
totalTokens: optional<integer>
- optional<list<string>>
DatasetStatus:
enum:
- ACTIVE
+11 -1
View File
@@ -7,13 +7,23 @@ service:
endpoints:
create:
method: POST
docs: Create a dataset item
docs: Create a dataset item, upserts on id
path: /dataset-items
request: CreateDatasetItemRequest
response: commons.DatasetItem
get:
docs: Get a specific dataset item
method: GET
path: /dataset-items/{id}
path-parameters:
id:
type: string
response: commons.DatasetItem
types:
CreateDatasetItemRequest:
properties:
datasetName: string
input: unknown
expectedOutput: optional<unknown>
id: optional<string>
-13
View File
@@ -1,13 +0,0 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/fern-api/fern/main/fern.schema.json
imports:
commons: ./commons.yml
service:
auth: true
base-path: /api/public
endpoints:
create:
docs: Add an event to the database
method: POST
path: /events
request: commons.CreateEventRequest
response: commons.Observation
@@ -1,36 +0,0 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/fern-api/fern/main/fern.schema.json
imports:
commons: ./commons.yml
pagination: ./utils/pagination.yml
service:
auth: true
base-path: /api/public
endpoints:
log:
method: POST
path: /generations
request: commons.CreateGenerationRequest
response: commons.Observation
update:
method: PATCH
path: /generations
request: UpdateGenerationRequest
response: commons.Observation
types:
UpdateGenerationRequest:
properties:
generationId: string
traceId: optional<string>
name: optional<string>
endTime: optional<datetime>
completionStartTime: optional<datetime>
model: optional<string>
modelParameters: optional<map<string, commons.MapValue>>
prompt: optional<unknown>
version: optional<string>
metadata: optional<unknown>
completion: optional<unknown>
usage: optional<commons.LLMUsage>
level: optional<commons.ObservationLevel>
statusMessage: optional<string>
+13
View File
@@ -7,9 +7,22 @@ service:
docs: Check health of API and database
method: GET
path: /health
response: HealthResponse
errors:
- ServiceUnavailableError
types:
HealthResponse:
properties:
version:
type: string
docs: Langfuse server version
status: string
examples:
- value:
version: 1.25.0
status: OK
errors:
ServiceUnavailableError:
status-code: 503
+196 -16
View File
@@ -15,7 +15,7 @@ service:
body:
properties:
batch: list<IngestionEvent>
response: commons.Score
response: IngestionResponse # will be reportet as 200 response, but endpoint returns 207
types:
IngestionEvent:
@@ -23,26 +23,206 @@ types:
union:
trace-create: TraceEvent
score-create: ScoreEvent
observation-create: ObservationCreateEvent
observation-update: ObservationUpdateEvent
event-create: CreateEventEvent
generation-create: CreateGenerationEvent
generation-update: UpdateGenerationEvent
span-create: CreateSpanEvent
span-update: UpdateSpanEvent
sdk-log: SDKLogEvent
# both are legacy
observation-create: CreateObservationEvent
observation-update: UpdateObservationEvent
ObservationType:
enum:
- SPAN
- GENERATION
- EVENT
IngestionUsage:
discriminated: false
union:
- commons.Usage
- OpenAIUsage
OpenAIUsage:
properties:
promptTokens: optional<integer>
completionTokens: optional<integer>
totalTokens: optional<integer>
OptionalObservationBody:
properties:
traceId: optional<string>
name: optional<string>
startTime: optional<datetime>
metadata: optional<unknown>
input: optional<unknown>
output: optional<unknown>
level: optional<commons.ObservationLevel>
statusMessage: optional<string>
parentObservationId: optional<string>
version: optional<string>
CreateEventBody:
extends: OptionalObservationBody
properties:
id: optional<string>
UpdateEventBody:
extends: OptionalObservationBody
properties:
id: string
CreateSpanBody:
extends: CreateEventBody
properties:
endTime: optional<datetime>
UpdateSpanBody:
extends: UpdateEventBody
properties:
endTime: optional<datetime>
CreateGenerationBody:
extends: CreateSpanBody
properties:
completionStartTime: optional<datetime>
model: optional<string>
modelParameters: optional<map<string, commons.MapValue>>
usage: optional<IngestionUsage>
promptName: optional<string>
promptVersion: optional<integer>
UpdateGenerationBody:
extends: UpdateSpanBody
properties:
completionStartTime: optional<datetime>
model: optional<string>
modelParameters: optional<map<string, commons.MapValue>>
usage: optional<IngestionUsage>
promptName: optional<string>
promptVersion: optional<integer>
ObservationBody:
properties:
id: optional<string>
traceId: optional<string>
type: ObservationType
name: optional<string>
startTime: optional<datetime>
endTime: optional<datetime>
completionStartTime: optional<datetime>
model: optional<string>
modelParameters: optional<map<string, commons.MapValue>>
input: optional<unknown>
version: optional<string>
metadata: optional<unknown>
output: optional<unknown>
usage: optional<commons.Usage>
level: optional<commons.ObservationLevel>
statusMessage: optional<string>
parentObservationId: optional<string>
TraceBody:
properties:
id: optional<string>
name: optional<string>
userId: optional<string>
input: optional<unknown>
output: optional<unknown>
sessionId: optional<string>
release: optional<string>
version: optional<string>
metadata: optional<unknown>
tags: optional<list<string>>
public:
type: optional<boolean>
docs: Make trace publicly accessible via url
SDKLogBody:
properties:
log: unknown
ScoreBody:
properties:
id: optional<string>
traceId: string
name: string
value: double
observationId: optional<string>
comment: optional<string>
BaseEvent:
properties:
id: string
timestamp: string
metadata: unknown
TraceEvent:
extends: BaseEvent
properties:
id: string
timestamp: string
body: commons.Trace
ObservationCreateEvent:
body: TraceBody
CreateObservationEvent:
extends: BaseEvent
properties:
id: string
timestamp: string
body: commons.Observation
ObservationUpdateEvent:
body: ObservationBody
UpdateObservationEvent:
extends: BaseEvent
properties:
id: string
timestamp: string
body: commons.Observation
body: ObservationBody
ScoreEvent:
extends: BaseEvent
properties:
body: ScoreBody
SDKLogEvent:
extends: BaseEvent
properties:
body: SDKLogBody
CreateGenerationEvent:
extends: BaseEvent
properties:
body: CreateGenerationBody
UpdateGenerationEvent:
extends: BaseEvent
properties:
body: UpdateGenerationBody
CreateSpanEvent:
extends: BaseEvent
properties:
body: CreateSpanBody
UpdateSpanEvent:
extends: BaseEvent
properties:
body: UpdateSpanBody
CreateEventEvent:
extends: BaseEvent
properties:
body: CreateEventBody
IngestionSuccess:
properties:
id: string
timestamp: string
body: commons.Score
status: integer
IngestionError:
properties:
id: string
status: integer
message: optional<string>
error: optional<unknown>
IngestionResponse:
properties:
successes: list<IngestionSuccess>
errors: list<IngestionError>
+7 -2
View File
@@ -14,7 +14,7 @@ service:
observationId:
type: string
docs: The unique langfuse identifier of an observation, can be an event, span or generation
response: commons.Observation
response: commons.ObservationsView
getMany:
docs: Get a list of observations
method: GET
@@ -29,10 +29,15 @@ service:
type: optional<string>
traceId: optional<string>
parentObservationId: optional<string>
response: Observations
response: ObservationsViews
types:
Observations:
properties:
data: list<commons.Observation>
meta: pagination.MetaResponse
ObservationsViews:
properties:
data: list<commons.ObservationsView>
meta: pagination.MetaResponse
+36
View File
@@ -0,0 +1,36 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/fern-api/fern/main/fern.schema.json
imports:
commons: ./commons.yml
pagination: ./utils/pagination.yml
service:
auth: true
base-path: /api/public
endpoints:
get:
docs: Get a specific prompt
method: GET
path: /prompts
request:
name: GetParameterRequest
query-parameters:
name: string
version: optional<integer>
response: Prompt
create:
docs: Create a specific prompt
method: POST
path: /prompts
request: CreatePromptRequest
response: Prompt
types:
CreatePromptRequest:
properties:
name: string
isActive: boolean
prompt: string
Prompt:
properties:
name: string
version: integer
prompt: string
+17
View File
@@ -0,0 +1,17 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/fern-api/fern/main/fern.schema.json
imports:
pagination: ./utils/pagination.yml
commons: ./commons.yml
service:
auth: true
base-path: /api/public
endpoints:
get:
docs: Get a session
method: GET
path: /sessions/{sessionId}
path-parameters:
sessionId:
type: string
docs: The unique id of a session
response: commons.SessionWithTraces
-33
View File
@@ -1,33 +0,0 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/fern-api/fern/main/fern.schema.json
imports:
commons: ./commons.yml
service:
auth: true
base-path: /api/public
endpoints:
create:
docs: Add a span to the database
method: POST
path: /spans
request: commons.CreateSpanRequest
response: commons.Observation
update:
docs: Update a span to the database
method: PATCH
path: /spans
request: UpdateSpanRequest
response: commons.Observation
types:
UpdateSpanRequest:
properties:
spanId: string
traceId: optional<string>
endTime: optional<datetime>
name: optional<string>
metadata: optional<unknown>
input: optional<unknown>
output: optional<unknown>
level: optional<commons.ObservationLevel>
version: optional<string>
statusMessage: optional<string>
+10 -15
View File
@@ -6,12 +6,6 @@ service:
auth: true
base-path: /api/public
endpoints:
create:
docs: Add a trace to the database
method: POST
path: /traces
request: CreateTraceRequest
response: commons.Trace
get:
docs: Get a specific trace
method: GET
@@ -32,19 +26,20 @@ service:
limit: optional<integer>
userId: optional<string>
name: optional<string>
orderBy:
type: string
docs: Format of the string sort_by=timestamp.asc (id, timestamp, name, userId, release, version, public, bookmarked, sessionId)
tags:
type: optional<string>
allow-multiple: true
docs: Only traces that include all of these tags will be returned.
response: Traces
types:
CreateTraceRequest:
properties:
id: optional<string>
name: optional<string>
userId: optional<string>
externalId: optional<string>
release: optional<string>
version: optional<string>
metadata: optional<unknown>
Traces:
properties:
data: list<commons.TraceWithDetails>
meta: pagination.MetaResponse
Sort:
properties:
id: string
+4 -3
View File
@@ -11,13 +11,14 @@ groups:
namespaceExport: Langfuse
allowCustomFetcher: true
- name: fernapi/fern-python-sdk
version: 0.6.6
version: 0.7.3
output:
location: local-file-system
path: ../../../generated/python
config:
namespaceExport: Langfuse
allowCustomFetcher: true
client_class_name: FernLangfuse
pydantic_config:
require_optional_fields: false
- name: fernapi/fern-typescript-node-sdk
version: 0.7.1
output:
+1 -1
View File
@@ -1,4 +1,4 @@
{
"organization": "finto",
"version": "0.15.3"
"version": "0.16.36"
}
File diff suppressed because it is too large Load Diff
+138 -200
View File
@@ -2,7 +2,7 @@
"info": {
"name": "Langfuse",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
"description": null
"description": "## Authentication\n\nAuthenticate with the API using Basic Auth, get API keys in the project settings:\n\n- username: Langfuse Public Key\n- password: Langfuse Secret Key"
},
"variable": [
{
@@ -46,7 +46,7 @@
"_type": "endpoint",
"name": "Create",
"request": {
"description": "Create a dataset item",
"description": "Create a dataset item, upserts on id",
"url": {
"raw": "{{baseUrl}}/api/public/dataset-items",
"host": [
@@ -65,7 +65,7 @@
"auth": null,
"body": {
"mode": "raw",
"raw": "{\n \"datasetName\": \"example\",\n \"input\": \"UNKNOWN\",\n \"expectedOutput\": \"UNKNOWN\"\n}",
"raw": "{\n \"datasetName\": \"example\",\n \"input\": \"UNKNOWN\",\n \"expectedOutput\": \"UNKNOWN\",\n \"id\": \"example\"\n}",
"options": {
"raw": {
"language": "json"
@@ -74,6 +74,38 @@
}
},
"response": []
},
{
"_type": "endpoint",
"name": "Get",
"request": {
"description": "Get a specific dataset item",
"url": {
"raw": "{{baseUrl}}/api/public/dataset-items/:id",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"public",
"dataset-items",
":id"
],
"query": [],
"variable": [
{
"key": "id",
"value": "",
"description": null
}
]
},
"header": [],
"method": "GET",
"auth": null,
"body": null
},
"response": []
}
]
},
@@ -228,119 +260,6 @@
}
]
},
{
"_type": "container",
"description": null,
"name": "Event",
"item": [
{
"_type": "endpoint",
"name": "Create",
"request": {
"description": "Add an event to the database",
"url": {
"raw": "{{baseUrl}}/api/public/events",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"public",
"events"
],
"query": [],
"variable": []
},
"header": [],
"method": "POST",
"auth": null,
"body": {
"mode": "raw",
"raw": "{\n \"id\": \"example\",\n \"traceId\": \"example\",\n \"name\": \"example\",\n \"startTime\": \"1994-11-05T13:15:30Z\",\n \"metadata\": \"UNKNOWN\",\n \"input\": \"UNKNOWN\",\n \"output\": \"UNKNOWN\",\n \"level\": \"DEBUG\",\n \"statusMessage\": \"example\",\n \"parentObservationId\": \"example\",\n \"version\": \"example\"\n}",
"options": {
"raw": {
"language": "json"
}
}
}
},
"response": []
}
]
},
{
"_type": "container",
"description": null,
"name": "Generations",
"item": [
{
"_type": "endpoint",
"name": "Log",
"request": {
"description": null,
"url": {
"raw": "{{baseUrl}}/api/public/generations",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"public",
"generations"
],
"query": [],
"variable": []
},
"header": [],
"method": "POST",
"auth": null,
"body": {
"mode": "raw",
"raw": "{\n \"completionStartTime\": \"1994-11-05T13:15:30Z\",\n \"model\": \"example\",\n \"modelParameters\": {\n \"example\": \"example\"\n },\n \"prompt\": \"UNKNOWN\",\n \"completion\": \"UNKNOWN\",\n \"usage\": {\n \"promptTokens\": 0,\n \"completionTokens\": 0,\n \"totalTokens\": 0\n },\n \"endTime\": \"1994-11-05T13:15:30Z\",\n \"id\": \"example\",\n \"traceId\": \"example\",\n \"name\": \"example\",\n \"startTime\": \"1994-11-05T13:15:30Z\",\n \"metadata\": \"UNKNOWN\",\n \"input\": \"UNKNOWN\",\n \"output\": \"UNKNOWN\",\n \"level\": \"DEBUG\",\n \"statusMessage\": \"example\",\n \"parentObservationId\": \"example\",\n \"version\": \"example\"\n}",
"options": {
"raw": {
"language": "json"
}
}
}
},
"response": []
},
{
"_type": "endpoint",
"name": "Update",
"request": {
"description": null,
"url": {
"raw": "{{baseUrl}}/api/public/generations",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"public",
"generations"
],
"query": [],
"variable": []
},
"header": [],
"method": "PATCH",
"auth": null,
"body": {
"mode": "raw",
"raw": "{\n \"generationId\": \"example\",\n \"traceId\": \"example\",\n \"name\": \"example\",\n \"endTime\": \"1994-11-05T13:15:30Z\",\n \"completionStartTime\": \"1994-11-05T13:15:30Z\",\n \"model\": \"example\",\n \"modelParameters\": {\n \"example\": \"example\"\n },\n \"prompt\": \"UNKNOWN\",\n \"version\": \"example\",\n \"metadata\": \"UNKNOWN\",\n \"completion\": \"UNKNOWN\",\n \"usage\": {\n \"promptTokens\": 0,\n \"completionTokens\": 0,\n \"totalTokens\": 0\n },\n \"level\": \"DEBUG\",\n \"statusMessage\": \"example\"\n}",
"options": {
"raw": {
"language": "json"
}
}
}
},
"response": []
}
]
},
{
"_type": "container",
"description": null,
@@ -401,7 +320,7 @@
"auth": null,
"body": {
"mode": "raw",
"raw": "{\n \"batch\": [\n {\n \"type\": \"trace-create\",\n \"id\": \"example\",\n \"timestamp\": \"example\",\n \"body\": {\n \"id\": \"example\",\n \"timestamp\": \"1994-11-05T13:15:30Z\",\n \"name\": \"example\",\n \"release\": \"example\",\n \"version\": \"example\",\n \"userId\": \"example\",\n \"metadata\": \"UNKNOWN\"\n }\n }\n ]\n}",
"raw": "{\n \"batch\": [\n {\n \"type\": \"trace-create\",\n \"body\": {\n \"id\": \"example\",\n \"name\": \"example\",\n \"userId\": \"example\",\n \"input\": \"UNKNOWN\",\n \"output\": \"UNKNOWN\",\n \"sessionId\": \"example\",\n \"release\": \"example\",\n \"version\": \"example\",\n \"metadata\": \"UNKNOWN\",\n \"tags\": [\n \"example\"\n ],\n \"public\": true\n },\n \"id\": \"example\",\n \"timestamp\": \"example\",\n \"metadata\": \"UNKNOWN\"\n }\n ]\n}",
"options": {
"raw": {
"language": "json"
@@ -545,6 +464,82 @@
}
]
},
{
"_type": "container",
"description": null,
"name": "Prompts",
"item": [
{
"_type": "endpoint",
"name": "Get",
"request": {
"description": "Get a specific prompt",
"url": {
"raw": "{{baseUrl}}/api/public/prompts?name=&version=",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"public",
"prompts"
],
"query": [
{
"key": "name",
"value": "",
"description": null
},
{
"key": "version",
"value": "",
"description": null
}
],
"variable": []
},
"header": [],
"method": "GET",
"auth": null,
"body": null
},
"response": []
},
{
"_type": "endpoint",
"name": "Create",
"request": {
"description": "Create a specific prompt",
"url": {
"raw": "{{baseUrl}}/api/public/prompts",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"public",
"prompts"
],
"query": [],
"variable": []
},
"header": [],
"method": "POST",
"auth": null,
"body": {
"mode": "raw",
"raw": "{\n \"name\": \"example\",\n \"isActive\": true,\n \"prompt\": \"example\"\n}",
"options": {
"raw": {
"language": "json"
}
}
}
},
"response": []
}
]
},
{
"_type": "container",
"description": null,
@@ -634,71 +629,37 @@
{
"_type": "container",
"description": null,
"name": "Span",
"name": "Sessions",
"item": [
{
"_type": "endpoint",
"name": "Create",
"name": "Get",
"request": {
"description": "Add a span to the database",
"description": "Get a session",
"url": {
"raw": "{{baseUrl}}/api/public/spans",
"raw": "{{baseUrl}}/api/public/sessions/:sessionId",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"public",
"spans"
"sessions",
":sessionId"
],
"query": [],
"variable": []
"variable": [
{
"key": "sessionId",
"value": "",
"description": "The unique id of a session"
}
]
},
"header": [],
"method": "POST",
"method": "GET",
"auth": null,
"body": {
"mode": "raw",
"raw": "{\n \"endTime\": \"1994-11-05T13:15:30Z\",\n \"id\": \"example\",\n \"traceId\": \"example\",\n \"name\": \"example\",\n \"startTime\": \"1994-11-05T13:15:30Z\",\n \"metadata\": \"UNKNOWN\",\n \"input\": \"UNKNOWN\",\n \"output\": \"UNKNOWN\",\n \"level\": \"DEBUG\",\n \"statusMessage\": \"example\",\n \"parentObservationId\": \"example\",\n \"version\": \"example\"\n}",
"options": {
"raw": {
"language": "json"
}
}
}
},
"response": []
},
{
"_type": "endpoint",
"name": "Update",
"request": {
"description": "Update a span to the database",
"url": {
"raw": "{{baseUrl}}/api/public/spans",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"public",
"spans"
],
"query": [],
"variable": []
},
"header": [],
"method": "PATCH",
"auth": null,
"body": {
"mode": "raw",
"raw": "{\n \"spanId\": \"example\",\n \"traceId\": \"example\",\n \"endTime\": \"1994-11-05T13:15:30Z\",\n \"name\": \"example\",\n \"metadata\": \"UNKNOWN\",\n \"input\": \"UNKNOWN\",\n \"output\": \"UNKNOWN\",\n \"level\": \"DEBUG\",\n \"version\": \"example\",\n \"statusMessage\": \"example\"\n}",
"options": {
"raw": {
"language": "json"
}
}
}
"body": null
},
"response": []
}
@@ -709,39 +670,6 @@
"description": null,
"name": "Trace",
"item": [
{
"_type": "endpoint",
"name": "Create",
"request": {
"description": "Add a trace to the database",
"url": {
"raw": "{{baseUrl}}/api/public/traces",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"public",
"traces"
],
"query": [],
"variable": []
},
"header": [],
"method": "POST",
"auth": null,
"body": {
"mode": "raw",
"raw": "{\n \"id\": \"example\",\n \"name\": \"example\",\n \"userId\": \"example\",\n \"externalId\": \"example\",\n \"release\": \"example\",\n \"version\": \"example\",\n \"metadata\": \"UNKNOWN\"\n}",
"options": {
"raw": {
"language": "json"
}
}
}
},
"response": []
},
{
"_type": "endpoint",
"name": "Get",
@@ -780,7 +708,7 @@
"request": {
"description": "Get list of traces",
"url": {
"raw": "{{baseUrl}}/api/public/traces?page=&limit=&userId=&name=",
"raw": "{{baseUrl}}/api/public/traces?page=&limit=&userId=&name=&orderBy=&tags=",
"host": [
"{{baseUrl}}"
],
@@ -809,6 +737,16 @@
"key": "name",
"value": "",
"description": null
},
{
"key": "orderBy",
"value": "",
"description": "Format of the string sort_by=timestamp.asc (id, timestamp, name, userId, release, version, public, bookmarked, sessionId)"
},
{
"key": "tags",
"value": "",
"description": "Only traces that include all of these tags will be returned."
}
],
"variable": []
+6 -1
View File
@@ -18,6 +18,8 @@ const serverTestConfig = {
testEnvironment: "jest-environment-node",
};
// To avoid the "Cannot use import statement outside a module" errors while transforming ESM.
const esModules = ["superjson"];
// Add any custom config to be passed to Jest
/** @type {import('jest').Config} */
const config = {
@@ -26,7 +28,10 @@ const config = {
verbose: true,
projects: [
await createJestConfig(clientTestConfig)(),
await createJestConfig(serverTestConfig)(),
{
...(await createJestConfig(serverTestConfig)()),
transformIgnorePatterns: [`/node_modules/(?!(${esModules.join("|")})/)`],
},
],
};
+31 -21
View File
@@ -23,27 +23,37 @@ const nextConfig = {
output: "standalone",
async headers() {
// Required to check authentication status from langfuse.com
if (env.NEXT_PUBLIC_LANGFUSE_CLOUD_REGION !== undefined)
return [
{
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",
},
],
},
];
return [];
return [
{
source: "/:path*",
headers: [
{
key: "x-frame-options",
value: "SAMEORIGIN",
},
],
},
// 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",
},
]
},
] : []
)
]
},
// webassembly support for @dqbd/tiktoken
+4314 -2114
View File
File diff suppressed because it is too large Load Diff
+78 -62
View File
@@ -1,38 +1,46 @@
{
"name": "langfuse-core",
"version": "1.8.2",
"version": "2.2.0",
"private": true,
"scripts": {
"prebuild": "cp generated/openapi-client/openapi.yml public/openapi-client.yml && cp generated/openapi-server/openapi.yml public/openapi-server.yml",
"build": "next build",
"dev": "next dev",
"dx": "npm i && npm run db:reset && npm run db:seed:examples && npm run dev",
"postinstall": "prisma generate",
"lint": "next lint",
"lint:fix": "next lint --fix",
"prettier": "prettier --write ./src *.{ts,js}",
"clean": "rm -rf node_modules",
"start": "next start",
"test": "jest --runInBand",
"test:watch": "jest --watch --runInBand",
"test:e2e": "playwright test",
"db:migrate": "npx prisma migrate dev",
"infra:dev:up": "docker-compose -f docker-compose.dev.yml up -d",
"infra:dev:down": "docker-compose -f docker-compose.dev.yml down",
"db:migrate": "DISABLE_ERD=false npx prisma migrate dev",
"db:reset": "npx prisma migrate reset",
"db:seed": "npx prisma db seed",
"db:seed:examples": "npx prisma db seed -- --environment examples",
"release": "release-it"
"release": "release-it",
"models:migrate": "tsx scripts/model-match.ts"
},
"prisma": {
"seed": "ts-node -r tsconfig-paths/register --compiler-options {\"module\":\"CommonJS\"} prisma/seed.ts"
},
"dependencies": {
"@anthropic-ai/tokenizer": "^0.0.4",
"@emotion/react": "^11.11.1",
"@emotion/styled": "^11.11.0",
"@formkit/auto-animate": "^0.8.1",
"@headlessui/react": "^1.7.17",
"@heroicons/react": "^2.0.18",
"@hookform/resolvers": "^3.3.2",
"@aws-sdk/client-s3": "^3.507.0",
"@aws-sdk/s3-request-presigner": "^3.507.0",
"@headlessui/react": "^1.7.18",
"@heroicons/react": "^2.1.1",
"@hookform/resolvers": "^3.3.4",
"@next-auth/prisma-adapter": "^1.0.7",
"@prisma/client": "^5.6.0",
"@prisma/client": "^5.9.1",
"@radix-ui/react-accordion": "^1.1.2",
"@radix-ui/react-alert-dialog": "^1.0.5",
"@radix-ui/react-avatar": "^1.0.4",
"@radix-ui/react-checkbox": "^1.0.4",
"@radix-ui/react-collapsible": "^1.0.3",
"@radix-ui/react-dialog": "^1.0.5",
"@radix-ui/react-dropdown-menu": "^2.0.6",
@@ -40,6 +48,7 @@
"@radix-ui/react-icons": "^1.3.0",
"@radix-ui/react-label": "^2.0.2",
"@radix-ui/react-popover": "^1.0.7",
"@radix-ui/react-scroll-area": "^1.0.5",
"@radix-ui/react-select": "^2.0.0",
"@radix-ui/react-separator": "^1.0.3",
"@radix-ui/react-slider": "^1.1.2",
@@ -48,87 +57,89 @@
"@radix-ui/react-tabs": "^1.0.4",
"@radix-ui/react-toggle": "^1.0.3",
"@radix-ui/react-tooltip": "^1.0.7",
"@sentry/nextjs": "^7.83.0",
"@sentry/profiling-node": "^1.2.6",
"@t3-oss/env-nextjs": "^0.7.1",
"@react-email/components": "^0.0.14",
"@react-email/render": "^0.0.12",
"@sentry/nextjs": "^7.99.0",
"@sentry/profiling-node": "^1.3.5",
"@sentry/types": "^7.88.0",
"@t3-oss/env-nextjs": "^0.8.0",
"@tailwindcss/forms": "^0.5.7",
"@tailwindcss/line-clamp": "^0.4.4",
"@tanstack/react-query": "^4.36.1",
"@tanstack/react-table": "^8.10.7",
"@tanstack/react-table": "^8.11.8",
"@tremor/react": "^3.11.1",
"@trpc/client": "^10.44.1",
"@trpc/next": "^10.44.1",
"@trpc/react-query": "^10.44.1",
"@trpc/server": "^10.44.1",
"@trpc/client": "^10.45.0",
"@trpc/next": "^10.45.0",
"@trpc/react-query": "^10.45.0",
"@trpc/server": "^10.45.0",
"@vercel/edge-config": "^0.4.1",
"axios": "^1.6.2",
"bcryptjs": "^2.4.3",
"class-variance-authority": "^0.7.0",
"clsx": "^2.0.0",
"cmdk": "^0.2.0",
"clsx": "^2.1.0",
"cmdk": "^0.2.1",
"core-js": "^3.35.1",
"cors": "^2.8.5",
"date-fns": "^2.30.0",
"date-fns": "^3.3.1",
"decimal.js": "^10.4.3",
"exponential-backoff": "^3.1.1",
"js-yaml": "^4.1.0",
"js-tiktoken": "^1.0.10",
"lodash": "^4.17.21",
"lucide-react": "^0.294.0",
"next": "^14.0.3",
"lucide-react": "^0.323.0",
"next": "^14.1.0",
"next-auth": "^4.24.5",
"next-query-params": "^5.0.0",
"next-swagger-doc": "^0.4.0",
"posthog-js": "^1.93.3",
"posthog-node": "^3.1.3",
"nodemailer": "^6.9.9",
"posthog-js": "^1.104.4",
"posthog-node": "^3.6.2",
"react": "18.2.0",
"react-day-picker": "^8.9.1",
"react-day-picker": "^8.10.0",
"react-dom": "18.2.0",
"react-hook-form": "^7.48.2",
"react-icons": "^4.12.0",
"react-hook-form": "^7.50.1",
"react-icons": "^5.0.1",
"react-responsive": "^9.0.2",
"react18-json-view": "^0.2.7-canary.1",
"superagent": "^8.1.2",
"react18-json-view": "^0.2.7",
"superjson": "2.2.1",
"tailwind-merge": "^2.0.0",
"tailwind-merge": "^2.2.1",
"tailwindcss-animate": "^1.0.7",
"tiktoken": "^1.0.11",
"ts-pattern": "^5.0.5",
"use-query-params": "^2.2.1",
"uuid": "^9.0.1",
"zod": "^3.22.4"
},
"devDependencies": {
"@playwright/test": "^1.40.1",
"@jedmao/location": "^3.0.0",
"@mermaid-js/mermaid-cli": "^10.7.0",
"@playwright/test": "^1.41.2",
"@release-it/bumper": "^6.0.1",
"@testing-library/jest-dom": "^6.1.4",
"@testing-library/jest-dom": "^6.4.2",
"@testing-library/react": "^14.2.1",
"@types/bcryptjs": "^2.4.6",
"@types/cors": "^2.8.17",
"@types/eslint": "^8.44.7",
"@types/jest": "^29.5.10",
"@types/js-yaml": "^4.0.9",
"@types/eslint": "^8.56.2",
"@types/jest": "^29.5.12",
"@types/lodash": "^4.14.202",
"@types/node": "20.10.0",
"@types/react": "^18.2.39",
"@types/react-dom": "^18.2.17",
"@types/swagger-ui-react": "^4.18.3",
"@types/uuid": "^9.0.7",
"@typescript-eslint/eslint-plugin": "^6.13.1",
"@typescript-eslint/parser": "^6.13.1",
"autoprefixer": "^10.4.16",
"@types/node": "20.10.5",
"@types/nodemailer": "^6.4.14",
"@types/react": "^18.2.55",
"@types/react-dom": "^18.2.18",
"@types/uuid": "^9.0.8",
"@typescript-eslint/eslint-plugin": "^6.20.0",
"@typescript-eslint/parser": "^6.21.0",
"autoprefixer": "^10.4.17",
"dotenv-cli": "^7.3.0",
"eslint": "^8.54.0",
"eslint-config-next": "^14.0.3",
"eslint": "^8.56.0",
"eslint-config-next": "^14.1.0",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"postcss": "^8.4.31",
"prettier": "^3.1.0",
"prettier-plugin-tailwindcss": "^0.5.7",
"prisma": "^5.6.0",
"release-it": "^17.0.0",
"swagger-jsdoc": "^6.2.8",
"tailwindcss": "^3.3.5",
"ts-node": "^10.9.1",
"postcss": "^8.4.34",
"prettier": "^3.2.5",
"prettier-plugin-tailwindcss": "^0.5.11",
"prisma": "^5.9.1",
"prisma-erd-generator": "^1.11.2",
"release-it": "^17.0.3",
"tailwindcss": "^3.4.1",
"ts-node": "^10.9.2",
"tsconfig-paths": "^4.2.0",
"typescript": "^5.3.2"
"tsx": "^4.7.0",
"typescript": "^5.3.3"
},
"ct3aMetadata": {
"initVersion": "7.13.0"
@@ -145,7 +156,12 @@
"release": true,
"web": true,
"autoGenerate": true,
"releaseName": "v${version}"
"releaseName": "v${version}",
"comments": {
"submit": true,
"issue": ":rocket: _This issue has been resolved in v${version}. See [${releaseName}](${releaseUrl}) for release notes._",
"pr": ":rocket: _This pull request is included in v${version}. See [${releaseName}](${releaseUrl}) for release notes._"
}
},
"plugins": {
"@release-it/bumper": {
File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 194 KiB

@@ -0,0 +1,27 @@
-- CreateTable
CREATE TABLE "membership_invitations" (
"id" TEXT NOT NULL,
"email" TEXT NOT NULL,
"role" "MembershipRole" NOT NULL,
"project_id" TEXT NOT NULL,
"sender_id" TEXT,
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updated_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT "membership_invitations_pkey" PRIMARY KEY ("id")
);
-- CreateIndex
CREATE UNIQUE INDEX "membership_invitations_id_key" ON "membership_invitations"("id");
-- CreateIndex
CREATE INDEX "membership_invitations_project_id_idx" ON "membership_invitations"("project_id");
-- CreateIndex
CREATE INDEX "membership_invitations_email_idx" ON "membership_invitations"("email");
-- AddForeignKey
ALTER TABLE "membership_invitations" ADD CONSTRAINT "membership_invitations_project_id_fkey" FOREIGN KEY ("project_id") REFERENCES "projects"("id") ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "membership_invitations" ADD CONSTRAINT "membership_invitations_sender_id_fkey" FOREIGN KEY ("sender_id") REFERENCES "users"("id") ON DELETE SET NULL ON UPDATE CASCADE;
@@ -0,0 +1,34 @@
-- AlterTable
ALTER TABLE "traces" ADD COLUMN "input" JSONB,
ADD COLUMN "output" JSONB,
ADD COLUMN "session_id" TEXT;
-- CreateTable
CREATE TABLE "trace_sessions" (
"id" TEXT NOT NULL,
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updated_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"project_id" TEXT NOT NULL,
"bookmarked" BOOLEAN NOT NULL DEFAULT false,
"public" BOOLEAN NOT NULL DEFAULT false,
CONSTRAINT "trace_sessions_pkey" PRIMARY KEY ("id")
);
-- CreateIndex
CREATE INDEX "trace_sessions_project_id_idx" ON "trace_sessions"("project_id");
-- CreateIndex
CREATE INDEX "trace_sessions_created_at_idx" ON "trace_sessions"("created_at");
-- CreateIndex
CREATE UNIQUE INDEX "trace_sessions_id_project_id_key" ON "trace_sessions"("id", "project_id");
-- CreateIndex
CREATE INDEX "traces_session_id_idx" ON "traces"("session_id");
-- AddForeignKey
ALTER TABLE "trace_sessions" ADD CONSTRAINT "trace_sessions_project_id_fkey" FOREIGN KEY ("project_id") REFERENCES "projects"("id") ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "traces" ADD CONSTRAINT "traces_session_id_fkey" FOREIGN KEY ("session_id") REFERENCES "trace_sessions"("id") ON DELETE SET NULL ON UPDATE CASCADE;
@@ -0,0 +1,4 @@
-- AlterTable
-- Adding this migration does not lock the postgres table. For non volaitile data, the default value is stored in the
-- table metadata and accessed on read query time. No table re-write is required (https://www.postgresql.org/docs/current/sql-altertable.html#:~:text=When%20a%20column%20is%20added,is%20specified%2C%20NULL%20is%20used.)
ALTER TABLE "observations" ADD COLUMN "unit" TEXT NOT NULL DEFAULT 'TOKENS';
@@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE "projects" ADD COLUMN "cloud_config" JSONB;
@@ -0,0 +1,3 @@
-- AlterTable
ALTER TABLE "Account" ADD COLUMN "expires_in" INTEGER,
ADD COLUMN "ext_expires_in" INTEGER;
@@ -0,0 +1,29 @@
-- AlterTable
ALTER TABLE "observations" ADD COLUMN "prompt_id" TEXT;
-- CreateTable
CREATE TABLE "prompts" (
"id" TEXT NOT NULL,
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updated_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"project_id" TEXT NOT NULL,
"created_by" TEXT NOT NULL,
"prompt" TEXT NOT NULL,
"name" TEXT NOT NULL,
"version" INTEGER NOT NULL,
"is_active" BOOLEAN NOT NULL,
CONSTRAINT "prompts_pkey" PRIMARY KEY ("id")
);
-- CreateIndex
CREATE INDEX "prompts_project_id_name_version_idx" ON "prompts"("project_id", "name", "version");
-- CreateIndex
CREATE UNIQUE INDEX "prompts_project_id_name_version_key" ON "prompts"("project_id", "name", "version");
-- AddForeignKey
ALTER TABLE "observations" ADD CONSTRAINT "observations_prompt_id_fkey" FOREIGN KEY ("prompt_id") REFERENCES "prompts"("id") ON DELETE SET NULL ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "prompts" ADD CONSTRAINT "prompts_project_id_fkey" FOREIGN KEY ("project_id") REFERENCES "projects"("id") ON DELETE CASCADE ON UPDATE CASCADE;
@@ -0,0 +1,30 @@
-- Migration to add gpt-3.5-turbo-1106 and gpt-3.5-turbo-instruct models
INSERT INTO pricings (
id,
model_name,
pricing_unit,
price,
currency,
token_type
)
VALUES
('clqqpc2pr000008l3hvy63gxy','gpt-3.5-turbo-1106', 'PER_1000_TOKENS', 0.001, 'USD', 'PROMPT'),
('clqqpcb6d000208l3atrfbmou','gpt-3.5-turbo-1106', 'PER_1000_TOKENS', 0.002, 'USD', 'COMPLETION'),
('clqqpdh45000008lfgrnx76cv','gpt-3.5-turbo-instruct', 'PER_1000_TOKENS', 0.0015, 'USD', 'PROMPT'),
('clqqpdjya000108lf3s4b4c4m','gpt-3.5-turbo-instruct', 'PER_1000_TOKENS', 0.002, 'USD', 'COMPLETION'),
('clnnuiuq6000008l4dxp43wc6', 'claude-instant-1.2', 'PER_1000_TOKENS', 0.00163, 'USD', 'PROMPT'),
('clnnujlmj000108l48wne4ii9', 'claude-instant-1.2', 'PER_1000_TOKENS', 0.00551, 'USD', 'COMPLETION'),
('clnnukutg000208l49qqt9lyr', 'claude-instant-1.1', 'PER_1000_TOKENS', 0.00163, 'USD', 'PROMPT'),
('clnnun3x3000408l490qz9uv0', 'claude-instant-1.1', 'PER_1000_TOKENS', 0.00551, 'USD', 'COMPLETION'),
('clnnuosvy000508l4gsjy2pp4', 'claude-2.0', 'PER_1000_TOKENS', 0.01102, 'USD', 'PROMPT'),
('clnnuqcns000608l40qaz8trt', 'claude-2.0', 'PER_1000_TOKENS', 0.03268, 'USD', 'COMPLETION'),
('clnnuuif8000808l4gal4fjq4', 'claude-1.0', 'PER_1000_TOKENS', 0.01102, 'USD', 'PROMPT'),
('clnnutptp000708l47r091vvd', 'claude-1.0', 'PER_1000_TOKENS', 0.03268, 'USD', 'COMPLETION'),
('clnon8riv000308mlgfr1agiv', 'text-embedding-ada-002', 'PER_1000_TOKENS', 0.0001, 'USD', 'PROMPT'),
('clnon9kfz000408ml1bg81o6z', 'text-embedding-ada-002', 'PER_1000_TOKENS', 0.0001, 'USD', 'COMPLETION'),
('clqwniv8a000d08l2frjl7mmw', 'codechat-bison-32k', 'PER_1000_CHARS', 0.0005, 'USD', 'PROMPT'),
('clqwnj044000e08l2dfjm5g90', 'chat-bison-32k', 'PER_1000_CHARS', 0.0005, 'USD', 'PROMPT'),
('clqwnj47r000f08l2a16fekls', 'chat-bison-32k', 'PER_1000_CHARS', 0.0005, 'USD', 'COMPLETION'),
('clqwnj863000g08l2bwxgdapm', 'codechat-bison-32k', 'PER_1000_CHARS', 0.0005, 'USD', 'COMPLETION')
ON CONFLICT (id) DO NOTHING;
@@ -0,0 +1,3 @@
-- CreateIndex
CREATE INDEX CONCURRENTLY "observations_model_idx" ON "observations"("model");
@@ -0,0 +1,2 @@
-- CreateIndex
CREATE INDEX CONCURRENTLY "pricings_model_name_idx" ON "pricings"("model_name");
@@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE "traces" ADD COLUMN "tags" TEXT[] DEFAULT ARRAY[]::TEXT[];
@@ -0,0 +1,2 @@
-- CreateIndex
CREATE INDEX "traces_tags_idx" ON "traces" USING GIN ("tags" array_ops);
@@ -0,0 +1,8 @@
/*
Warnings:
- You are about to drop the column `status` on the `datasets` table. All the data in the column will be lost.
*/
-- AlterTable
ALTER TABLE "datasets" DROP COLUMN "status";
@@ -0,0 +1,16 @@
-- Migration to add gpt-35 spelling
INSERT INTO pricings (
id,
model_name,
pricing_unit,
price,
currency,
token_type
)
VALUES
('clqqpc2pr000008l3hvy63gxy1','gpt-35-turbo-1106', 'PER_1000_TOKENS', 0.001, 'USD', 'PROMPT'),
('clqqpcb6d000208l3atrfbmou1','gpt-35-turbo-1106', 'PER_1000_TOKENS', 0.002, 'USD', 'COMPLETION'),
('clqqpdh45000008lfgrnx76cv1','gpt-35-turbo-instruct', 'PER_1000_TOKENS', 0.0015, 'USD', 'PROMPT'),
('clqqpdjya000108lf3s4b4c4m1','gpt-35-turbo-instruct', 'PER_1000_TOKENS', 0.002, 'USD', 'COMPLETION')
ON CONFLICT (id) DO NOTHING;
@@ -0,0 +1,2 @@
-- DropIndex
DROP INDEX "traces_project_id_external_id_key";
@@ -0,0 +1,4 @@
-- AlterTable
ALTER TABLE "observations" ADD COLUMN "input_cost" DECIMAL(65,30),
ADD COLUMN "output_cost" DECIMAL(65,30),
ADD COLUMN "total_cost" DECIMAL(65,30);
@@ -0,0 +1,20 @@
-- CreateTable
CREATE TABLE "models" (
"id" TEXT NOT NULL,
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updated_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"project_id" TEXT,
"model_name" TEXT NOT NULL,
"match_pattern" TEXT NOT NULL,
"start_date" TIMESTAMP(3),
"input_price" DECIMAL(65,30),
"output_price" DECIMAL(65,30),
"total_price" DECIMAL(65,30),
"unit" TEXT NOT NULL DEFAULT 'TOKENS',
"tokenizer_config" JSONB NOT NULL,
CONSTRAINT "models_pkey" PRIMARY KEY ("id")
);
-- AddForeignKey
ALTER TABLE "models" ADD CONSTRAINT "models_project_id_fkey" FOREIGN KEY ("project_id") REFERENCES "projects"("id") ON DELETE CASCADE ON UPDATE CASCADE;
@@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE "observations" ADD COLUMN "internal_model" TEXT;
@@ -0,0 +1,49 @@
CREATE VIEW "observations_view" AS
SELECT
o.*,
m.id AS "model_id",
m.start_date AS "model_start_date",
m.input_price,
m.output_price,
m.total_price,
m.tokenizer_config AS "tokenizer_config",
CASE
WHEN o.input_cost IS NULL AND o.output_cost IS NULL AND o.total_cost IS NULL THEN
o.prompt_tokens::decimal * m.input_price
ELSE
o.input_cost
END AS "calculated_input_cost",
CASE
WHEN o.input_cost IS NULL AND o.output_cost IS NULL AND o.total_cost IS NULL THEN
o.completion_tokens::decimal * m.output_price
ELSE
o.output_cost
END AS "calculated_output_cost",
CASE
WHEN o.input_cost IS NULL AND o.output_cost IS NULL AND o.total_cost IS NULL THEN
CASE
WHEN m.total_price IS NOT NULL AND o.total_tokens IS NOT NULL THEN
m.total_price * o.total_tokens
ELSE
o.prompt_tokens::decimal * m.input_price +
o.completion_tokens::decimal * m.output_price
END
ELSE
o.total_cost
END AS "calculated_total_cost"
FROM
observations o
LEFT JOIN models m ON m.id = (
SELECT
id
FROM
models
WHERE (project_id = o.project_id OR project_id IS NULL)
AND model_name = o.internal_model
AND (start_date < o.start_time OR start_date is NULL)
AND o.unit::TEXT = unit
ORDER BY
project_id ASC, -- in postgres, NULLs are sorted first
start_date DESC
LIMIT 1
)
@@ -0,0 +1,11 @@
/*
Warnings:
- A unique constraint covering the columns `[project_id,model_name,start_date,unit]` on the table `models` will be added. If there are existing duplicate values, this will fail.
*/
-- CreateIndex
CREATE INDEX "models_project_id_model_name_idx" ON "models"("project_id", "model_name");
-- CreateIndex
CREATE UNIQUE INDEX "models_project_id_model_name_start_date_unit_key" ON "models"("project_id", "model_name", "start_date", "unit");
@@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE "models" ADD COLUMN "tokenizer_id" TEXT;
@@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE "models" ALTER COLUMN "tokenizer_config" DROP NOT NULL;
@@ -0,0 +1,84 @@
-- This is an empty migration.
INSERT INTO models (
id,
project_id,
model_name,
match_pattern,
start_date,
input_price,
output_price,
total_price,
unit,
tokenizer_id,
tokenizer_config
)
VALUES
--project_id, model_name, match_pattern, start_date, input_price, output_price, total_price, unit, tokenizer_id, tokenizer_config
--https://openai.com/pricing
-- GPT-4 Turbo
('clrkvq6iq000008ju6c16gynt', NULL, 'gpt-4-turbo', '(?i)^(gpt-4-1106-preview)$', NULL, 0.00001, 0.00003, NULL, 'TOKENS', 'openai', '{ "tokensPerMessage": 3, "tokensPerName": 1, "tokenizerModel": "gpt-4-1106-preview" }'),
('clrkvx5gp000108juaogs54ea', NULL, 'gpt-4-turbo-vision', '(?i)^(gpt-4-vision-preview)$', NULL, 0.00001, 0.00003, NULL, 'TOKENS', 'openai', '{ "tokensPerMessage": 3, "tokensPerName": 1, "tokenizerModel": "gpt-4-vision-preview" }'),
-- GPT-4
('clrntkjgy000f08jx79v9g1xj', NULL, 'gpt-4', '(?i)^(gpt-4)$', NULL, 0.00003, 0.00006, NULL, 'TOKENS', 'openai', '{ "tokensPerMessage": 3, "tokensPerName": 1, "tokenizerModel": "gpt-4" }'),
('clrkwk4cc000908l537kl0rx3', NULL, 'gpt-4-0613', '(?i)^(gpt-4-0613)$', NULL, 0.00003, 0.00006, NULL, 'TOKENS', 'openai', '{ "tokensPerMessage": 3, "tokensPerName": 1, "tokenizerModel": "gpt-4-0613" }'),
('clrntkjgy000e08jx4x6uawoo', NULL, 'gpt-4-0314', '(?i)^(gpt-4-0314)$', NULL, 0.00003, 0.00006, NULL, 'TOKENS', 'openai', '{ "tokensPerMessage": 3, "tokensPerName": 1, "tokenizerModel": "gpt-4-0314" }'),
('clrkvyzgw000308jue4hse4j9', NULL, 'gpt-4-32k', '(?i)^(gpt-4-32k)$', NULL, 0.00006, 0.00012, NULL, 'TOKENS', 'openai', '{ "tokensPerMessage": 3, "tokensPerName": 1, "tokenizerModel": "gpt-4-32k" }'),
('clrkwk4cb000108l5hwwh3zdi', NULL, 'gpt-4-32k-0613', '(?i)^(gpt-4-32k-0613)$', NULL, 0.00006, 0.00012, NULL, 'TOKENS', 'openai', '{ "tokensPerMessage": 3, "tokensPerName": 1, "tokenizerModel": "gpt-4-32k-0613" }'),
('clrntkjgy000d08jx0p4y9h4l', NULL, 'gpt-4-32k-0314', '(?i)^(gpt-4-32k-0314)$', NULL, 0.00006, 0.00012, NULL, 'TOKENS', 'openai', '{ "tokensPerMessage": 3, "tokensPerName": 1, "tokenizerModel": "gpt-4-32k-0314" }'),
-- GPT 3
('clrkwk4cc000a08l562uc3s9g', NULL, 'gpt-3.5-turbo-instruct', '(?i)^(gpt-)(35|3.5)(-turbo-instruct)$', NULL, 0.0000015, 0.000002, NULL, 'TOKENS', 'openai', '{ "tokensPerMessage": 3, "tokensPerName": 1, "tokenizerModel": "gpt-3.5-turbo" }'),
('clrkwk4cb000408l576jl7koo', NULL, 'gpt-3.5-turbo', '(?i)^(gpt-)(35|3.5)(-turbo)$', '2023-11-06', 0.000001, 0.000002, NULL, 'TOKENS', 'openai', '{ "tokensPerMessage": 3, "tokensPerName": 1, "tokenizerModel": "gpt-3.5-turbo" }'),
('clrkwk4cb000208l59yvb9yq8', NULL, 'gpt-3.5-turbo-1106', '(?i)^(gpt-)(35|3.5)(-turbo-1106)$', NULL, 0.000001, 0.000002, NULL, 'TOKENS', 'openai', '{ "tokensPerMessage": 3, "tokensPerName": 1, "tokenizerModel": "gpt-3.5-turbo-1106" }'),
('clrntkjgy000c08jxesb30p3f', NULL, 'gpt-3.5-turbo', '(?i)^(gpt-)(35|3.5)(-turbo)$', '2023-06-27', 0.0000015, 0.000002, NULL, 'TOKENS', 'openai', '{ "tokensPerMessage": 3, "tokensPerName": 1, "tokenizerModel": "gpt-3.5-turbo" }'),
('clrkwk4cc000808l51xmk4uic', NULL, 'gpt-3.5-turbo-0613', '(?i)^(gpt-)(35|3.5)(-turbo-0613)$', NULL, 0.0000015, 0.000002, NULL, 'TOKENS', 'openai', '{ "tokensPerMessage": 3, "tokensPerName": 1, "tokenizerModel": "gpt-3.5-turbo-0613" }'),
('clrntkjgy000b08jx769q1bah', NULL, 'gpt-3.5-turbo', '(?i)^(gpt-)(35|3.5)(-turbo)$', NULL, 0.000002, 0.000002, NULL, 'TOKENS', 'openai', '{ "tokensPerMessage": 4, "tokensPerName": -1, "tokenizerModel": "gpt-3.5-turbo" }'),
('clrntkjgy000a08jx4e062mr0', NULL, 'gpt-3.5-turbo-0301', '(?i)^(gpt-)(35|3.5)(-turbo-0301)$', NULL, 0.000002, 0.000002, NULL, 'TOKENS', 'openai', '{ "tokensPerMessage": 4, "tokensPerName": -1, "tokenizerModel": "gpt-3.5-turbo-0301" }'),
('clrkwk4cb000308l5go4b6otm', NULL, 'gpt-3.5-turbo-16k', '(?i)^(gpt-)(35|3.5)(-turbo-16k)$', NULL, 0.00003, 0.00004, NULL, 'TOKENS', 'openai', '{ "tokensPerMessage": 3, "tokensPerName": 1, "tokenizerModel": "gpt-3.5-turbo-16k" }'),
('clrntjt89000a08jw0gcdbd5a', NULL, 'gpt-3.5-turbo-16k-0613', '(?i)^(gpt-)(35|3.5)(-turbo-16k-0613)$', NULL, 0.00003, 0.00004, NULL, 'TOKENS', 'openai', '{ "tokensPerMessage": 3, "tokensPerName": 1, "tokenizerModel": "gpt-3.5-turbo-16k-0613" }'),
-- nothing earlier required for ada
('clrntjt89000908jwhvkz5crm', NULL, 'text-embedding-ada-002', '(?i)^(text-embedding-ada-002)$', '2022-12-06', NULL, NULL, 0.0000001, 'TOKENS', 'openai', NULL),
('clrntjt89000908jwhvkz5crg', NULL, 'text-embedding-ada-002-v2', '(?i)^(text-embedding-ada-002-v2)$', '2022-12-06', NULL, NULL, 0.0000001, 'TOKENS', 'openai', NULL),
-- legacy price 2023-08-22 https://platform.openai.com/docs/deprecations/2023-07-06-gpt-and-embeddings
('clrntjt89000108jwcou1af71', NULL, 'text-ada-001', '(?i)^(text-ada-001)$', NULL, NULL, NULL, 0.000004, 'TOKENS', 'openai', NULL),
('clrntjt89000208jwawjr894q', NULL, 'text-babbage-001', '(?i)^(text-babbage-001)$', NULL, NULL, NULL, 0.0000005, 'TOKENS', 'openai', NULL),
('clrp1wopz000708l079w02hkc', NULL, 'text-babbage-002', '(?i)^(text-babbage-002)$', NULL, NULL, NULL, 0.0000005, 'TOKENS', 'openai', NULL),
('clrntjt89000308jw0jtfa4rs', NULL, 'text-curie-001', '(?i)^(text-curie-001)$', NULL, NULL, NULL, 0.00002, 'TOKENS', 'openai', NULL),
('clrntjt89000408jwc2c93h6i', NULL, 'text-davinci-001', '(?i)^(text-davinci-001)$', NULL, NULL, NULL, 0.00002, 'TOKENS', 'openai', NULL),
('clrntjt89000508jw192m64qi', NULL, 'text-davinci-002', '(?i)^(text-davinci-002)$', NULL, NULL, NULL, 0.00002, 'TOKENS', 'openai', NULL),
('clrntjt89000608jw4m3x5s55', NULL, 'text-davinci-003', '(?i)^(text-davinci-003)$', NULL, NULL, NULL, 0.00002, 'TOKENS', 'openai', NULL),
-- claude
('clrnwbota000908jsgg9mb1ml', NULL, 'claude-instant-1', '(?i)^(claude-instant-1)$', NULL, 0.00000163, 0.00000551, NULL, 'CHARACTERS', 'claude', NULL),
('clrnwb41q000308jsfrac9uh6', NULL, 'claude-instant-1.2', '(?i)^(claude-instant-1.2)$', NULL, 0.00000163, 0.00000551, NULL, 'CHARACTERS', 'claude', NULL),
('clrnwbd1m000508js4hxu6o7n', NULL, 'claude-2.1', '(?i)^(claude-2.1)$', NULL, 0.000008, 0.000024, NULL, 'CHARACTERS', 'claude', NULL),
('clrnwb836000408jsallr6u11', NULL, 'claude-2.0', '(?i)^(claude-2.0)$', NULL, 0.000008, 0.000024, NULL, 'CHARACTERS', 'claude', NULL),
('clrnwbg2b000608jse2pp4q2d', NULL, 'claude-1.3', '(?i)^(claude-1.3)$', NULL, 0.000008, 0.000024, NULL, 'CHARACTERS', 'claude', NULL),
('clrnwbi9d000708jseiy44k26', NULL, 'claude-1.2', '(?i)^(claude-1.2)$', NULL, 0.000008, 0.000024, NULL, 'CHARACTERS', 'claude', NULL),
('clrnwblo0000808jsc1385hdp', NULL, 'claude-1.1', '(?i)^(claude-1.1)$', NULL, 0.000008, 0.000024, NULL, 'CHARACTERS', 'claude', NULL),
-- vertex
('clrp1wopz000808l09nwy32xh', NULL, 'codechat-bison-32k', '(?i)^(codechat-bison-32k)$', NULL, 0.0000005, 0.0000025, NULL, 'TOKENS', 'vertex', NULL),
('clrp1wopz000408l05xcycki1', NULL, 'chat-bison-32k', '(?i)^(chat-bison-32k)$', NULL, 0.0000005, 0.0000025, NULL, 'TOKENS', 'vertex', NULL)
@@ -0,0 +1,18 @@
/*
Warnings:
- The primary key for the `trace_sessions` table will be changed. If it partially fails, the table could be left without primary key constraint.
*/
-- DropForeignKey
ALTER TABLE "traces" DROP CONSTRAINT "traces_session_id_fkey";
-- DropIndex
DROP INDEX "trace_sessions_id_project_id_key";
-- AlterTable
ALTER TABLE "trace_sessions" DROP CONSTRAINT "trace_sessions_pkey",
ADD CONSTRAINT "trace_sessions_pkey" PRIMARY KEY ("id", "project_id");
-- AddForeignKey
ALTER TABLE "traces" ADD CONSTRAINT "traces_session_id_project_id_fkey" FOREIGN KEY ("session_id", "project_id") REFERENCES "trace_sessions"("id", "project_id") ON DELETE RESTRICT ON UPDATE CASCADE;
@@ -0,0 +1,42 @@
-- This is an empty migration.
DELETE FROM models
WHERE id in ('clrntjt89000908jwhvkz5crm', 'clrntjt89000908jwhvkz5crg', 'clrntjt89000108jwcou1af71', 'clrntjt89000208jwawjr894q', 'clrntjt89000308jw0jtfa4rs', 'clrntjt89000408jwc2c93h6i', 'clrntjt89000508jw192m64qi', 'clrntjt89000608jw4m3x5s55', 'clrp1wopz000708l079w02hkc');
INSERT INTO models (
id,
project_id,
model_name,
match_pattern,
start_date,
input_price,
output_price,
total_price,
unit,
tokenizer_id,
tokenizer_config
)
VALUES
-- nothing earlier required for ada
('clrntjt89000908jwhvkz5crm', NULL, 'text-embedding-ada-002', '(?i)^(text-embedding-ada-002)$', '2022-12-06', NULL, NULL, 0.0000001, 'TOKENS', 'openai', '{"tokenizerModel": "text-embedding-ada-002"}'),
('clrntjt89000908jwhvkz5crg', NULL, 'text-embedding-ada-002-v2', '(?i)^(text-embedding-ada-002-v2)$', '2022-12-06', NULL, NULL, 0.0000001, 'TOKENS', 'openai', '{"tokenizerModel": "text-embedding-ada-002"}'),
-- -- legacy price 2023-08-22 https://platform.openai.com/docs/deprecations/2023-07-06-gpt-and-embeddings
('clrntjt89000108jwcou1af71', NULL, 'text-ada-001', '(?i)^(text-ada-001)$', NULL, NULL, NULL, 0.000004, 'TOKENS', 'openai', '{"tokenizerModel": "text-ada-001"}'),
('clrntjt89000208jwawjr894q', NULL, 'text-babbage-001', '(?i)^(text-babbage-001)$', NULL, NULL, NULL, 0.0000005, 'TOKENS', 'openai', '{"tokenizerModel": "text-babbage-001"}'),
('clrntjt89000308jw0jtfa4rs', NULL, 'text-curie-001', '(?i)^(text-curie-001)$', NULL, NULL, NULL, 0.00002, 'TOKENS', 'openai', '{"tokenizerModel": "text-curie-001"}'),
('clrntjt89000408jwc2c93h6i', NULL, 'text-davinci-001', '(?i)^(text-davinci-001)$', NULL, NULL, NULL, 0.00002, 'TOKENS', 'openai', '{"tokenizerModel": "text-davinci-001"}'),
('clrntjt89000508jw192m64qi', NULL, 'text-davinci-002', '(?i)^(text-davinci-002)$', NULL, NULL, NULL, 0.00002, 'TOKENS', 'openai', '{"tokenizerModel": "text-davinci-002"}'),
('clrntjt89000608jw4m3x5s55', NULL, 'text-davinci-003', '(?i)^(text-davinci-003)$', NULL, NULL, NULL, 0.00002, 'TOKENS', 'openai', '{"tokenizerModel": "text-davinci-003"}'),
('clrs2dnql000108l46vo0gp2t', NULL, 'babbage-002', '(?i)^(babbage-002)$', NULL, 0.0000004, 0.0000016, 0.0000005, 'TOKENS', 'openai', '{"tokenizerModel": "babbage-002"}'),
('clrs2ds35000208l4g4b0hi3u', NULL, 'davinci-002', '(?i)^(davinci-002)$', NULL, 0.0000060, 0.0000120, 0.0000005, 'TOKENS', 'openai', '{"tokenizerModel": "davinci-002"}')
@@ -0,0 +1,39 @@
-- This is an empty migration.
DELETE FROM models
WHERE id in ('clrp1wopz000808l09nwy32xh', 'clrp1wopz000408l05xcycki1','clrs2dnql000108l46vo0gp2t', 'clrs2ds35000208l4g4b0hi3u');
INSERT INTO models (
id,
project_id,
model_name,
match_pattern,
start_date,
input_price,
output_price,
total_price,
unit,
tokenizer_id,
tokenizer_config
)
VALUES
-- https://openai.com/blog/new-embedding-models-and-api-updates
-- tokenizers are best guess for embedding models
('clruwn3pc00010al7bl611c8o', NULL, 'text-embedding-3-small', '(?i)^(text-embedding-3-small)$', NULL, NULL, NULL, 0.00000002, 'TOKENS', 'openai', '{"tokenizerModel": "text-embedding-ada-002"}'),
('clruwn76700020al7gp8e4g4l', NULL, 'text-embedding-ada-002-v2', '(?i)^(text-embedding-3-large)$', NULL, NULL, NULL, 0.00000013, 'TOKENS', 'openai', '{"tokenizerModel": "text-embedding-ada-002"}'),
('clruwnahl00030al7ab9rark7', NULL, 'gpt-3.5-turbo-0125', '(?i)^(gpt-)(35|3.5)(-turbo-0125)$', NULL, 0.0000005, 0.0000015, NULL, 'TOKENS', 'openai', '{ "tokensPerMessage": 3, "tokensPerName": 1, "tokenizerModel": "gpt-3.5-turbo" }'),
('clruwnahl00040al78f1lb0at', NULL, 'gpt-3.5-turbo', '(?i)^(gpt-)(35|3.5)(-turbo)$', '2024-02-08', 0.0000005, 0.0000015, NULL, 'TOKENS', 'openai', '{ "tokensPerMessage": 3, "tokensPerName": 1, "tokenizerModel": "gpt-3.5-turbo" }'),
('clruwnahl00050al796ck3p44', NULL, 'gpt-4-0125-preview', '(?i)^(gpt-4-0125-preview)$', NULL, 0.00001, 0.00003, NULL, 'TOKENS', 'openai', '{ "tokensPerMessage": 3, "tokensPerName": 1, "tokenizerModel": "gpt-4" }'),
('clruwnahl00060al74fcfehas', NULL, 'gpt-4-turbo-preview', '(?i)^(gpt-4-turbo-preview)$', NULL, 0.00003, 0.00006, NULL, 'TOKENS', 'openai', '{ "tokensPerMessage": 3, "tokensPerName": 1, "tokenizerModel": "gpt-4" }'),
-- fix tokenizer for vertx
('clrp1wopz000808l09nwy32xh', NULL, 'codechat-bison-32k', '(?i)^(codechat-bison-32k)$', NULL, 0.0000005, 0.0000025, NULL, 'TOKENS', NULL, NULL),
('clrp1wopz000408l05xcycki1', NULL, 'chat-bison-32k', '(?i)^(chat-bison-32k)$', NULL, 0.0000005, 0.0000025, NULL, 'TOKENS', NULL, NULL),
-- fix prices
('clrs2dnql000108l46vo0gp2t', NULL, 'babbage-002', '(?i)^(babbage-002)$', NULL, 0.0000004, 0.0000016, NULL, 'TOKENS', 'openai', '{"tokenizerModel": "babbage-002"}'),
('clrs2ds35000208l4g4b0hi3u', NULL, 'davinci-002', '(?i)^(davinci-002)$', NULL, 0.0000060, 0.0000120, NULL, 'TOKENS', 'openai', '{"tokenizerModel": "davinci-002"}')
@@ -0,0 +1,6 @@
-- AlterTable
ALTER TABLE "models" ALTER COLUMN "unit" DROP DEFAULT;
-- AlterTable
ALTER TABLE "observations" ALTER COLUMN "unit" DROP NOT NULL,
ALTER COLUMN "unit" DROP DEFAULT;
@@ -0,0 +1,40 @@
-- This is an empty migration.
DELETE FROM models
WHERE id in (
'clrnwbota000908jsgg9mb1ml',
'clrnwb41q000308jsfrac9uh6',
'clrnwbd1m000508js4hxu6o7n',
'clrnwb836000408jsallr6u11',
'clrnwbg2b000608jse2pp4q2d',
'clrnwbi9d000708jseiy44k26',
'clrnwblo0000808jsc1385hdp'
);
INSERT INTO models (
id,
project_id,
model_name,
match_pattern,
start_date,
input_price,
output_price,
total_price,
unit,
tokenizer_id,
tokenizer_config
)
VALUES
-- nothing earlier required for ada
('clrnwbota000908jsgg9mb1ml', NULL, 'claude-instant-1', '(?i)^(claude-instant-1)$', NULL, 0.00000163, 0.00000551, NULL, 'TOKENS', 'claude', NULL),
('clrnwb41q000308jsfrac9uh6', NULL, 'claude-instant-1.2', '(?i)^(claude-instant-1.2)$', NULL, 0.00000163, 0.00000551, NULL, 'TOKENS', 'claude', NULL),
('clrnwbd1m000508js4hxu6o7n', NULL, 'claude-2.1', '(?i)^(claude-2.1)$', NULL, 0.000008, 0.000024, NULL, 'TOKENS', 'claude', NULL),
('clrnwb836000408jsallr6u11', NULL, 'claude-2.0', '(?i)^(claude-2.0)$', NULL, 0.000008, 0.000024, NULL, 'TOKENS', 'claude', NULL),
('clrnwbg2b000608jse2pp4q2d', NULL, 'claude-1.3', '(?i)^(claude-1.3)$', NULL, 0.000008, 0.000024, NULL, 'TOKENS', 'claude', NULL),
('clrnwbi9d000708jseiy44k26', NULL, 'claude-1.2', '(?i)^(claude-1.2)$', NULL, 0.000008, 0.000024, NULL, 'TOKENS', 'claude', NULL),
('clrnwblo0000808jsc1385hdp', NULL, 'claude-1.1', '(?i)^(claude-1.1)$', NULL, 0.000008, 0.000024, NULL, 'TOKENS', 'claude', NULL)
@@ -0,0 +1,40 @@
DELETE FROM models
WHERE id in ('clrp1wopz000808l09nwy32xh', 'clrp1wopz000408l05xcycki1');
INSERT INTO models (
id,
project_id,
model_name,
match_pattern,
start_date,
input_price,
output_price,
total_price,
unit,
tokenizer_id,
tokenizer_config
)
VALUES
-- https://openai.com/blog/new-embedding-models-and-api-updates
-- https://openai.com/blog/gpt-3-5-turbo-fine-tuning-and-api-updates
-- ft model tokens are getting counted like the base model https://github.com/openai/tiktoken/blob/db5bda9fc93b3171db6c4afea329394e6b6d31ca/tiktoken/model.py
('cls08r8sq000308jq14ae96f0', NULL, 'ft:gpt-3.5-turbo-1106', '(?i)^(ft:)(gpt-3.5-turbo-1106:)(.+)(:)(.*)(:)(.+)$', NULL, 0.000003, 0.000006, NULL, 'TOKENS', 'openai', '{"tokensPerName": 1, "tokenizerModel": "gpt-3.5-turbo-1106", "tokensPerMessage": 3}'),
('cls08rp99000408jqepxoakjv', NULL, 'ft:gpt-3.5-turbo-0613', '(?i)^(ft:)(gpt-3.5-turbo-0613:)(.+)(:)(.*)(:)(.+)$', NULL, 0.000012, 0.000016, NULL, 'TOKENS', 'openai', '{"tokensPerName": 1, "tokenizerModel": "gpt-3.5-turbo-0613", "tokensPerMessage": 3}'),
('cls08rv9g000508jq5p4z4nlr', NULL, 'ft:davinci-002', '(?i)^(ft:)(davinci-002:)(.+)(:)(.*)(:)(.+)$$', NULL, 0.000012, 0.000012, NULL, 'TOKENS', 'openai', '{"tokenizerModel": "davinci-002"}'),
('cls08s2bw000608jq57wj4un2', NULL, 'ft:babbage-002', '(?i)^(ft:)(babbage-002:)(.+)(:)(.*)(:)(.+)$$', NULL, 0.0000016, 0.0000016, NULL, 'TOKENS', 'openai', '{"tokenizerModel": "babbage-002"}'),
-- https://cloud.google.com/vertex-ai/docs/generative-ai/pricing
('cls0k4lqt000008ky1o1s8wd5', NULL, 'gemini-pro', '(?i)^(gemini-pro)(@[a-zA-Z0-9]+)?$', NULL, 0.00000025, 0.0000005, NULL, 'CHARACTERS', NULL, NULL),
('cls0jni4t000008jk3kyy803r', NULL, 'chat-bison-32k', '(?i)^(chat-bison-32k)(@[a-zA-Z0-9]+)?$', NULL, 0.00000025, 0.0000005, NULL, 'CHARACTERS', NULL, NULL),
('cls0iv12d000108l251gf3038', NULL, 'chat-bison', '(?i)^(chat-bison)(@[a-zA-Z0-9]+)?$', NULL, 0.00000025, 0.0000005, NULL, 'CHARACTERS', NULL, NULL),
('cls0jmjt3000108l83ix86w0d', NULL, 'text-bison-32k', '(?i)^(text-bison-32k)(@[a-zA-Z0-9]+)?$', NULL, 0.00000025, 0.0000005, NULL, 'CHARACTERS', NULL, NULL),
('cls0juygp000308jk2a6x9my2', NULL, 'text-bison', '(?i)^(text-bison)(@[a-zA-Z0-9]+)?$', NULL, 0.00000025, 0.0000005, NULL, 'CHARACTERS', NULL, NULL),
('cls0jungb000208jk12gm4gk1', NULL, 'text-unicorn', '(?i)^(text-unicorn)(@[a-zA-Z0-9]+)?$', NULL, 0.0000025, 0.0000075, NULL, 'CHARACTERS', NULL, NULL),
('cls1nyj5q000208l33ne901d8', NULL, 'textembedding-gecko', '(?i)^(textembedding-gecko)(@[a-zA-Z0-9]+)?$', NULL, NULL, NULL, 0.0000001, 'CHARACTERS', NULL, NULL),
('cls1nyyjp000308l31gxy1bih', NULL, 'textembedding-gecko-multilingual', '(?i)^(textembedding-gecko-multilingual)(@[a-zA-Z0-9]+)?$', NULL, NULL, NULL, 0.0000001, 'CHARACTERS', NULL, NULL),
('cls1nzjt3000508l3dnwad3g0', NULL, 'code-gecko', '(?i)^(code-gecko)(@[a-zA-Z0-9]+)?$', NULL, 0.00000025, 0.0000005, NULL, 'CHARACTERS', NULL, NULL),
('cls1nzwx4000608l38va7e4tv', NULL, 'code-bison', '(?i)^(code-bison)(@[a-zA-Z0-9]+)?$', NULL, 0.00000025, 0.0000005, NULL, 'CHARACTERS', NULL, NULL),
('cls1o053j000708l39f8g4bgs', NULL, 'code-bison-32k', '(?i)^(code-bison-32k)(@[a-zA-Z0-9]+)?$', NULL, 0.00000025, 0.0000005, NULL, 'CHARACTERS', NULL, NULL),
('cls0j33v1000008joagkc4lql', NULL, 'codechat-bison-32k', '(?i)^(codechat-bison-32k)(@[a-zA-Z0-9]+)?$', NULL, 0.00000025, 0.0000005, NULL, 'CHARACTERS', NULL, NULL),
('cls0jmc9v000008l8ee6r3gsd', NULL, 'codechat-bison', '(?i)^(codechat-bison)(@[a-zA-Z0-9]+)?$', NULL, 0.00000025, 0.0000005, NULL, 'CHARACTERS', NULL, NULL)
@@ -0,0 +1,27 @@
-- This is an empty migration.
DELETE FROM models
WHERE id in ('clrkwk4cb000308l5go4b6otm', 'clrntjt89000a08jw0gcdbd5a');
INSERT INTO models (
id,
project_id,
model_name,
match_pattern,
start_date,
input_price,
output_price,
total_price,
unit,
tokenizer_id,
tokenizer_config
)
VALUES
-- https://openai.com/blog/new-embedding-models-and-api-updates
-- fix prices
('clrkwk4cb000308l5go4b6otm', NULL, 'gpt-3.5-turbo-16k', '(?i)^(gpt-)(35|3.5)(-turbo-16k)$', NULL, 0.000003, 0.000004, NULL, 'TOKENS', 'openai', '{ "tokensPerMessage": 3, "tokensPerName": 1, "tokenizerModel": "gpt-3.5-turbo-16k" }'),
('clrntjt89000a08jw0gcdbd5a', NULL, 'gpt-3.5-turbo-16k-0613', '(?i)^(gpt-)(35|3.5)(-turbo-16k-0613)$', NULL, 0.000003, 0.000004, NULL, 'TOKENS', 'openai', '{ "tokensPerMessage": 3, "tokensPerName": 1, "tokenizerModel": "gpt-3.5-turbo-16k-0613" }')
+395 -243
View File
@@ -2,341 +2,493 @@
// learn more about it in the docs: https://pris.ly/d/prisma-schema
generator client {
provider = "prisma-client-js"
previewFeatures = ["tracing"]
provider = "prisma-client-js"
previewFeatures = ["tracing", "views"]
}
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
directUrl = env("DIRECT_URL")
provider = "postgresql"
url = env("DATABASE_URL")
directUrl = env("DIRECT_URL")
shadowDatabaseUrl = env("SHADOW_DATABASE_URL")
}
generator erd {
provider = "prisma-erd-generator"
ignoreTables = ["_prisma_migrations", "Session", "Account", "Example"]
disabled = true
ignoreEnums = true
output = "database.svg"
}
model Example {
id String @id @default(cuid())
createdAt DateTime @default(now()) @map("created_at")
updatedAt DateTime @updatedAt @map("updated_at")
id String @id @default(cuid())
createdAt DateTime @default(now()) @map("created_at")
updatedAt DateTime @updatedAt @map("updated_at")
}
// Necessary for Next auth
model Account {
id String @id @default(cuid())
userId String @map("user_id")
type String
provider String
providerAccountId String
refresh_token String? // @db.Text
access_token String? // @db.Text
expires_at Int?
token_type String?
scope String?
id_token String? // @db.Text
session_state String?
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
id String @id @default(cuid())
userId String @map("user_id")
type String
provider String
providerAccountId String
refresh_token String? // @db.Text
access_token String? // @db.Text
expires_at Int?
expires_in Int?
ext_expires_in Int?
token_type String?
scope String?
id_token String? // @db.Text
session_state String?
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
@@unique([provider, providerAccountId])
@@index([userId])
@@unique([provider, providerAccountId])
@@index([userId])
}
model Session {
id String @id @default(cuid())
sessionToken String @unique @map("session_token")
userId String @map("user_id")
expires DateTime
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
id String @id @default(cuid())
sessionToken String @unique @map("session_token")
userId String @map("user_id")
expires DateTime
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
}
model User {
id String @id @default(cuid())
name String?
email String? @unique
emailVerified DateTime? @map("email_verified")
password String?
image String?
admin Boolean @default(false)
accounts Account[]
sessions Session[]
memberships Membership[]
createdAt DateTime @default(now()) @map("created_at")
updatedAt DateTime @default(now()) @updatedAt @map("updated_at")
featureFlags String[] @default([]) @map("feature_flags")
id String @id @default(cuid())
name String?
email String? @unique
emailVerified DateTime? @map("email_verified")
password String?
image String?
admin Boolean @default(false)
accounts Account[]
sessions Session[]
memberships Membership[]
invitations MembershipInvitation[]
createdAt DateTime @default(now()) @map("created_at")
updatedAt DateTime @default(now()) @updatedAt @map("updated_at")
featureFlags String[] @default([]) @map("feature_flags")
@@map("users")
@@map("users")
}
model VerificationToken {
identifier String
token String @unique
expires DateTime
identifier String
token String @unique
expires DateTime
@@unique([identifier, token])
@@map("verification_tokens")
@@unique([identifier, token])
@@map("verification_tokens")
}
model Project {
id String @id @default(cuid())
createdAt DateTime @default(now()) @map("created_at")
updatedAt DateTime @default(now()) @updatedAt @map("updated_at")
name String
members Membership[]
traces Trace[]
observations Observation[]
apiKeys ApiKey[]
dataset Dataset[]
RawEvents Events[]
id String @id @default(cuid())
createdAt DateTime @default(now()) @map("created_at")
updatedAt DateTime @default(now()) @updatedAt @map("updated_at")
name String
cloudConfig Json? @map("cloud_config") // Langfuse Cloud, for zod schema see projectsRouter.ts
members Membership[]
traces Trace[]
observations Observation[]
apiKeys ApiKey[]
dataset Dataset[]
RawEvents Events[]
invitations MembershipInvitation[]
sessions TraceSession[]
Prompt Prompt[]
Model Model[]
@@map("projects")
@@map("projects")
}
model ApiKey {
id String @id @unique @default(cuid())
createdAt DateTime @default(now()) @map("created_at")
note String?
publicKey String @unique @map("public_key")
hashedSecretKey String @unique @map("hashed_secret_key")
fastHashedSecretKey String? @unique @map("fast_hashed_secret_key")
displaySecretKey String @map("display_secret_key")
lastUsedAt DateTime? @map("last_used_at")
expiresAt DateTime? @map("expires_at")
projectId String @map("project_id")
project Project @relation(fields: [projectId], references: [id], onDelete: Cascade)
id String @id @unique @default(cuid())
createdAt DateTime @default(now()) @map("created_at")
note String?
publicKey String @unique @map("public_key")
hashedSecretKey String @unique @map("hashed_secret_key")
fastHashedSecretKey String? @unique @map("fast_hashed_secret_key")
displaySecretKey String @map("display_secret_key")
lastUsedAt DateTime? @map("last_used_at")
expiresAt DateTime? @map("expires_at")
projectId String @map("project_id")
project Project @relation(fields: [projectId], references: [id], onDelete: Cascade)
@@index(projectId)
@@index(publicKey)
@@index(hashedSecretKey)
@@index(fastHashedSecretKey)
@@map("api_keys")
@@index(projectId)
@@index(publicKey)
@@index(hashedSecretKey)
@@index(fastHashedSecretKey)
@@map("api_keys")
}
model Membership {
projectId String @map("project_id")
project Project @relation(fields: [projectId], references: [id], onDelete: Cascade)
userId String @map("user_id")
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
role MembershipRole
createdAt DateTime @default(now()) @map("created_at")
updatedAt DateTime @default(now()) @updatedAt @map("updated_at")
projectId String @map("project_id")
project Project @relation(fields: [projectId], references: [id], onDelete: Cascade)
userId String @map("user_id")
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
role MembershipRole
createdAt DateTime @default(now()) @map("created_at")
updatedAt DateTime @default(now()) @updatedAt @map("updated_at")
@@id([projectId, userId])
@@index([userId])
@@map("memberships")
@@id([projectId, userId])
@@index([userId])
@@map("memberships")
}
model MembershipInvitation {
id String @id @unique @default(cuid())
email String
role MembershipRole
projectId String @map("project_id")
project Project @relation(fields: [projectId], references: [id], onDelete: Cascade)
senderId String? @map("sender_id")
sender User? @relation(fields: [senderId], references: [id], onDelete: SetNull)
createdAt DateTime @default(now()) @map("created_at")
updatedAt DateTime @default(now()) @updatedAt @map("updated_at")
@@index([projectId])
@@index([email])
@@map("membership_invitations")
}
enum MembershipRole {
OWNER
ADMIN
MEMBER
VIEWER
OWNER
ADMIN
MEMBER
VIEWER
}
model TraceSession {
id String @default(cuid())
createdAt DateTime @default(now()) @map("created_at")
updatedAt DateTime @default(now()) @updatedAt @map("updated_at")
projectId String @map("project_id")
project Project @relation(fields: [projectId], references: [id], onDelete: Cascade)
bookmarked Boolean @default(false)
public Boolean @default(false)
traces Trace[]
@@id([id, projectId])
@@index([projectId])
@@index([createdAt])
@@map("trace_sessions")
}
model Trace {
id String @id @default(cuid())
externalId String? @map("external_id")
timestamp DateTime @default(now())
name String?
userId String? @map("user_id")
metadata Json?
release String?
version String?
projectId String @map("project_id")
project Project @relation(fields: [projectId], references: [id], onDelete: Cascade)
public Boolean @default(false)
bookmarked Boolean @default(false)
id String @id @default(cuid())
externalId String? @map("external_id")
timestamp DateTime @default(now())
name String?
userId String? @map("user_id")
metadata Json?
release String?
version String?
projectId String @map("project_id")
project Project @relation(fields: [projectId], references: [id], onDelete: Cascade)
public Boolean @default(false)
bookmarked Boolean @default(false)
tags String[] @default([])
input Json?
output Json?
sessionId String? @map("session_id")
session TraceSession? @relation(fields: [sessionId, projectId], references: [id, projectId])
scores Score[]
scores Score[]
@@unique([projectId, externalId])
@@index([projectId])
@@index([name])
@@index([userId])
@@index([externalId])
@@index(timestamp)
@@index(release)
@@map("traces")
@@index([projectId])
@@index([sessionId])
@@index([name])
@@index([userId])
@@index([externalId])
@@index(timestamp)
@@index(release)
@@index([tags(ops: ArrayOps)], type: Gin)
@@map("traces")
}
model Observation {
id String @id @default(cuid())
traceId String? @map("trace_id")
projectId String @map("project_id")
type ObservationType
startTime DateTime @default(now()) @map("start_time")
endTime DateTime? @map("end_time")
name String?
metadata Json?
parentObservationId String? @map("parent_observation_id")
level ObservationLevel @default(DEFAULT)
statusMessage String? @map("status_message")
version String?
createdAt DateTime @default(now()) @map("created_at")
id String @id @default(cuid())
traceId String? @map("trace_id")
projectId String @map("project_id")
type ObservationType
startTime DateTime @default(now()) @map("start_time")
endTime DateTime? @map("end_time")
name String?
metadata Json?
parentObservationId String? @map("parent_observation_id")
level ObservationLevel @default(DEFAULT)
statusMessage String? @map("status_message")
version String?
createdAt DateTime @default(now()) @map("created_at")
// GENERATION ONLY
model String?
modelParameters Json?
input Json?
output Json?
promptTokens Int @default(0) @map("prompt_tokens")
completionTokens Int @default(0) @map("completion_tokens")
totalTokens Int @default(0) @map("total_tokens")
completionStartTime DateTime? @map("completion_start_time")
scores Score[]
project Project @relation(fields: [projectId], references: [id], onDelete: Cascade)
derivedDatasetItems DatasetItem[]
datasetRunItems DatasetRunItems[]
// GENERATION ONLY
model String?
internalModel String? @map("internal_model")
modelParameters Json?
input Json?
output Json?
promptTokens Int @default(0) @map("prompt_tokens")
completionTokens Int @default(0) @map("completion_tokens")
totalTokens Int @default(0) @map("total_tokens")
unit String?
inputCost Decimal? @map("input_cost")
outputCost Decimal? @map("output_cost")
totalCost Decimal? @map("total_cost")
completionStartTime DateTime? @map("completion_start_time")
scores Score[]
project Project @relation(fields: [projectId], references: [id], onDelete: Cascade)
derivedDatasetItems DatasetItem[]
datasetRunItems DatasetRunItems[]
@@unique([id, projectId])
@@index([traceId])
@@index([type])
@@index(startTime)
@@index(createdAt)
@@index(projectId)
@@index(parentObservationId)
@@map("observations")
promptId String? @map("prompt_id")
prompt Prompt? @relation(fields: [promptId], onDelete: SetNull, references: [id])
@@unique([id, projectId])
@@index([traceId])
@@index([type])
@@index(startTime)
@@index(createdAt)
@@index(projectId)
@@index(parentObservationId)
@@index(model)
@@map("observations")
}
enum ObservationType {
SPAN
EVENT
GENERATION
SPAN
EVENT
GENERATION
}
enum ObservationLevel {
DEBUG
DEFAULT
WARNING
ERROR
DEBUG
DEFAULT
WARNING
ERROR
}
model Score {
id String @id @default(cuid())
timestamp DateTime @default(now())
name String
value Float
comment String?
traceId String @map("trace_id")
trace Trace @relation(fields: [traceId], references: [id], onDelete: Cascade)
observationId String? @map("observation_id")
observation Observation? @relation(fields: [observationId], references: [id], onDelete: SetNull)
id String @id @default(cuid())
timestamp DateTime @default(now())
name String
value Float
comment String?
traceId String @map("trace_id")
trace Trace @relation(fields: [traceId], references: [id], onDelete: Cascade)
observationId String? @map("observation_id")
observation Observation? @relation(fields: [observationId], references: [id], onDelete: SetNull)
@@unique([id, traceId]) // used for upsert
@@index([value])
@@index([traceId], type: Hash)
@@index([observationId], type: Hash)
@@map("scores")
@@unique([id, traceId]) // used for upsert
@@index([value])
@@index([traceId], type: Hash)
@@index([observationId], type: Hash)
@@map("scores")
}
enum PricingUnit {
PER_1000_TOKENS
PER_1000_CHARS
PER_1000_TOKENS
PER_1000_CHARS
}
enum TokenType {
PROMPT
COMPLETION
TOTAL
PROMPT
COMPLETION
TOTAL
}
model Pricing {
id String @id @default(cuid())
modelName String @map("model_name")
pricingUnit PricingUnit @default(PER_1000_TOKENS) @map("pricing_unit")
price Decimal
currency String @default("USD")
tokenType TokenType @map("token_type")
id String @id @default(cuid())
modelName String @map("model_name")
pricingUnit PricingUnit @default(PER_1000_TOKENS) @map("pricing_unit")
price Decimal
currency String @default("USD")
tokenType TokenType @map("token_type")
@@map("pricings")
@@index(modelName)
@@map("pricings")
}
model CronJobs {
name String @id
lastRun DateTime? @map("last_run")
jobStartedAt DateTime? @map("job_started_at")
state String?
name String @id
lastRun DateTime? @map("last_run")
jobStartedAt DateTime? @map("job_started_at")
state String?
@@map("cron_jobs")
@@map("cron_jobs")
}
model Dataset {
id String @id @default(cuid())
name String
status DatasetStatus @default(ACTIVE)
projectId String @map("project_id")
project Project @relation(fields: [projectId], references: [id], onDelete: Cascade)
createdAt DateTime @default(now()) @map("created_at")
updatedAt DateTime @default(now()) @updatedAt @map("updated_at")
datasetItems DatasetItem[]
datasetRuns DatasetRuns[]
id String @id @default(cuid())
name String
projectId String @map("project_id")
project Project @relation(fields: [projectId], references: [id], onDelete: Cascade)
createdAt DateTime @default(now()) @map("created_at")
updatedAt DateTime @default(now()) @updatedAt @map("updated_at")
datasetItems DatasetItem[]
datasetRuns DatasetRuns[]
@@unique([projectId, name])
@@index([projectId], type: Hash)
@@map("datasets")
@@unique([projectId, name])
@@index([projectId], type: Hash)
@@map("datasets")
}
model DatasetItem {
id String @id @default(cuid())
status DatasetStatus @default(ACTIVE)
input Json
expectedOutput Json? @map("expected_output")
sourceObservationId String? @map("source_observation_id")
sourceObservation Observation? @relation(fields: [sourceObservationId], references: [id], onDelete: SetNull)
datasetId String @map("dataset_id")
dataset Dataset @relation(fields: [datasetId], references: [id], onDelete: Cascade)
createdAt DateTime @default(now()) @map("created_at")
updatedAt DateTime @default(now()) @updatedAt @map("updated_at")
datasetRunItems DatasetRunItems[]
id String @id @default(cuid())
status DatasetStatus @default(ACTIVE)
input Json
expectedOutput Json? @map("expected_output")
sourceObservationId String? @map("source_observation_id")
sourceObservation Observation? @relation(fields: [sourceObservationId], references: [id], onDelete: SetNull)
datasetId String @map("dataset_id")
dataset Dataset @relation(fields: [datasetId], references: [id], onDelete: Cascade)
createdAt DateTime @default(now()) @map("created_at")
updatedAt DateTime @default(now()) @updatedAt @map("updated_at")
datasetRunItems DatasetRunItems[]
@@index([sourceObservationId], type: Hash)
@@index([datasetId], type: Hash)
@@map("dataset_items")
@@index([sourceObservationId], type: Hash)
@@index([datasetId], type: Hash)
@@map("dataset_items")
}
enum DatasetStatus {
ACTIVE
ARCHIVED
ACTIVE
ARCHIVED
}
model DatasetRuns {
id String @id @default(cuid())
name String
datasetId String @map("dataset_id")
dataset Dataset @relation(fields: [datasetId], references: [id], onDelete: Cascade)
createdAt DateTime @default(now()) @map("created_at")
updatedAt DateTime @default(now()) @updatedAt @map("updated_at")
datasetRunItems DatasetRunItems[]
id String @id @default(cuid())
name String
datasetId String @map("dataset_id")
dataset Dataset @relation(fields: [datasetId], references: [id], onDelete: Cascade)
createdAt DateTime @default(now()) @map("created_at")
updatedAt DateTime @default(now()) @updatedAt @map("updated_at")
datasetRunItems DatasetRunItems[]
@@unique([datasetId, name])
@@index([datasetId], type: Hash)
@@map("dataset_runs")
@@unique([datasetId, name])
@@index([datasetId], type: Hash)
@@map("dataset_runs")
}
model DatasetRunItems {
id String @id @default(cuid())
datasetRunId String @map("dataset_run_id")
datasetRun DatasetRuns @relation(fields: [datasetRunId], references: [id], onDelete: Cascade)
datasetItemId String @map("dataset_item_id")
datasetItem DatasetItem @relation(fields: [datasetItemId], references: [id], onDelete: Cascade)
observationId String @map("observation_id")
observation Observation @relation(fields: [observationId], references: [id], onDelete: Cascade)
createdAt DateTime @default(now()) @map("created_at")
updatedAt DateTime @default(now()) @updatedAt @map("updated_at")
id String @id @default(cuid())
datasetRunId String @map("dataset_run_id")
datasetRun DatasetRuns @relation(fields: [datasetRunId], references: [id], onDelete: Cascade)
datasetItemId String @map("dataset_item_id")
datasetItem DatasetItem @relation(fields: [datasetItemId], references: [id], onDelete: Cascade)
observationId String @map("observation_id")
observation Observation @relation(fields: [observationId], references: [id], onDelete: Cascade)
createdAt DateTime @default(now()) @map("created_at")
updatedAt DateTime @default(now()) @updatedAt @map("updated_at")
@@index([datasetRunId], type: Hash)
@@index([datasetItemId], type: Hash)
@@index([observationId], type: Hash)
@@map("dataset_run_items")
@@index([datasetRunId], type: Hash)
@@index([datasetItemId], type: Hash)
@@index([observationId], type: Hash)
@@map("dataset_run_items")
}
model Events {
id String @id @default(cuid())
createdAt DateTime @default(now()) @map("created_at")
updatedAt DateTime @default(now()) @updatedAt @map("updated_at")
projectId String @map("project_id")
project Project @relation(fields: [projectId], references: [id], onDelete: Cascade)
data Json
headers Json @default("{}")
url String?
method String?
id String @id @default(cuid())
createdAt DateTime @default(now()) @map("created_at")
updatedAt DateTime @default(now()) @updatedAt @map("updated_at")
projectId String @map("project_id")
project Project @relation(fields: [projectId], references: [id], onDelete: Cascade)
data Json
headers Json @default("{}")
url String?
method String?
@@index(projectId)
@@map("events")
@@index(projectId)
@@map("events")
}
model Prompt {
id String @id @default(cuid())
createdAt DateTime @default(now()) @map("created_at")
updatedAt DateTime @default(now()) @updatedAt @map("updated_at")
projectId String @map("project_id")
project Project @relation(fields: [projectId], references: [id], onDelete: Cascade)
createdBy String @map("created_by")
prompt String
name String
version Int
isActive Boolean @map("is_active")
Observation Observation[]
@@unique([projectId, name, version])
@@index([projectId, name, version])
@@map("prompts")
}
model Model {
id String @id @default(cuid())
createdAt DateTime @default(now()) @map("created_at")
updatedAt DateTime @default(now()) @updatedAt @map("updated_at")
projectId String? @map("project_id")
project Project? @relation(fields: [projectId], references: [id], onDelete: Cascade)
modelName String @map("model_name")
matchPattern String @map("match_pattern")
startDate DateTime? @map("start_date")
inputPrice Decimal? @map("input_price")
outputPrice Decimal? @map("output_price")
totalPrice Decimal? @map("total_price")
unit String // TOKENS, CHARACTERS, MILLISECONDS, SECONDS, or IMAGES
tokenizerId String? @map("tokenizer_id")
tokenizerConfig Json? @map("tokenizer_config")
@@unique([projectId, modelName, startDate, unit])
@@index([projectId, modelName])
@@map("models")
}
// This view is a mix of the observation and model. Once prisma supports
// inheritance, we should remove code duplication here.
view ObservationView {
id String @id @default(cuid())
traceId String? @map("trace_id")
projectId String @map("project_id")
type ObservationType
startTime DateTime @default(now()) @map("start_time")
endTime DateTime? @map("end_time")
name String?
metadata Json?
parentObservationId String? @map("parent_observation_id")
level ObservationLevel @default(DEFAULT)
statusMessage String? @map("status_message")
version String?
createdAt DateTime @default(now()) @map("created_at")
// GENERATION ONLY
model String?
modelParameters Json?
input Json?
output Json?
promptTokens Int @default(0) @map("prompt_tokens")
completionTokens Int @default(0) @map("completion_tokens")
totalTokens Int @default(0) @map("total_tokens")
unit String?
completionStartTime DateTime? @map("completion_start_time")
promptId String? @map("prompt_id")
// Model
modelId String? @map("model_id")
inputPrice Decimal? @map("input_price")
outputPrice Decimal? @map("output_price")
totalPrice Decimal? @map("total_price")
// calculated fields
calculatedInputCost Decimal? @map("calculated_input_cost")
calculatedOutputCost Decimal? @map("calculated_output_cost")
calculatedTotalCost Decimal? @map("calculated_total_cost")
@@map("observations_view")
}
+267 -73
View File
@@ -5,6 +5,7 @@ import {
} from "@/src/features/public-api/lib/apiKeys";
import { hash } from "bcryptjs";
import { parseArgs } from "node:util";
import { ModelUsageUnit } from "@/src/constants";
const options = {
environment: { type: "string" },
@@ -53,6 +54,25 @@ async function main() {
},
});
const prompt = await prisma.prompt.upsert({
where: {
projectId_name_version: {
projectId: seedProjectId,
name: "summary-prompt",
version: 1,
},
},
create: {
name: "summary-prompt",
project: { connect: { id: seedProjectId } },
prompt: "prompt {{variable}} {{anotherVariable}}",
isActive: true,
version: 1,
createdBy: "user-1",
},
update: {},
});
const seedApiKey = {
id: "seed-api-key",
secret: process.env.SEED_SECRET_KEY ?? "sk-lf-1234567890",
@@ -79,9 +99,9 @@ async function main() {
// Do not run the following for local docker compose setup
if (environment === "examples") {
const project2 = await prisma.project.create({
data: {
id: "239ad00f-562f-411d-af14-831c75ddd875",
const project2 = await prisma.project.upsert({
where: { id: "239ad00f-562f-411d-af14-831c75ddd875" },
create: {
name: "demo-app",
apiKeys: {
create: [
@@ -100,16 +120,130 @@ async function main() {
},
},
},
update: {},
});
const promptIds: string[] = [];
const prompts = [
{
id: `prompt-${Math.floor(Math.random() * 1000000000)}`,
projectId: project2.id,
createdBy: "user-1",
prompt: "Prompt 1 content",
name: "Prompt 1",
version: 1,
isActive: true,
},
{
id: `prompt-${Math.floor(Math.random() * 1000000000)}`,
projectId: project2.id,
createdBy: "user-1",
prompt: "Prompt 2 content",
name: "Prompt 2",
version: 1,
isActive: true,
},
{
id: `prompt-${Math.floor(Math.random() * 1000000000)}`,
projectId: project2.id,
createdBy: "API",
prompt: "Prompt 3 content",
name: "Prompt 3 by API",
version: 1,
isActive: true,
},
];
for (const prompt of prompts) {
await prisma.prompt.create({
data: {
id: prompt.id,
projectId: prompt.projectId,
createdBy: prompt.createdBy,
prompt: prompt.prompt,
name: prompt.name,
version: prompt.version,
isActive: prompt.isActive,
},
});
promptIds.push(prompt.id);
}
const promptVersionsWithVariables = [
{
id: `prompt-${Math.floor(Math.random() * 1000000000)}`,
projectId: project2.id,
createdBy: "user-1",
prompt: "Prompt 4 version 1 content with {{variable}}",
name: "Prompt 4 with variable",
version: 1,
isActive: false,
},
{
id: `prompt-${Math.floor(Math.random() * 1000000000)}`,
projectId: project2.id,
createdBy: "user-1",
prompt: "Prompt 4 version 2 content with {{variable}}",
name: "Prompt 4 with variable",
version: 2,
isActive: true,
},
{
id: `prompt-${Math.floor(Math.random() * 1000000000)}`,
projectId: project2.id,
createdBy: "user-1",
prompt: "Prompt 4 version 3 content with {{variable}}",
name: "Prompt 4 with variable",
version: 3,
isActive: false,
},
];
for (const version of promptVersionsWithVariables) {
await prisma.prompt.create({
data: {
id: version.id,
projectId: version.projectId,
createdBy: version.createdBy,
prompt: version.prompt,
name: version.name,
version: version.version,
isActive: version.isActive,
},
});
promptIds.push(version.id);
}
const promptName = "Prompt with Longer Name";
const projectId = project2.id;
const createdBy = "user-1";
for (let i = 1; i <= 20; i++) {
const promptId = `prompt-${Math.floor(Math.random() * 1000000000)}`;
await prisma.prompt.create({
data: {
id: promptId,
projectId: projectId,
createdBy: createdBy,
prompt: `${promptName} version ${i} content`,
name: promptName,
version: i,
isActive: i === 20,
},
});
promptIds.push(promptId);
}
const generationIds: string[] = [];
const envTags = [null, "development", "staging", "production"];
const colorTags = [null, "red", "blue", "yellow"];
for (let i = 0; i < TRACE_VOLUME; i++) {
// print progress to console with a progress bar that refreshes every 10 iterations
if (i % 10 === 0) {
if ((i + 1) % 10 === 0 || i === TRACE_VOLUME - 1) {
process.stdout.clearLine(0);
process.stdout.cursorTo(0);
process.stdout.write(`Seeding ${i} of ${TRACE_VOLUME}`);
process.stdout.write(`Seeding ${i + 1} of ${TRACE_VOLUME}`);
}
// random date within last 90 days, with a linear bias towards more recent dates
const traceTs = new Date(
@@ -117,6 +251,13 @@ async function main() {
Math.floor(Math.random() ** 1.5 * 90 * 24 * 60 * 60 * 1000),
);
const envTag = envTags[Math.floor(Math.random() * envTags.length)];
const colorTag = colorTags[Math.floor(Math.random() * colorTags.length)];
const tags = [envTag, colorTag].filter((tag) => tag !== null);
const projectId = [project1.id, project2.id][i % 2] as string;
const trace = await prisma.trace.create({
data: {
id: `trace-${Math.floor(Math.random() * 1000000000)}`,
@@ -127,25 +268,48 @@ async function main() {
metadata: {
user: `user-${i}@langfuse.com`,
},
tags: tags as string[],
project: {
connect: {
id: [project1.id, project2.id][i % 2],
},
connect: { id: projectId },
},
userId: `user-${i % 10}`,
session:
Math.random() > 0.3
? {
connectOrCreate: {
where: {
id_projectId: {
id: `session-${i % 10}`,
projectId: projectId,
},
},
create: {
id: `session-${i % 10}`,
projectId: projectId,
},
},
}
: undefined,
input:
Math.random() > 0.3
? "I'm looking for a React component"
: undefined,
output:
Math.random() > 0.3
? "What kind of component are you looking for?"
: undefined,
scores: {
createMany: {
data: [
{
name: "latency",
value: Math.floor(Math.random() * 20),
timestamp: traceTs,
},
{
name: "feedback",
value: Math.floor(Math.random() * 3) - 1,
timestamp: traceTs,
},
...(Math.random() > 0.5
? [
{
name: "feedback",
value: Math.floor(Math.random() * 3) - 1,
timestamp: traceTs,
},
]
: []),
...(Math.random() > 0.7
? [
{
@@ -218,6 +382,20 @@ async function main() {
const promptTokens = Math.floor(Math.random() * 1000) + 300;
const completionTokens = Math.floor(Math.random() * 500) + 100;
const models = [
"gpt-3.5-turbo",
"gpt-4",
"gpt-4-32k-0613",
"gpt-3.5-turbo-16k-0613",
"claude-instant-1",
"claude-2.1",
"gpt-4-vision-preview",
"MIXTRAL-8X7B",
];
const model = models[Math.floor(Math.random() * models.length)];
const promptId =
promptIds[Math.floor(Math.random() * promptIds.length)];
const generation = await prisma.observation.create({
data: {
type: "GENERATION",
@@ -226,6 +404,7 @@ async function main() {
endTime: generationTsEnd,
name: `generation-${i}-${j}-${k}`,
project: { connect: { id: trace.projectId } },
prompt: { connect: { id: promptId } },
input:
Math.random() > 0.5
? [
@@ -284,7 +463,8 @@ async function main() {
Remember to import React at the top of your file whenever you're creating a component, because JSX transpiles to 'React.createElement' calls under the hood.`,
},
model: Math.random() > 0.5 ? "gpt-3.5-turbo" : "gpt-4",
model: model,
internalModel: model,
modelParameters: {
temperature:
Math.random() > 0.9 ? undefined : Math.random().toFixed(2),
@@ -303,25 +483,32 @@ async function main() {
totalTokens: promptTokens + completionTokens,
parentObservationId: span.id,
traceId: trace.id,
...{
...(Math.random() > 0.5 && trace.projectId === prompt.projectId
? { prompt: { connect: { id: prompt.id } } }
: {}),
},
unit: ModelUsageUnit.Tokens,
},
});
await prisma.score.create({
data: {
name: "quality",
value: Math.random() * 2 - 1,
observationId: generation.id,
traceId: trace.id,
},
});
await prisma.score.create({
data: {
name: "conciseness",
value: Math.random() * 2 - 1,
observationId: generation.id,
traceId: trace.id,
},
});
if (Math.random() > 0.6)
await prisma.score.create({
data: {
name: "quality",
value: Math.random() * 2 - 1,
observationId: generation.id,
traceId: trace.id,
},
});
if (Math.random() > 0.6)
await prisma.score.create({
data: {
name: "conciseness",
value: Math.random() * 2 - 1,
observationId: generation.id,
traceId: trace.id,
},
});
generationIds.push(generation.id);
@@ -353,47 +540,54 @@ async function main() {
}
}
const dataset = await prisma.dataset.create({
data: {
name: "demo-dataset",
projectId: project2.id,
},
});
const datasetRun = await prisma.datasetRuns.create({
data: {
name: "demo-dataset-run",
datasetId: dataset.id,
},
});
for (let runNumber = 0; runNumber < 10; runNumber++) {
//pick randomly from existingSpanIds
const sourceObservationId =
generationIds[Math.floor(Math.random() * generationIds.length)];
const runObservationId =
generationIds[Math.floor(Math.random() * generationIds.length)];
const datasetItem = await prisma.datasetItem.create({
for (let datasetNumber = 0; datasetNumber < 2; datasetNumber++) {
const dataset = await prisma.dataset.create({
data: {
datasetId: dataset.id,
sourceObservationId:
Math.random() > 0.5 ? sourceObservationId : undefined,
input: [
{ role: "user", content: "How can i create a React component?" },
],
expectedOutput:
"Creating a React component can be done in two ways: as a functional component or as a class component. Let's start with a basic example of both.",
name: `demo-dataset-${datasetNumber}`,
projectId: project2.id,
},
});
await prisma.datasetRunItems.create({
data: {
datasetItemId: datasetItem.id,
observationId: runObservationId!,
datasetRunId: datasetRun.id,
},
});
for (let datasetRunNumber = 0; datasetRunNumber < 2; datasetRunNumber++) {
const datasetRun = await prisma.datasetRuns.create({
data: {
name: `demo-dataset-run-${datasetRunNumber}`,
datasetId: dataset.id,
},
});
for (let runNumber = 0; runNumber < 10; runNumber++) {
//pick randomly from existingSpanIds
const sourceObservationId =
generationIds[Math.floor(Math.random() * generationIds.length)];
const runObservationId =
generationIds[Math.floor(Math.random() * generationIds.length)];
const datasetItem = await prisma.datasetItem.create({
data: {
datasetId: dataset.id,
sourceObservationId:
Math.random() > 0.5 ? sourceObservationId : undefined,
input: [
{
role: "user",
content: "How can i create a React component?",
},
],
expectedOutput:
"Creating a React component can be done in two ways: as a functional component or as a class component. Let's start with a basic example of both.",
},
});
await prisma.datasetRunItems.create({
data: {
datasetItemId: datasetItem.id,
observationId: runObservationId!,
datasetRunId: datasetRun.id,
},
});
}
}
}
}
}
+250
View File
@@ -0,0 +1,250 @@
// Description: New model definitions in Langfuse are automatically applied to new observations.
// You can optionally run this script to apply new model definitions to existing observations.
// See docs: https://langfuse.com/docs/deployment/self-host#migrate-models
// Execute: `npm run models:migrate`
import "dotenv/config";
import { findModel } from "@/src/server/api/services/EventProcessor";
import { prisma } from "@/src/server/db";
import lodash from "lodash";
import { tokenCount } from "@/src/features/ingest/lib/usage";
import { type Prisma } from "@prisma/client";
async function main() {
return await modelMatch();
}
// Call the function
main().catch((err) => {
console.error("An error occurred:", err);
});
export async function modelMatch() {
console.log("Starting model match");
const start = Date.now();
const BATCH_SIZE = 10_000;
let continueLoop = true;
let index = 0;
let totalObservations = 0;
while (continueLoop) {
type ObservationSelect = {
model: string | null;
id: string;
projectId: string;
startTime: Date;
unit: string | null;
promptTokens: number;
completionTokens: number;
totalTokens: number;
input: Prisma.JsonValue;
output: Prisma.JsonValue;
};
const observations = await prisma.observation.findMany({
select: {
id: true,
startTime: true,
model: true,
unit: true,
projectId: true,
promptTokens: true,
completionTokens: true,
totalTokens: true,
input: true,
output: true,
},
orderBy: {
startTime: "desc",
},
where: {
internalModel: null,
type: "GENERATION",
},
take: BATCH_SIZE,
skip: index * BATCH_SIZE,
});
console.log(`Found ${observations.length} observations to migrate`);
type Config = {
startTime: Date;
model: string;
unit: string;
projectId: string | null;
};
interface GroupedObservations {
[key: string]: ObservationSelect[];
}
const groupedObservations = observations.reduce<GroupedObservations>(
(acc, observation) => {
const config = {
startTime: observation.startTime.toISOString().slice(0, 10),
model: observation.model,
unit: observation.unit,
projectId: observation.projectId,
};
const key = JSON.stringify(config);
// Ensure the array is initialized before using it
acc[key] = acc[key] ?? [];
acc[key]?.push(observation);
return acc;
},
{},
);
let updatedObservations = 0;
const dbPromises = [];
for (const [key, observationsGroup] of Object.entries(
groupedObservations,
)) {
const { startTime, model, unit, projectId } = JSON.parse(key) as Config;
console.log("Execute key: ", startTime, model, unit, projectId);
if (!projectId) {
throw new Error("No project id");
}
const foundModel = await findModel({
event: { projectId, model, unit, startTime: startTime },
});
console.log(
"Found model: ",
foundModel?.id,
" for key: ",
key,
" with observations: ",
observationsGroup.length,
);
if (foundModel) {
// find all the observations with all tokens 0 and tokenize them individually
const observationsWithAllTokensZero = observationsGroup.filter(
(observation) =>
observation.promptTokens === 0 &&
observation.completionTokens === 0 &&
observation.totalTokens === 0,
);
for (const observation of observationsWithAllTokensZero) {
console.log("Tokenizing observation: ", observation.id);
const newInputCount = tokenCount({
model: foundModel,
text: observation.input,
});
const newOutputCount = tokenCount({
model: foundModel,
text: observation.output,
});
dbPromises.push(
prisma.observation.update({
where: {
id: observation.id,
},
data: {
promptTokens: newInputCount,
completionTokens: newOutputCount,
totalTokens: (newInputCount ?? 0) + (newOutputCount ?? 0),
internalModel: foundModel.modelName,
},
}),
);
}
// for all remaining observations, batch update them with the model id
const observationsWithTokens = observationsGroup.filter(
(observation) =>
observation.promptTokens !== 0 ||
observation.completionTokens !== 0 ||
observation.totalTokens !== 0,
);
// Push the promise for updating observations into the array
lodash.chunk(observationsWithTokens, 32000).map((chunk) => {
dbPromises.push(
prisma.observation.updateMany({
where: {
id: {
in: chunk.map((observation) => observation.id),
},
},
data: {
internalModel: foundModel.modelName,
},
}),
);
});
updatedObservations += observationsGroup.length;
} else {
lodash.chunk(observationsGroup, 32000).map((chunk) => {
dbPromises.push(
prisma.observation.updateMany({
where: {
id: {
in: chunk.map((observation) => observation.id),
},
},
data: {
internalModel: "LANGFUSETMPNOMODEL",
},
}),
);
});
updatedObservations += observationsGroup.length;
}
}
totalObservations += updatedObservations;
// Wait for all update operations to complete
const promiseChunk = lodash.chunk(dbPromises, 10);
for (const promises of promiseChunk) {
console.log("Waiting for promises to complete", promises.length);
await Promise.all(promises);
}
console.log(
"Updated observations count: ",
updatedObservations,
" in total: ",
totalObservations,
);
console.log(updatedObservations, observations.length);
if (updatedObservations === 0) {
index++;
}
if (observations.length === 0) {
console.log("No more observations to migrate");
continueLoop = false;
}
}
await prisma.observation.updateMany({
where: {
internalModel: "LANGFUSETMPNOMODEL",
},
data: {
internalModel: null,
},
});
const end = Date.now();
console.log(`Model match took ${end - start} ms`);
}
-11
View File
@@ -1,11 +0,0 @@
# Security Policy
## Supported Versions
We always recommend using the latest version of Langfuse to ensure you get all security updates.
## Reporting a Vulnerability
Please report security vulnerabilities to security@langfuse.com.
We currently do not operate a bug bounty program.
+1 -1
View File
@@ -9,7 +9,7 @@ if (process.env.NEXT_PUBLIC_SENTRY_DSN)
// Set tracesSampleRate to 1.0 to capture 100%
// of transactions for performance monitoring.
// We recommend adjusting this value in production
tracesSampleRate: 0.8,
tracesSampleRate: 0.3,
// Capture Replay for 100% of all sessions,
// plus for 100% of sessions with an error
+1 -1
View File
@@ -7,7 +7,7 @@ if (process.env.NEXT_PUBLIC_SENTRY_DSN)
// Set tracesSampleRate to 1.0 to capture 100%
// of transactions for performance monitoring.
// We recommend adjusting this value in production
tracesSampleRate: 0.75,
tracesSampleRate: 0.3,
// ...
+2 -2
View File
@@ -12,9 +12,9 @@ if (process.env.NEXT_PUBLIC_SENTRY_DSN)
// Set tracesSampleRate to 1.0 to capture 100%
// of transactions for performance monitoring.
// We recommend adjusting this value in production
tracesSampleRate: 0.8,
tracesSampleRate: 0.3,
profilesSampleRate: 0.8, // Profiling sample rate is relative to tracesSampleRate
profilesSampleRate: 0.3, // Profiling sample rate is relative to tracesSampleRate
integrations: [
// Add profiling integration to list of integrations
new ProfilingIntegration(),
+1
View File
@@ -2,6 +2,7 @@ import { test, expect } from "@playwright/test";
test("should redirect to sign-in if not signed in", async ({ page }) => {
await page.goto("/");
await page.waitForTimeout(2000);
await expect(page).toHaveURL("/auth/sign-in");
});
+16 -7
View File
@@ -3,28 +3,33 @@ import { test, expect } from "@playwright/test";
test("should see new projects dialog open after clicking new project btn", async ({
page,
}) => {
await page.goto("/auth/sign-in");
await page.fill('input[name="email"]', "demo@langfuse.com");
await page.goto("auth/sign-up");
await page.fill('input[name="name"]', "demo user");
await page.fill('input[name="email"]', randomEmailAddress());
await page.fill('input[type="password"]', "password");
await page.click('button[type="submit"]');
await page.waitForTimeout(2000);
await page.waitForTimeout(2000);
await page.isVisible("Create new project");
expect(await page.innerHTML("data-testid=create-new-project-title")).toBe(
"Create new project",
);
await page.click('[data-testid="create-project-btn"]');
await page.waitForTimeout(2000);
await page.isVisible('[data-testid="new-project-form"]');
await expect(page.locator("data-testid=new-project-form")).toBeVisible();
});
test("Create a project with provided name", async ({ page }) => {
test.setTimeout(60000);
await page.goto("/auth/sign-in");
await page.fill('input[name="email"]', "demo@langfuse.com");
await page.fill('input[type="password"]', "password");
await page.click('button[type="submit"]');
await page.waitForTimeout(2000);
await page.isVisible("Create new project");
await page.isVisible('[data-testid="new-project-form"]');
await page.click('[data-testid="create-project-btn"]');
await page.waitForTimeout(2000);
await page.isVisible('[data-testid="new-project-form"]');
await expect(page.locator("data-testid=new-project-form")).toBeVisible();
await page.fill(
'[data-testid="new-project-name-input"]',
"my e2e demo project",
@@ -33,7 +38,11 @@ test("Create a project with provided name", async ({ page }) => {
await page.waitForTimeout(2000);
expect(page.url()).toContain("/project/");
await page.waitForTimeout(2000);
expect(await page.getByTestId("project-title-span-1").textContent()).toBe(
expect(await page.getByTestId("project-name").textContent()).toContain(
"my e2e demo project",
);
});
// random email address to be used in tests
const randomEmailAddress = () =>
Math.random().toString(36).substring(2, 11) + "@example.com";
+442
View File
@@ -0,0 +1,442 @@
/** @jest-environment node */
import { pruneDatabase } from "@/src/__tests__/test-utils";
import { ModelUsageUnit } from "@/src/constants";
import { prisma } from "@/src/server/db";
describe("cost retrieval tests", () => {
beforeEach(async () => await pruneDatabase());
[
{
testDescription: "prompt and completion tokens",
promptTokens: 200,
completionTokens: 3000,
totalTokens: undefined,
inputPrice: "0.0000010",
outputPrice: "0.0000020",
totalPrice: undefined,
expectedPromptTokens: 200,
expectedCompletionTokens: 3000,
expectedTotalTokens: 0,
expectedInputCost: "0.0002", // 200 / 1000 * 0.0010
expectedOutputCost: "0.006", // 3000 / 1000 * 0.0020
expectedTotalCost: "0.0062", // 0.0002 + 0.006
},
{
testDescription: "missing completion tokens",
promptTokens: 200,
completionTokens: undefined,
totalTokens: undefined,
inputPrice: "0.0000010",
outputPrice: "0.0000020",
totalPrice: undefined,
expectedPromptTokens: 200,
expectedCompletionTokens: 0,
expectedTotalTokens: 0,
expectedInputCost: "0.0002",
expectedOutputCost: "0", // completionTokens are set to 0 when ingesting undefined, hence 0 cost
expectedTotalCost: "0.0002",
},
{
testDescription: "missing prompt tokens",
promptTokens: undefined,
completionTokens: 3000,
totalTokens: undefined,
inputPrice: "0.0000010",
outputPrice: "0.0000020",
totalPrice: undefined,
expectedPromptTokens: 0,
expectedCompletionTokens: 3000,
expectedTotalTokens: 0,
expectedInputCost: "0", // promptTokens are set to 0 when ingesting undefined, hence 0 cost
expectedOutputCost: "0.006",
expectedTotalCost: "0.006",
},
{
testDescription: "prompt and completion and total",
promptTokens: 200,
completionTokens: 3000,
totalTokens: 3200,
inputPrice: "0.0000010",
outputPrice: "0.0000020",
totalPrice: undefined,
expectedPromptTokens: 200,
expectedCompletionTokens: 3000,
expectedTotalTokens: 3200,
expectedInputCost: "0.0002", // 200 / 1000 * 0.0010
expectedOutputCost: "0.006", // 3000 / 1000 * 0.0020
expectedTotalCost: "0.0062", // 0.0002 + 0.006
},
{
testDescription: "total only without price",
promptTokens: undefined,
completionTokens: undefined,
totalTokens: 3200,
inputPrice: "0.0000010",
outputPrice: "0.0000020",
totalPrice: undefined,
expectedPromptTokens: 0,
expectedCompletionTokens: 0,
expectedTotalTokens: 3200,
expectedInputCost: "0",
expectedOutputCost: "0",
expectedTotalCost: "0",
},
{
testDescription: "total only",
promptTokens: undefined,
completionTokens: undefined,
totalTokens: 3200,
inputPrice: "0.0000010",
outputPrice: "0.0000020",
totalPrice: "0.1",
expectedPromptTokens: 0,
expectedCompletionTokens: 0,
expectedTotalTokens: 3200,
expectedInputCost: "0",
expectedOutputCost: "0",
expectedTotalCost: "320",
},
].forEach((input) => {
it(`should calculate cost correctly ${input.testDescription}`, async () => {
await pruneDatabase();
await prisma.model.create({
data: {
modelName: "gpt-3.5-turbo",
inputPrice: input.inputPrice,
outputPrice: input.outputPrice,
totalPrice: input.totalPrice,
matchPattern: "(.*)(gpt-)(35|3.5)(-turbo)?(.*)",
projectId: null,
startDate: new Date("2023-12-01"),
tokenizerConfig: { tokensPerMessage: 3, tokensPerName: 1 },
unit: ModelUsageUnit.Tokens,
},
});
const dbTrace = await prisma.trace.create({
data: {
name: "trace-name",
project: { connect: { id: "7a88fb47-b4e2-43b8-a06c-a5ce950dc53a" } },
},
});
await prisma.observation.create({
data: {
traceId: dbTrace.id,
type: "GENERATION",
project: { connect: { id: "7a88fb47-b4e2-43b8-a06c-a5ce950dc53a" } },
model: "gpt-3.5-turbo",
internalModel: "gpt-3.5-turbo",
startTime: new Date("2024-01-01T00:00:00.000Z"),
unit: ModelUsageUnit.Tokens,
promptTokens: input.promptTokens,
completionTokens: input.completionTokens,
totalTokens: input.totalTokens,
},
});
const view = await prisma.observationView.findFirst({
where: { traceId: dbTrace.id },
});
expect(view?.promptTokens).toBe(input.expectedPromptTokens);
expect(view?.completionTokens).toBe(input.expectedCompletionTokens);
expect(view?.totalTokens).toBe(input.expectedTotalTokens);
// calculated cost fields
expect(view?.calculatedInputCost?.toString()).toBe(
input.expectedInputCost,
);
expect(view?.calculatedOutputCost?.toString()).toBe(
input.expectedOutputCost,
);
expect(view?.calculatedTotalCost?.toString()).toBe(
input.expectedTotalCost,
);
});
});
[
{
testDescription: "overwriting project specific model",
expectedInputCost: "0.0004", // 200 / 1000 * 0.0010
expectedOutputCost: "0.012", // 3000 / 1000 * 0.0020
expectedTotalCost: "0.0124", // 0.0002 + 0.006
expectedModelId: "model-2",
},
].forEach((input) => {
it(`should calculate cost correctly with multiple models ${input.testDescription}`, async () => {
await pruneDatabase();
await prisma.model.create({
data: {
id: "model-1",
modelName: "gpt-3.5-turbo",
inputPrice: "0.0000010",
outputPrice: "0.0000020",
totalPrice: "0.1",
matchPattern: "(.*)(gpt-)(35|3.5)(-turbo)?(.*)",
projectId: null,
startDate: new Date("2023-12-01"),
tokenizerConfig: { tokensPerMessage: 3, tokensPerName: 1 },
unit: ModelUsageUnit.Tokens,
},
});
await prisma.model.create({
data: {
id: "model-2",
modelName: "gpt-3.5-turbo",
inputPrice: "0.0000020",
outputPrice: "0.0000040",
totalPrice: undefined,
matchPattern: "(.*)(gpt-)(35|3.5)(-turbo)?(.*)",
startDate: new Date("2023-12-01"),
tokenizerConfig: { tokensPerMessage: 3, tokensPerName: 1 },
unit: ModelUsageUnit.Tokens,
project: { connect: { id: "7a88fb47-b4e2-43b8-a06c-a5ce950dc53a" } },
},
});
const dbTrace = await prisma.trace.create({
data: {
name: "trace-name",
project: { connect: { id: "7a88fb47-b4e2-43b8-a06c-a5ce950dc53a" } },
},
});
await prisma.observation.create({
data: {
traceId: dbTrace.id,
type: "GENERATION",
project: { connect: { id: "7a88fb47-b4e2-43b8-a06c-a5ce950dc53a" } },
model: "gpt-3.5-turbo",
internalModel: "gpt-3.5-turbo",
startTime: new Date("2024-01-01T00:00:00.000Z"),
unit: ModelUsageUnit.Tokens,
promptTokens: 200,
completionTokens: 3000,
totalTokens: undefined,
},
});
const view = await prisma.observationView.findFirst({
where: { traceId: dbTrace.id },
});
// calculated cost fields
expect(view?.modelId).toBe(input.expectedModelId);
expect(view?.calculatedInputCost?.toString()).toBe(
input.expectedInputCost,
);
expect(view?.calculatedOutputCost?.toString()).toBe(
input.expectedOutputCost,
);
expect(view?.calculatedTotalCost?.toString()).toBe(
input.expectedTotalCost,
);
});
});
it(`should prioritize latest models`, async () => {
await pruneDatabase();
await prisma.model.create({
data: {
id: "model-1",
modelName: "gpt-3.5-turbo",
inputPrice: "0.0000010",
outputPrice: "0.0000020",
totalPrice: "0.1",
matchPattern: "(.*)(gpt-)(35|3.5)(-turbo)?(.*)",
projectId: null,
startDate: new Date("2023-12-01"),
tokenizerConfig: { tokensPerMessage: 3, tokensPerName: 1 },
unit: ModelUsageUnit.Tokens,
},
});
await prisma.model.create({
data: {
id: "model-2",
modelName: "gpt-3.5-turbo",
inputPrice: "0.0000020",
outputPrice: "0.0000040",
totalPrice: undefined,
matchPattern: "(.*)(gpt-)(35|3.5)(-turbo)?(.*)",
startDate: new Date("2023-12-02"),
tokenizerConfig: { tokensPerMessage: 3, tokensPerName: 1 },
unit: ModelUsageUnit.Tokens,
},
});
const dbTrace = await prisma.trace.create({
data: {
name: "trace-name",
project: { connect: { id: "7a88fb47-b4e2-43b8-a06c-a5ce950dc53a" } },
},
});
await prisma.observation.create({
data: {
traceId: dbTrace.id,
type: "GENERATION",
project: { connect: { id: "7a88fb47-b4e2-43b8-a06c-a5ce950dc53a" } },
model: "gpt-3.5-turbo",
internalModel: "gpt-3.5-turbo",
startTime: new Date("2024-01-01T00:00:00.000Z"),
unit: ModelUsageUnit.Tokens,
promptTokens: 200,
completionTokens: 3000,
totalTokens: undefined,
},
});
const view = await prisma.observationView.findFirst({
where: { traceId: dbTrace.id },
});
console.log(view);
// calculated cost fields
expect(view?.modelId).toBe("model-2");
expect(view?.calculatedInputCost?.toString()).toBe("0.0004");
expect(view?.calculatedOutputCost?.toString()).toBe("0.012");
expect(view?.calculatedTotalCost?.toString()).toBe("0.0124");
});
it(`should prioritize old model if the latest model is not own one`, async () => {
await pruneDatabase();
await prisma.model.create({
data: {
id: "model-1",
modelName: "gpt-3.5-turbo",
inputPrice: "0.0010",
outputPrice: "0.0020",
totalPrice: "0.1",
matchPattern: "(.*)(gpt-)(35|3.5)(-turbo)?(.*)",
startDate: new Date("2023-12-02"),
tokenizerConfig: { tokensPerMessage: 3, tokensPerName: 1 },
unit: ModelUsageUnit.Tokens,
},
});
await prisma.model.create({
data: {
id: "model-2",
modelName: "gpt-3.5-turbo",
inputPrice: "0.0000020",
outputPrice: "0.0000040",
totalPrice: undefined,
matchPattern: "(.*)(gpt-)(35|3.5)(-turbo)?(.*)",
startDate: new Date("2023-12-01"),
tokenizerConfig: { tokensPerMessage: 3, tokensPerName: 1 },
project: { connect: { id: "7a88fb47-b4e2-43b8-a06c-a5ce950dc53a" } },
unit: ModelUsageUnit.Tokens,
},
});
const dbTrace = await prisma.trace.create({
data: {
name: "trace-name",
project: { connect: { id: "7a88fb47-b4e2-43b8-a06c-a5ce950dc53a" } },
},
});
await prisma.observation.create({
data: {
traceId: dbTrace.id,
type: "GENERATION",
project: { connect: { id: "7a88fb47-b4e2-43b8-a06c-a5ce950dc53a" } },
model: "gpt-3.5-turbo",
internalModel: "gpt-3.5-turbo",
startTime: new Date("2024-01-01T00:00:00.000Z"),
unit: ModelUsageUnit.Tokens,
promptTokens: 200,
completionTokens: 3000,
totalTokens: undefined,
},
});
const view = await prisma.observationView.findFirst({
where: { traceId: dbTrace.id },
});
console.log(view);
// calculated cost fields
expect(view?.modelId).toBe("model-2");
expect(view?.calculatedInputCost?.toString()).toBe("0.0004");
expect(view?.calculatedOutputCost?.toString()).toBe("0.012");
expect(view?.calculatedTotalCost?.toString()).toBe("0.0124");
});
it(`should prioritize user provided cost`, async () => {
await pruneDatabase();
await prisma.model.create({
data: {
id: "model-1",
modelName: "gpt-3.5-turbo",
inputPrice: "0.0010",
outputPrice: "0.0020",
totalPrice: "0.1",
matchPattern: "(.*)(gpt-)(35|3.5)(-turbo)?(.*)",
startDate: new Date("2023-12-02"),
tokenizerConfig: { tokensPerMessage: 3, tokensPerName: 1 },
unit: ModelUsageUnit.Tokens,
},
});
await prisma.model.create({
data: {
id: "model-2",
modelName: "gpt-3.5-turbo",
inputPrice: "0.0020",
outputPrice: "0.0040",
totalPrice: undefined,
matchPattern: "(.*)(gpt-)(35|3.5)(-turbo)?(.*)",
startDate: new Date("2023-12-01"),
tokenizerConfig: { tokensPerMessage: 3, tokensPerName: 1 },
project: { connect: { id: "7a88fb47-b4e2-43b8-a06c-a5ce950dc53a" } },
unit: ModelUsageUnit.Tokens,
},
});
const dbTrace = await prisma.trace.create({
data: {
name: "trace-name",
project: { connect: { id: "7a88fb47-b4e2-43b8-a06c-a5ce950dc53a" } },
},
});
await prisma.observation.create({
data: {
traceId: dbTrace.id,
type: "GENERATION",
project: { connect: { id: "7a88fb47-b4e2-43b8-a06c-a5ce950dc53a" } },
model: "gpt-3.5-turbo",
internalModel: "gpt-3.5-turbo",
startTime: new Date("2024-01-01T00:00:00.000Z"),
unit: ModelUsageUnit.Tokens,
promptTokens: 200,
completionTokens: 3000,
totalTokens: undefined,
inputCost: "1",
outputCost: "2",
totalCost: "3",
},
});
const view = await prisma.observationView.findFirst({
where: { traceId: dbTrace.id },
});
console.log(view);
// calculated cost fields
expect(view?.modelId).toBe("model-2");
expect(view?.calculatedInputCost?.toString()).toBe("1");
expect(view?.calculatedOutputCost?.toString()).toBe("2");
expect(view?.calculatedTotalCost?.toString()).toBe("3");
});
});
+187
View File
@@ -0,0 +1,187 @@
/** @jest-environment node */
import { prisma } from "@/src/server/db";
import { makeAPICall, pruneDatabase } from "@/src/__tests__/test-utils";
import { v4 } from "uuid";
describe("/api/public/datasets and /api/public/dataset-items API Endpoints", () => {
beforeEach(async () => await pruneDatabase());
afterEach(async () => await pruneDatabase());
it("should create and get a dataset", async () => {
await makeAPICall("POST", "/api/public/datasets", {
name: "dataset-name",
});
const dbDataset = await prisma.dataset.findMany({
where: {
name: "dataset-name",
},
});
expect(dbDataset.length).toBeGreaterThan(0);
const getDataset = await makeAPICall(
"GET",
`/api/public/datasets/dataset-name`,
);
expect(getDataset.status).toBe(200);
expect(getDataset.body).toMatchObject({
name: "dataset-name",
});
});
it("should create and get a dataset item (via datasets and individually)", async () => {
await makeAPICall("POST", "/api/public/datasets", {
name: "dataset-name",
});
await makeAPICall("POST", "/api/public/dataset-items", {
datasetName: "dataset-name",
input: { key: "value" },
expectedOutput: { key: "value" },
});
const dbDatasetItem = await prisma.datasetItem.findFirst({
where: {
dataset: {
name: "dataset-name",
},
},
});
expect(dbDatasetItem).not.toBeNull();
const getDataset = await makeAPICall(
"GET",
`/api/public/datasets/dataset-name`,
);
expect(getDataset.status).toBe(200);
expect(getDataset.body).toMatchObject({
name: "dataset-name",
items: [
{
id: dbDatasetItem!.id,
input: { key: "value" },
expectedOutput: { key: "value" },
},
],
});
const getDatasetItem = await makeAPICall(
"GET",
`/api/public/dataset-items/${dbDatasetItem!.id}`,
);
expect(getDatasetItem.status).toBe(200);
expect(getDatasetItem.body).toMatchObject({
id: dbDatasetItem!.id,
input: { key: "value" },
expectedOutput: { key: "value" },
});
});
it("should upsert a dataset item", async () => {
await makeAPICall("POST", "/api/public/datasets", {
name: "dataset-name",
});
const item1 = await makeAPICall("POST", "/api/public/dataset-items", {
id: "dataset-item-id",
datasetName: "dataset-name",
input: { key: "value" },
});
expect(item1.status).toBe(200);
expect(item1.body).toMatchObject({
id: "dataset-item-id",
});
const item2 = await makeAPICall("POST", "/api/public/dataset-items", {
id: "dataset-item-id",
datasetName: "dataset-name",
input: { key: "value2" },
});
expect(item2.status).toBe(200);
expect(item2.body).toMatchObject({
id: "dataset-item-id",
input: { key: "value2" },
});
const dbDatasetItem = await prisma.datasetItem.findFirst({
where: { id: "dataset-item-id" },
});
expect(dbDatasetItem).not.toBeNull();
expect(dbDatasetItem?.input).toMatchObject({ key: "value2" });
});
it("should create and get a dataset run", async () => {
const dataset = await makeAPICall("POST", "/api/public/datasets", {
name: "dataset-name",
});
expect(dataset.status).toBe(200);
expect(dataset.body).toMatchObject({
name: "dataset-name",
});
await makeAPICall("POST", "/api/public/dataset-items", {
datasetName: "dataset-name",
id: "dataset-item-id",
input: { key: "value" },
expectedOutput: { key: "value" },
});
const traceId = v4();
const observationId = v4();
const response = await makeAPICall("POST", "/api/public/ingestion", {
batch: [
{
id: v4(),
type: "trace-create",
timestamp: new Date().toISOString(),
body: {
id: traceId,
name: "trace-name",
userId: "user-1",
metadata: { key: "value" },
release: "1.0.0",
version: "2.0.0",
},
},
{
id: v4(),
type: "observation-create",
timestamp: new Date().toISOString(),
body: {
id: observationId,
traceId: traceId,
type: "GENERATION",
name: "generation-name",
startTime: "2021-01-01T00:00:00.000Z",
endTime: "2021-01-01T00:00:00.000Z",
modelParameters: { key: "value" },
input: { key: "value" },
metadata: { key: "value" },
version: "2.0.0",
},
},
],
});
expect(response.status).toBe(207);
const runItem = await makeAPICall("POST", "/api/public/dataset-run-items", {
datasetItemId: "dataset-item-id",
observationId: observationId,
runName: "run-name",
});
const dbRun = await prisma.datasetRuns.findFirst({
where: {
name: "run-name",
},
});
expect(dbRun).not.toBeNull();
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
expect(dbRun?.datasetId).toBe(dataset.body.id);
expect(runItem.status).toBe(200);
expect(runItem.body).toMatchObject({
datasetItemId: "dataset-item-id",
observationId: observationId,
datasetRunId: dbRun?.id,
});
});
});
+7 -7
View File
@@ -241,12 +241,12 @@ describe("/api/public/events API Endpoint", () => {
expect(createSpan.status).toBe(200);
expect(dbEvent?.id).toBe(spanId);
expect(dbEvent?.traceId).toBe(dbTrace[0]?.id);
expect(dbEvent?.name).toBe(generationName);
expect(dbEvent?.startTime).toEqual(new Date("2021-01-01T00:00:00.000Z"));
expect(dbEvent?.input).toEqual({ key: "value" });
expect(dbEvent?.metadata).toEqual({ key: "value" });
expect(dbEvent?.version).toBe("2.0.0");
expect(dbEvent.id).toBe(spanId);
expect(dbEvent.traceId).toBe(dbTrace[0]?.id);
expect(dbEvent.name).toBe(generationName);
expect(dbEvent.startTime).toEqual(new Date("2021-01-01T00:00:00.000Z"));
expect(dbEvent.input).toEqual({ key: "value" });
expect(dbEvent.metadata).toEqual({ key: "value" });
expect(dbEvent.version).toBe("2.0.0");
});
});
@@ -0,0 +1,110 @@
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
/* eslint-disable @typescript-eslint/no-unsafe-call */
import { cleanup, render } from "@testing-library/react";
import { TestRouter } from "@/src/__tests__/fixtures/TestRouter";
import { useOrderByState } from "@/src/features/orderBy/hooks/useOrderByState";
import { LocationMock } from "@jedmao/location";
import NextAdapterPages from "next-query-params/pages";
import { useRouter } from "next/router";
import { QueryParamProvider } from "use-query-params";
afterEach(cleanup);
jest.mock("next/router", () => ({
useRouter: jest.fn(),
}));
const { location: savedLocation } = window;
// The test for the useOrderByState hook
describe("useOrderByState hook", () => {
let testRouter: TestRouter;
let locationMock: LocationMock;
beforeAll(() => {
// @ts-expect-error - TS only allows to delete optional params; but here we want to delete it
// as it will be set in beforeEach
delete window.location;
});
beforeEach(() => {
jest.resetAllMocks();
locationMock = new LocationMock("https://langfuse.com");
testRouter = new TestRouter(locationMock);
window.location = locationMock;
(useRouter as jest.Mock).mockReturnValue(testRouter);
});
afterAll(() => {
window.location = savedLocation;
});
test("orderBy takes the default value if no url param is given", () => {
const result = render(
<QueryParamProvider adapter={NextAdapterPages}>
<UseOrderByStateExample />
</QueryParamProvider>,
);
expect(result.queryByText(/column Column 1, order DESC/)).toBeTruthy();
});
test("setOrderBy updates orderBy query param", () => {
const result = render(
<QueryParamProvider adapter={NextAdapterPages}>
<UseOrderByStateExample />
</QueryParamProvider>,
);
result.queryByText(/Set Order/)!.click();
result.rerender(
<QueryParamProvider adapter={NextAdapterPages}>
<UseOrderByStateExample />
</QueryParamProvider>,
);
expect(result.queryByText(/column Column 2, order ASC/)).toBeTruthy();
expect(locationMock.searchParams.get("orderBy")).toBe(
"column-Column 2_order-ASC",
);
});
test("orderBy reads the given param from the url", () => {
locationMock.replace(
"https://langfuse.com?orderBy=column-Column 3_order-DESC",
);
const result = render(
<QueryParamProvider adapter={NextAdapterPages}>
<UseOrderByStateExample />
</QueryParamProvider>,
);
expect(result.queryByText(/column Column 3, order DESC/)).toBeTruthy();
});
});
const UseOrderByStateExample = () => {
const [orderBy, setOrderBy] = useOrderByState({
column: "Column 1",
order: "DESC",
});
return (
<>
<h1>{`column ${orderBy?.column}, order ${orderBy?.order}`}</h1>
<button
onClick={() => {
setOrderBy({
column: "Column 2",
order: "ASC",
});
}}
>
Set Order
</button>
</>
);
};
@@ -0,0 +1,29 @@
import { orderByToPrismaSql } from "@/src/features/orderBy/server/orderByToPrisma";
import { tracesTableCols } from "@/src/server/api/definitions/tracesTable";
// The test for the orderByToPrisma function
describe("orderByToPrisma (Convert orderBy to Prisma.sql)", () => {
test("orderByToPrisma throws error for orderBy column not included in column defs", () => {
expect(() =>
orderByToPrismaSql(
{
column: "InvalidCol",
order: "ASC",
},
tracesTableCols,
),
).toThrow(/Invalid filter column: InvalidCol/);
});
test("orderByToPrisma throws error for orderBy order that is not valid", () => {
expect(() =>
orderByToPrismaSql(
{
column: "latency",
order: "test" as "ASC" | "DESC",
},
tracesTableCols,
),
).toThrow(/Invalid order: test/);
});
});
+56
View File
@@ -0,0 +1,56 @@
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
/* eslint-disable @typescript-eslint/no-unsafe-call */
import { type Router } from "next/router";
import type { UrlObject } from "url";
import { type LocationMock } from "@jedmao/location";
type PartialRouter = Partial<Router>;
export const BASE_URL = "https://langfuse.com";
/**
* A Router to be used for testing which provides the bare minimum needed
* for the useQueryParam(s) hook and NextAdapter to work.
*/
export class TestRouter implements PartialRouter {
isReady = true;
pathname = "/";
private currentUrl = "";
private history: string[] = [];
constructor(private locationMock: LocationMock) {}
replace = (url: string | UrlObject) => {
// eslint-disable-next-line @typescript-eslint/no-base-to-string, @typescript-eslint/restrict-template-expressions
this.locationMock.assign(`${BASE_URL}${url}`);
this.currentUrl = TestRouter.getURLString(url);
this.locationMock.assign(`${BASE_URL}${this.currentUrl}`);
return Promise.resolve(true);
};
push = (url: string | UrlObject) => {
this.history.push(this.currentUrl);
this.currentUrl = TestRouter.getURLString(url);
this.locationMock.assign(`${BASE_URL}${this.currentUrl}`);
return Promise.resolve(true);
};
setIsReady = (isReady: boolean) => {
this.isReady = isReady;
};
get asPath() {
return this.pathname;
}
static getURLString(url: string | UrlObject): string {
if (typeof url === "string") {
return url;
}
return `${url.pathname}${url.search}`;
}
getParams(): URLSearchParams {
return new URL(`${BASE_URL}${this.currentUrl}`).searchParams;
}
}
+156 -69
View File
@@ -1,74 +1,161 @@
/** @jest-environment node */
import { prisma } from "@/src/server/db";
import { makeAPICall, pruneDatabase } from "@/src/__tests__/test-utils";
import { v4 as uuidv4 } from "uuid";
import { makeAPICall, pruneDatabase } from "@/src/__tests__/test-utils";
import { ModelUsageUnit } from "@/src/constants";
import { prisma } from "@/src/server/db";
describe("/api/public/generations API Endpoint", () => {
beforeEach(async () => await pruneDatabase());
afterEach(async () => await pruneDatabase());
it("should create generation after trace", async () => {
await pruneDatabase();
[
{
usage: {
input: 100,
output: 200,
total: 100,
unit: ModelUsageUnit.Characters,
},
expectedUnit: ModelUsageUnit.Characters,
expectedPromptTokens: 100,
expectedCompletionTokens: 200,
expectedTotalTokens: 100,
},
{
usage: {
total: 100,
unit: ModelUsageUnit.Characters,
},
expectedUnit: ModelUsageUnit.Characters,
expectedPromptTokens: 0,
expectedCompletionTokens: 0,
expectedTotalTokens: 100,
},
{
usage: {
total: 100,
},
expectedUnit: null,
expectedPromptTokens: 0,
expectedCompletionTokens: 0,
expectedTotalTokens: 100,
},
{
usage: {
promptTokens: 100,
completionTokens: 200,
totalTokens: 100,
},
expectedPromptTokens: 100,
expectedCompletionTokens: 200,
expectedTotalTokens: 100,
expectedUnit: ModelUsageUnit.Tokens,
},
{
usage: {
totalTokens: 100,
},
expectedPromptTokens: 0,
expectedCompletionTokens: 0,
expectedTotalTokens: 100,
expectedUnit: ModelUsageUnit.Tokens,
},
{
usage: undefined,
expectedPromptTokens: 0,
expectedCompletionTokens: 0,
expectedTotalTokens: 0,
expectedUnit: null,
},
{
usage: null,
expectedPromptTokens: 0,
expectedCompletionTokens: 0,
expectedTotalTokens: 0,
expectedUnit: null,
},
{
usage: {},
expectedPromptTokens: 0,
expectedCompletionTokens: 0,
expectedTotalTokens: 0,
expectedUnit: null,
},
].forEach((testConfig) => {
it(`should create generation after trace 1 ${JSON.stringify(
testConfig,
)}`, async () => {
await pruneDatabase();
const traceId = uuidv4();
const traceId = uuidv4();
await makeAPICall("POST", "/api/public/traces", {
id: traceId,
name: "trace-name",
userId: "user-1",
projectId: "7a88fb47-b4e2-43b8-a06c-a5ce950dc53a",
metadata: { key: "value" },
release: "1.0.0",
version: "2.0.0",
});
const dbTrace = await prisma.trace.findMany({
where: {
await makeAPICall("POST", "/api/public/traces", {
id: traceId,
},
});
expect(dbTrace.length).toBeGreaterThan(0);
expect(dbTrace[0]?.id).toBe(traceId);
const generationId = uuidv4();
const createGeneration = await makeAPICall(
"POST",
"/api/public/generations",
{
id: generationId,
traceId: traceId,
name: "generation-name",
startTime: "2021-01-01T00:00:00.000Z",
endTime: "2021-01-01T00:00:00.000Z",
model: "model-name",
modelParameters: { key: "value" },
prompt: { key: "value" },
name: "trace-name",
userId: "user-1",
projectId: "7a88fb47-b4e2-43b8-a06c-a5ce950dc53a",
metadata: { key: "value" },
release: "1.0.0",
version: "2.0.0",
},
);
});
expect(createGeneration.status).toBe(200);
const dbGeneration = await prisma.observation.findUnique({
where: {
id: generationId,
},
const dbTrace = await prisma.trace.findMany({
where: {
id: traceId,
},
});
expect(dbTrace.length).toBeGreaterThan(0);
expect(dbTrace[0]?.id).toBe(traceId);
const generationId = uuidv4();
const createGeneration = await makeAPICall(
"POST",
"/api/public/generations",
{
id: generationId,
traceId: traceId,
name: "generation-name",
startTime: "2021-01-01T00:00:00.000Z",
endTime: "2021-01-01T00:00:00.000Z",
model: "model-name",
modelParameters: { key: "value" },
prompt: { key: "value" },
metadata: { key: "value" },
version: "2.0.0",
usage: testConfig.usage,
},
);
expect(createGeneration.status).toBe(200);
const dbGeneration = await prisma.observation.findUnique({
where: {
id: generationId,
},
});
expect(dbGeneration?.id).toBe(generationId);
expect(dbGeneration?.traceId).toBe(traceId);
expect(dbGeneration?.name).toBe("generation-name");
expect(dbGeneration?.startTime).toEqual(
new Date("2021-01-01T00:00:00.000Z"),
);
expect(dbGeneration?.endTime).toEqual(
new Date("2021-01-01T00:00:00.000Z"),
);
expect(dbGeneration?.model).toBe("model-name");
expect(dbGeneration?.modelParameters).toEqual({ key: "value" });
expect(dbGeneration?.input).toEqual({ key: "value" });
expect(dbGeneration?.metadata).toEqual({ key: "value" });
expect(dbGeneration?.version).toBe("2.0.0");
expect(dbGeneration?.unit).toBe(testConfig.expectedUnit);
expect(dbGeneration?.promptTokens).toBe(testConfig.expectedPromptTokens);
expect(dbGeneration?.completionTokens).toBe(
testConfig.expectedCompletionTokens,
);
expect(dbGeneration?.totalTokens).toBe(testConfig.expectedTotalTokens);
});
expect(dbGeneration?.id).toBe(generationId);
expect(dbGeneration?.traceId).toBe(traceId);
expect(dbGeneration?.name).toBe("generation-name");
expect(dbGeneration?.startTime).toEqual(
new Date("2021-01-01T00:00:00.000Z"),
);
expect(dbGeneration?.endTime).toEqual(new Date("2021-01-01T00:00:00.000Z"));
expect(dbGeneration?.model).toBe("model-name");
expect(dbGeneration?.modelParameters).toEqual({ key: "value" });
expect(dbGeneration?.input).toEqual({ key: "value" });
expect(dbGeneration?.metadata).toEqual({ key: "value" });
expect(dbGeneration?.version).toBe("2.0.0");
});
it("should create generation before trace", async () => {
@@ -339,8 +426,8 @@ describe("/api/public/generations API Endpoint", () => {
name: generationName,
},
});
expect(dbGeneration?.id).toBe(generationId);
expect(dbGeneration?.traceId).toBe(externalTraceId);
expect(dbGeneration.id).toBe(generationId);
expect(dbGeneration.traceId).toBe(externalTraceId);
const dbTraces = await prisma.trace.findMany();
expect(dbTraces.length).toBe(0);
@@ -383,18 +470,18 @@ describe("/api/public/generations API Endpoint", () => {
expect(createGeneration.status).toBe(200);
expect(dbGeneration?.id).toBe(generationId);
expect(dbGeneration?.traceId).toBe(dbTrace[0]?.id);
expect(dbGeneration?.name).toBe(generationName);
expect(dbGeneration?.startTime).toEqual(
expect(dbGeneration.id).toBe(generationId);
expect(dbGeneration.traceId).toBe(dbTrace[0]?.id);
expect(dbGeneration.name).toBe(generationName);
expect(dbGeneration.startTime).toEqual(
new Date("2021-01-01T00:00:00.000Z"),
);
expect(dbGeneration?.endTime).toEqual(new Date("2021-01-01T00:00:00.000Z"));
expect(dbGeneration?.model).toBe("model-name");
expect(dbGeneration?.modelParameters).toEqual({ key: "value" });
expect(dbGeneration?.input).toEqual({ key: "value" });
expect(dbGeneration?.metadata).toEqual({ key: "value" });
expect(dbGeneration?.version).toBe("2.0.0");
expect(dbGeneration.endTime).toEqual(new Date("2021-01-01T00:00:00.000Z"));
expect(dbGeneration.model).toBe("model-name");
expect(dbGeneration.modelParameters).toEqual({ key: "value" });
expect(dbGeneration.input).toEqual({ key: "value" });
expect(dbGeneration.metadata).toEqual({ key: "value" });
expect(dbGeneration.version).toBe("2.0.0");
});
it("should update generation", async () => {
+794 -66
View File
@@ -1,18 +1,565 @@
/** @jest-environment node */
import { makeAPICall, pruneDatabase } from "@/src/__tests__/test-utils";
import { prisma } from "@/src/server/db";
import { v4 } from "uuid";
import { makeAPICall, pruneDatabase } from "@/src/__tests__/test-utils";
import { ModelUsageUnit } from "@/src/constants";
import { cleanEvent } from "@/src/pages/api/public/ingestion";
import { prisma } from "@/src/server/db";
describe("/api/public/ingestion API Endpoint", () => {
beforeEach(async () => await pruneDatabase());
it("should create trace and generation", async () => {
[
{
usage: {
input: 100,
output: 200,
total: 100,
unit: ModelUsageUnit.Characters,
inputCost: 123,
outputCost: 456,
totalCost: 789,
},
expectedUnit: ModelUsageUnit.Characters,
expectedPromptTokens: 100,
expectedCompletionTokens: 200,
expectedTotalTokens: 100,
},
{
usage: {
total: 100,
unit: ModelUsageUnit.Characters,
},
expectedUnit: ModelUsageUnit.Characters,
expectedPromptTokens: 0,
expectedCompletionTokens: 0,
expectedTotalTokens: 100,
},
{
usage: {
total: 100,
unit: ModelUsageUnit.Milliseconds,
},
expectedUnit: ModelUsageUnit.Milliseconds,
expectedPromptTokens: 0,
expectedCompletionTokens: 0,
expectedTotalTokens: 100,
},
{
usage: {
input: 1,
output: 2,
unit: ModelUsageUnit.Images,
},
expectedUnit: ModelUsageUnit.Images,
expectedPromptTokens: 1,
expectedCompletionTokens: 2,
expectedTotalTokens: 3,
},
{
usage: {
input: 30,
output: 10,
unit: ModelUsageUnit.Seconds,
},
expectedUnit: ModelUsageUnit.Seconds,
expectedPromptTokens: 30,
expectedCompletionTokens: 10,
expectedTotalTokens: 40,
},
{
usage: {
total: 100,
},
expectedUnit: null,
expectedPromptTokens: 0,
expectedCompletionTokens: 0,
expectedTotalTokens: 100,
},
{
usage: {
promptTokens: 100,
completionTokens: 200,
totalTokens: 100,
},
expectedPromptTokens: 100,
expectedCompletionTokens: 200,
expectedTotalTokens: 100,
expectedUnit: ModelUsageUnit.Tokens,
},
{
usage: {
totalTokens: 100,
},
expectedPromptTokens: 0,
expectedCompletionTokens: 0,
expectedTotalTokens: 100,
expectedUnit: ModelUsageUnit.Tokens,
},
{
usage: undefined,
expectedPromptTokens: 0,
expectedCompletionTokens: 0,
expectedTotalTokens: 0,
expectedUnit: null,
},
{
usage: null,
expectedPromptTokens: 0,
expectedCompletionTokens: 0,
expectedTotalTokens: 0,
expectedUnit: null,
},
{
usage: {},
expectedPromptTokens: 0,
expectedCompletionTokens: 0,
expectedTotalTokens: 0,
expectedUnit: null,
},
].forEach((testConfig) => {
it(`should create trace, generation and score without matching models ${JSON.stringify(
testConfig,
)}`, async () => {
const traceId = v4();
const generationId = v4();
const spanId = v4();
const scoreId = v4();
const response = await makeAPICall("POST", "/api/public/ingestion", {
metadata: {
sdk_verion: "1.0.0",
sdk_name: "python",
},
batch: [
{
id: v4(),
type: "trace-create",
timestamp: new Date().toISOString(),
body: {
id: traceId,
name: "trace-name",
userId: "user-1",
metadata: { key: "value" },
release: "1.0.0",
version: "2.0.0",
tags: ["tag-1", "tag-2"],
},
},
{
id: v4(),
type: "observation-create",
timestamp: new Date().toISOString(),
body: {
id: generationId,
traceId: traceId,
type: "GENERATION",
name: "generation-name",
startTime: "2021-01-01T00:00:00.000Z",
endTime: "2021-01-01T00:00:00.000Z",
modelParameters: { key: "value" },
input: { key: "value" },
metadata: { key: "value" },
version: "2.0.0",
},
},
{
id: v4(),
type: "observation-update",
timestamp: new Date().toISOString(),
body: {
id: generationId,
type: "GENERATION",
output: { key: "this is a great gpt output" },
usage: testConfig.usage,
},
},
{
id: v4(),
type: "observation-create",
timestamp: new Date().toISOString(),
body: {
id: spanId,
traceId: traceId,
type: "SPAN",
name: "span-name",
startTime: "2021-01-01T00:00:00.000Z",
endTime: "2021-01-01T00:00:00.000Z",
input: { input: "value" },
metadata: { meta: "value" },
version: "2.0.0",
},
},
{
id: v4(),
type: "score-create",
timestamp: new Date().toISOString(),
body: {
id: scoreId,
name: "score-name",
value: 100.5,
traceId: traceId,
},
},
],
});
expect(response.status).toBe(207);
console.log("response body", response.body);
const dbTrace = await prisma.trace.findMany({
where: {
name: "trace-name",
},
});
expect(dbTrace.length).toBeGreaterThan(0);
expect(dbTrace[0]?.name).toBe("trace-name");
expect(dbTrace[0]?.release).toBe("1.0.0");
expect(dbTrace[0]?.externalId).toBeNull();
expect(dbTrace[0]?.version).toBe("2.0.0");
expect(dbTrace[0]?.projectId).toBe(
"7a88fb47-b4e2-43b8-a06c-a5ce950dc53a",
);
expect(dbTrace[0]?.tags).toEqual(["tag-1", "tag-2"]);
const dbGeneration = await prisma.observation.findUnique({
where: {
id: generationId,
},
});
expect(dbGeneration?.id).toBe(generationId);
expect(dbGeneration?.traceId).toBe(traceId);
expect(dbGeneration?.name).toBe("generation-name");
expect(dbGeneration?.startTime).toEqual(
new Date("2021-01-01T00:00:00.000Z"),
);
expect(dbGeneration?.endTime).toEqual(
new Date("2021-01-01T00:00:00.000Z"),
);
expect(dbGeneration?.model).toBeNull();
expect(dbGeneration?.modelParameters).toEqual({ key: "value" });
expect(dbGeneration?.input).toEqual({ key: "value" });
expect(dbGeneration?.metadata).toEqual({ key: "value" });
expect(dbGeneration?.version).toBe("2.0.0");
expect(dbGeneration?.internalModel).toBeNull();
expect(dbGeneration?.promptTokens).toEqual(
testConfig.expectedPromptTokens,
);
expect(dbGeneration?.completionTokens).toEqual(
testConfig.expectedCompletionTokens,
);
expect(dbGeneration?.totalTokens).toEqual(testConfig.expectedTotalTokens);
expect(dbGeneration?.unit).toEqual(testConfig.expectedUnit);
expect(dbGeneration?.output).toEqual({
key: "this is a great gpt output",
});
const dbSpan = await prisma.observation.findUnique({
where: {
id: spanId,
},
});
expect(dbSpan?.id).toBe(spanId);
expect(dbSpan?.name).toBe("span-name");
expect(dbSpan?.startTime).toEqual(new Date("2021-01-01T00:00:00.000Z"));
expect(dbSpan?.endTime).toEqual(new Date("2021-01-:00:00.000Z"));
expect(dbSpan?.input).toEqual({ input: "value" });
expect(dbSpan?.metadata).toEqual({ meta: "value" });
expect(dbSpan?.version).toBe("2.0.0");
const dbScore = await prisma.score.findUnique({
where: {
id: scoreId,
},
});
expect(dbScore?.id).toBe(scoreId);
expect(dbScore?.traceId).toBe(traceId);
expect(dbScore?.name).toBe("score-name");
expect(dbScore?.value).toBe(100.5);
expect(dbScore?.observationId).toBeNull();
});
});
[
{
observationExternalModel: "gpt-3.5",
observationStartTime: new Date("2021-01-01T00:00:00.000Z"),
modelUnit: ModelUsageUnit.Tokens,
expectedInternalModel: "gpt-3.5-turbo",
expectedPromptTokens: 5,
expectedCompletionTokens: 7,
models: [
{
modelName: "gpt-3.5-turbo",
matchPattern: "(?i)^(gpt-)(35|3.5)(-turbo)?$",
startDate: new Date("2021-01-01T00:00:00.000Z"),
unit: ModelUsageUnit.Tokens,
tokenizerId: "openai",
},
],
},
{
observationExternalModel: "gpt-3.5",
observationStartTime: new Date("2021-01-01T00:00:00.000Z"),
modelUnit: ModelUsageUnit.Tokens,
expectedInternalModel: "gpt-3.5-turbo",
expectedPromptTokens: 5,
expectedCompletionTokens: 7,
models: [
{
modelName: "gpt-3.5-turbo",
matchPattern: "(?i)^(gpt-)(35|3.5)(-turbo)?$",
startDate: null,
unit: ModelUsageUnit.Tokens,
tokenizerId: "openai",
},
],
},
{
observationExternalModel: "GPT-3.5",
observationStartTime: new Date("2021-01-01T00:00:00.000Z"),
modelUnit: ModelUsageUnit.Tokens,
expectedInternalModel: "gpt-3.5-turbo",
expectedPromptTokens: 5,
expectedCompletionTokens: 7,
models: [
{
modelName: "gpt-3.5-turbo",
matchPattern: "(?i)^(gpt-)(35|3.5)(-turbo)?$",
startDate: new Date("2021-01-01T00:00:00.000Z"),
unit: ModelUsageUnit.Tokens,
tokenizerId: "openai",
},
],
},
{
observationExternalModel: "GPT-3.5",
observationStartTime: new Date("2021-01-01T00:00:00.000Z"),
modelUnit: ModelUsageUnit.Tokens,
expectedInternalModel: "gpt-3.5-turbo",
expectedPromptTokens: 5,
expectedCompletionTokens: 7,
models: [
{
modelName: "gpt-3.5-turbo",
matchPattern: "(?i)^(gpt-)(35|3.5)(-turbo)?$",
startDate: new Date("2021-01-01T00:00:00.000Z"),
unit: ModelUsageUnit.Tokens,
tokenizerId: "openai",
},
{
modelName: "gpt-3.5-turbo-new",
matchPattern: "(?i)^(gpt-)(35|3.5)(-turbo)?$",
startDate: new Date("2021-01-01T10:00:00.000Z"),
unit: ModelUsageUnit.Tokens,
tokenizerId: "openai",
},
],
},
{
observationExternalModel: "GPT-3.5",
observationStartTime: new Date("2021-01-02T00:00:00.000Z"),
modelUnit: ModelUsageUnit.Tokens,
expectedInternalModel: "gpt-3.5-turbo",
expectedPromptTokens: 5,
expectedCompletionTokens: 7,
models: [
{
modelName: "gpt-3.5-turbo-new",
matchPattern: "(?i)^(gpt-)(35|3.5)(-turbo)?$",
startDate: new Date("2021-01-01T00:00:00.000Z"),
unit: ModelUsageUnit.Tokens,
tokenizerId: "openai",
},
{
modelName: "gpt-3.5-turbo",
matchPattern: "(?i)^(gpt-)(35|3.5)(-turbo)?$",
startDate: new Date("2021-01-01T10:00:00.000Z"),
unit: ModelUsageUnit.Tokens,
tokenizerId: "openai",
tokenizerModel: "gpt-3.5-turbo",
},
],
},
{
observationExternalModel: "ft:gpt-3.5-turbo-1106:my-org:custom_suffix:id",
observationStartTime: new Date("2022-01-01T10:00:00.000Z"),
modelUnit: ModelUsageUnit.Tokens,
expectedInternalModel: "ft:gpt-3.5-turbo-1106",
expectedPromptTokens: 0,
expectedCompletionTokens: 0,
models: [
{
modelName: "ft:gpt-3.5-turbo-1106",
matchPattern: "(?i)^(ft:)(gpt-3.5-turbo-1106:)(.+)(:)(.*)(:)(.+)$",
startDate: new Date("2022-01-01T00:00:00.000Z"),
unit: ModelUsageUnit.Tokens,
tokenizerId: "openai",
},
],
},
{
observationExternalModel: "ft:babbage-002:my-org#2:custom_suffix-2:id",
observationStartTime: new Date("2022-01-01T10:00:00.000Z"),
modelUnit: ModelUsageUnit.Tokens,
expectedInternalModel: "ft:babbage-002",
expectedPromptTokens: 0,
expectedCompletionTokens: 0,
models: [
{
modelName: "ft:babbage-002",
matchPattern: "(?i)^(ft:)(babbage-002:)(.+)(:)(.*)(:)(.+)$",
startDate: new Date("2022-01-01T00:00:00.000Z"),
unit: ModelUsageUnit.Tokens,
tokenizerId: "openai",
},
],
},
{
observationExternalModel: "GPT-4",
observationStartTime: new Date("2021-01-01T00:00:00.000Z"),
modelUnit: ModelUsageUnit.Tokens,
expectedInternalModel: null,
expectedPromptTokens: 0,
expectedCompletionTokens: 0,
models: [
{
modelName: "gpt-3.5-turbo",
matchPattern: "(?i)^(gpt-)(35|3.5)(-turbo)?$",
startDate: new Date("2021-01-01T00:00:00.000Z"),
unit: ModelUsageUnit.Tokens,
tokenizerId: "openai",
},
],
},
{
observationExternalModel: "GPT-3",
observationStartTime: new Date("2021-01-01T00:00:00.000Z"),
modelUnit: ModelUsageUnit.Characters,
expectedInternalModel: null,
expectedPromptTokens: 0,
expectedCompletionTokens: 0,
models: [
{
modelName: "gpt-3.5-turbo",
matchPattern: "(?i)^(gpt-)(35|3.5)(-turbo)?$",
startDate: new Date("2021-01-01T00:00:00.000Z"),
unit: ModelUsageUnit.Tokens,
tokenizerId: "openai",
},
],
},
].forEach((testConfig) => {
it(`should match observations to internal models ${JSON.stringify(
testConfig,
)}`, async () => {
const traceId = v4();
const generationId = v4();
await Promise.all(
testConfig.models.map(async (model) =>
prisma.model.create({
data: {
modelName: model.modelName,
matchPattern: model.matchPattern,
startDate: model.startDate,
unit: model.unit,
tokenizerId: model.tokenizerId,
tokenizerConfig: {
tokensPerMessage: 3,
tokensPerName: 1,
tokenizerModel:
"tokenizerModel" in model
? model.tokenizerModel
: model.modelName,
},
},
}),
),
);
const response = await makeAPICall("POST", "/api/public/ingestion", {
metadata: {
sdk_verion: "1.0.0",
sdk_name: "python",
},
batch: [
{
id: v4(),
type: "trace-create",
timestamp: new Date().toISOString(),
body: {
id: traceId,
name: "trace-name",
},
},
{
id: v4(),
type: "observation-create",
timestamp: new Date().toISOString(),
body: {
id: generationId,
traceId: traceId,
type: "GENERATION",
name: "generation-name",
startTime: testConfig.observationStartTime.toISOString(),
model: testConfig.observationExternalModel,
usage: {
unit: testConfig.modelUnit,
},
input: "This is a great prompt",
output: "This is a great gpt output",
},
},
],
});
expect(response.status).toBe(207);
console.log("response body", response.body);
const dbGeneration = await prisma.observation.findUnique({
where: {
id: generationId,
},
});
expect(dbGeneration?.id).toBe(generationId);
expect(dbGeneration?.traceId).toBe(traceId);
expect(dbGeneration?.name).toBe("generation-name");
expect(dbGeneration?.startTime).toEqual(testConfig.observationStartTime);
expect(dbGeneration?.model).toBe(testConfig.observationExternalModel);
expect(dbGeneration?.promptTokens).toBe(testConfig.expectedPromptTokens);
expect(dbGeneration?.completionTokens).toBe(
testConfig.expectedCompletionTokens,
);
expect(dbGeneration?.internalModel).toBe(
testConfig.expectedInternalModel,
);
});
});
it("should create and update all events", async () => {
const traceId = v4();
const generationId = v4();
const spanId = v4();
const eventId = v4();
const scoreId = v4();
const exception = `
ERROR langfuse:callback.py:677 'model_name'
Traceback (most recent call last):
File "/Users/maximiliandeichmann/development/github.com/langfuse/langfuse-python/langfuse/callback.py", line 674, in __on_llm_action
model_name = kwargs["invocation_params"]["model_name"]
KeyError: 'model_name'
`;
const response = await makeAPICall("POST", "/api/public/ingestion", {
batch: [
{
@@ -21,55 +568,56 @@ describe("/api/public/ingestion API Endpoint", () => {
timestamp: new Date().toISOString(),
body: {
id: traceId,
name: "trace-name",
userId: "user-1",
metadata: { key: "value" },
release: "1.0.0",
version: "2.0.0",
},
},
{
id: v4(),
type: "observation-create",
type: "span-create",
timestamp: new Date().toISOString(),
body: {
id: generationId,
id: spanId,
traceId: traceId,
type: "GENERATION",
name: "generation-name",
startTime: "2021-01-01T00:00:00.000Z",
endTime: "2021-01-01T00:00:00.000Z",
modelParameters: { key: "value" },
input: { key: "value" },
metadata: { key: "value" },
version: "2.0.0",
},
},
{
id: v4(),
type: "observation-update",
timestamp: new Date().toISOString(),
body: {
id: generationId,
type: "GENERATION",
output: { key: "this is a great gpt output" },
usage: { promptTokens: 400, completionTokens: 1000 },
},
},
{
id: v4(),
type: "observation-create",
type: "span-update",
timestamp: new Date().toISOString(),
body: {
id: spanId,
traceId: traceId,
type: "SPAN",
name: "span-name",
startTime: "2021-01-01T00:00:00.000Z",
endTime: "2021-01-01T00:00:00.000Z",
input: { input: "value" },
metadata: { meta: "value" },
version: "2.0.0",
},
},
{
id: v4(),
type: "generation-create",
timestamp: new Date().toISOString(),
body: {
id: generationId,
traceId: traceId,
parentObservationId: spanId,
modelParameters: { someKey: ["user-1", "user-2"] },
},
},
{
id: v4(),
type: "generation-update",
timestamp: new Date().toISOString(),
body: {
id: generationId,
name: "generation-name",
},
},
{
id: v4(),
type: "event-create",
timestamp: new Date().toISOString(),
body: {
id: eventId,
traceId: traceId,
name: "event-name",
parentObservationId: generationId,
},
},
{
@@ -79,8 +627,17 @@ describe("/api/public/ingestion API Endpoint", () => {
body: {
id: scoreId,
name: "score-name",
value: 100.5,
traceId: traceId,
value: 100.5,
observationId: generationId,
},
},
{
id: v4(),
type: "sdk-log",
timestamp: new Date().toISOString(),
body: {
log: exception,
},
},
],
@@ -90,17 +647,23 @@ describe("/api/public/ingestion API Endpoint", () => {
const dbTrace = await prisma.trace.findMany({
where: {
name: "trace-name",
id: traceId,
},
});
expect(dbTrace.length).toBeGreaterThan(0);
expect(dbTrace[0]?.name).toBe("trace-name");
expect(dbTrace[0]?.release).toBe("1.0.0");
expect(dbTrace[0]?.externalId).toBeNull();
expect(dbTrace[0]?.version).toBe("2.0.0");
expect(dbTrace[0]?.projectId).toBe("7a88fb47-b4e2-43b8-a06c-a5ce950dc53a");
const dbSpan = await prisma.observation.findUnique({
where: {
id: spanId,
},
});
expect(dbSpan?.id).toBe(spanId);
expect(dbSpan?.name).toBe("span-name");
expect(dbSpan?.traceId).toBe(traceId);
const dbGeneration = await prisma.observation.findUnique({
where: {
id: generationId,
@@ -110,34 +673,21 @@ describe("/api/public/ingestion API Endpoint", () => {
expect(dbGeneration?.id).toBe(generationId);
expect(dbGeneration?.traceId).toBe(traceId);
expect(dbGeneration?.name).toBe("generation-name");
expect(dbGeneration?.startTime).toEqual(
new Date("2021-01-01T00:00:00.000Z"),
);
expect(dbGeneration?.endTime).toEqual(new Date("2021-01-01T00:00:00.000Z"));
expect(dbGeneration?.model).toBeNull();
expect(dbGeneration?.modelParameters).toEqual({ key: "value" });
expect(dbGeneration?.input).toEqual({ key: "value" });
expect(dbGeneration?.metadata).toEqual({ key: "value" });
expect(dbGeneration?.version).toBe("2.0.0");
expect(dbGeneration?.promptTokens).toEqual(400);
expect(dbGeneration?.completionTokens).toEqual(1000);
expect(dbGeneration?.output).toEqual({
key: "this is a great gpt output",
expect(dbGeneration?.parentObservationId).toBe(spanId);
expect(dbGeneration?.modelParameters).toEqual({
someKey: ["user-1", "user-2"],
});
const dbSpan = await prisma.observation.findUnique({
const dbEvent = await prisma.observation.findUnique({
where: {
id: spanId,
id: eventId,
},
});
expect(dbSpan?.id).toBe(spanId);
expect(dbSpan?.name).toBe("span-name");
expect(dbSpan?.startTime).toEqual(new Date("2021-01-01T00:00:00.000Z"));
expect(dbSpan?.endTime).toEqual(new Date("2021-01-:00:00.000Z"));
expect(dbSpan?.input).toEqual({ input: "value" });
expect(dbSpan?.metadata).toEqual({ meta: "value" });
expect(dbSpan?.version).toBe("2.0.0");
expect(dbEvent?.id).toBe(eventId);
expect(dbEvent?.traceId).toBe(traceId);
expect(dbEvent?.name).toBe("event-name");
expect(dbEvent?.parentObservationId).toBe(generationId);
const dbScore = await prisma.score.findUnique({
where: {
@@ -147,9 +697,21 @@ describe("/api/public/ingestion API Endpoint", () => {
expect(dbScore?.id).toBe(scoreId);
expect(dbScore?.traceId).toBe(traceId);
expect(dbScore?.name).toBe("score-name");
expect(dbScore?.observationId).toBe(generationId);
expect(dbScore?.value).toBe(100.5);
expect(dbScore?.observationId).toBeNull();
const logEvent = await prisma.events.findFirst({
where: {
data: {
path: ["body", "log"],
string_contains: "ERROR",
},
},
});
expect(logEvent).toBeDefined();
expect(logEvent).not.toBeFalsy();
expect(JSON.stringify(logEvent?.data)).toContain("KeyError: 'model_name'");
});
it("should upsert threats", async () => {
@@ -353,6 +915,21 @@ describe("/api/public/ingestion API Endpoint", () => {
const traceId = v4();
const generationId = v4();
await prisma.model.create({
data: {
modelName: "gpt-3.5",
matchPattern: "(?i)^(gpt-)(35|3.5)(-turbo)?$",
startDate: new Date("2021-01-01T00:00:00.000Z"),
unit: ModelUsageUnit.Tokens,
tokenizerId: "openai",
tokenizerConfig: {
tokensPerMessage: 3,
tokensPerName: 1,
tokenizerModel: "gpt-3.5-turbo",
},
},
});
const responseOne = await makeAPICall("POST", "/api/public/ingestion", {
batch: [
{
@@ -420,6 +997,21 @@ describe("/api/public/ingestion API Endpoint", () => {
const traceId = v4();
const generationId = v4();
await prisma.model.create({
data: {
modelName: "gpt-3.5",
matchPattern: "(?i)^(gpt-)(35|3.5)(-turbo)?$",
startDate: new Date("2021-01-01T00:00:00.000Z"),
unit: ModelUsageUnit.Tokens,
tokenizerId: "openai",
tokenizerConfig: {
tokensPerMessage: 3,
tokensPerName: 1,
tokenizerModel: "gpt-3.5-turbo",
},
},
});
const responseOne = await makeAPICall("POST", "/api/public/ingestion", {
batch: [
{
@@ -529,6 +1121,66 @@ describe("/api/public/ingestion API Endpoint", () => {
expect(dbTrace[0]?.version).toBe("2.0.0");
});
it("should not override a trace from a different project", async () => {
const traceId = v4();
const newProjectId = v4();
await prisma.project.create({
data: {
id: newProjectId,
name: "another-project",
},
});
await prisma.trace.create({
data: {
id: traceId,
project: { connect: { id: newProjectId } },
},
});
const responseOne = await makeAPICall("POST", "/api/public/ingestion", {
batch: [
{
id: v4(),
type: "trace-create",
timestamp: new Date().toISOString(),
body: {
id: traceId,
name: "trace-name",
userId: "user-1",
metadata: { key: "value" },
release: "1.0.0",
version: "2.0.0",
},
},
],
});
expect(responseOne.status).toBe(207);
console.log(responseOne.body);
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
const errors = responseOne.body.errors;
expect(errors).toBeDefined();
console.log(errors);
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
expect(errors.length).toBe(1);
const dbTrace = await prisma.trace.findMany({
where: {
id: traceId,
},
});
expect(dbTrace.length).toEqual(1);
expect(dbTrace[0]?.name).toBeNull();
expect(dbTrace[0]?.release).toBeNull();
expect(dbTrace[0]?.metadata).toBeNull();
expect(dbTrace[0]?.version).toBeNull();
});
[
{
inputs: [{ a: "a" }, { b: "b" }],
@@ -686,4 +1338,80 @@ describe("/api/public/ingestion API Endpoint", () => {
expect(dbGeneration).toBeTruthy();
});
it("filters out NULL characters", async () => {
const traceId = v4();
const generationId = v4();
const responseOne = await makeAPICall("POST", "/api/public/ingestion", {
batch: [
{
id: v4(),
type: "trace-create",
timestamp: new Date().toISOString(),
body: {
id: traceId,
name: "trace-name",
},
},
{
id: v4(),
type: "observation-create",
timestamp: new Date().toISOString(),
body: {
id: generationId,
traceId: traceId,
type: "GENERATION",
name: "generation-name",
traceIdType: "LANGFUSE",
input: {
key: "IB\nibo.org Change site\nIB Home / . . . / News / News about the IB / Why ChatGPT is an opportunity for schools IB Home / News / News about the IB / Why ChatGPT is an opportunity for schools Why ChatGPT is an opportunity for schools Published: 06 March 2023 Last updated: 06 June 2023 Date published: 28 February 2023 Dr Matthew Glanville, Head of Assessment Principles and Practice Source: Why ChatGPT is an opportunity for schools | The Times Those of us who work in the schools or exam sector should not be terri \u0000 ed by ChatGPT and the rise of AI software we should be excited. We should embrace it as an extraordinary opportunity. Contrary to some stark warnings, it is not the end of exams, nor even a huge threat to coursework, but it does bring into very sharp focus the impact that arti \u0000 ",
},
output: {
key: "제점이 있었죠. 그중 하나는 일제가 한국의 신용체계를 망가뜨린 채 한국을 떠났다는 겁니다. 해방전 일제는 조선의 신용체계를 거의 독점적으로 소유한 상황이었습니다. 1945년 6월 기준 일제는 조선의 본점을 둔 전체은행 5개의 불입자본 총액의 89.7%를",
},
},
},
],
});
expect(responseOne.status).toBe(207);
const dbTrace = await prisma.trace.findMany({
where: {
id: traceId,
},
});
expect(dbTrace.length).toEqual(1);
const dbGeneration = await prisma.observation.findUnique({
where: {
id: generationId,
},
});
expect(dbGeneration?.input).toStrictEqual({
key: `IB
ibo.org Change site
IB Home / . . . / News / News about the IB / Why ChatGPT is an opportunity for schools IB Home / News / News about the IB / Why ChatGPT is an opportunity for schools Why ChatGPT is an opportunity for schools Published: 06 March 2023 Last updated: 06 June 2023 Date published: 28 February 2023 Dr Matthew Glanville, Head of Assessment Principles and Practice Source: Why ChatGPT is an opportunity for schools | The Times Those of us who work in the schools or exam sector should not be terri ed by ChatGPT and the rise of AI software we should be excited. We should embrace it as an extraordinary opportunity. Contrary to some stark warnings, it is not the end of exams, nor even a huge threat to coursework, but it does bring into very sharp focus the impact that arti `,
});
expect(dbGeneration?.output).toStrictEqual({
key: "제점이 있었죠. 그중 하나는 일제가 한국의 신용체계를 망가뜨린 채 한국을 떠났다는 겁니다. 해방전 일제는 조선의 신용체계를 거의 독점적으로 소유한 상황이었습니다. 1945년 6월 기준 일제는 조선의 본점을 둔 전체은행 5개의 불입자본 총액의 89.7%를",
});
expect(dbGeneration).toBeTruthy();
});
[
{ input: "A\u0000hallo", expected: "Ahallo" },
{ input: ["A\u0000hallo"], expected: ["Ahallo"] },
{ input: { obj: ["A\u0000hallo"] }, expected: { obj: ["Ahallo"] } },
].forEach(({ input, expected }) => {
it(`cleans events with null values ${JSON.stringify(
input,
)} ${JSON.stringify(expected)}`, () => {
const cleanedEvent = cleanEvent(input);
console.log(cleanedEvent);
expect(cleanedEvent).toStrictEqual(expected);
});
});
});
+96
View File
@@ -0,0 +1,96 @@
/** @jest-environment node */
import { modelMatch } from "@/scripts/model-match";
import { pruneDatabase } from "@/src/__tests__/test-utils";
import { ModelUsageUnit } from "@/src/constants";
import { prisma } from "@/src/server/db";
describe("model match", () => {
beforeEach(async () => await pruneDatabase());
it("should match historic observations to models", async () => {
await prisma.model.create({
data: {
id: "model-1",
modelName: "gpt-3.5-turbo",
inputPrice: "0.0000010",
outputPrice: "0.0000020",
totalPrice: "0.1",
matchPattern: "(.*)(gpt-3.5-turbo)?(.*)",
projectId: null,
unit: ModelUsageUnit.Tokens,
tokenizerConfig: {
tokensPerMessage: 3,
tokensPerName: 1,
tokenizerModel: "gpt-3.5-turbo",
},
tokenizerId: "openai",
},
});
await prisma.model.create({
data: {
id: "model-2",
modelName: "claude-1.3",
inputPrice: "0.0000010",
outputPrice: "0.0000020",
totalPrice: "0.1",
matchPattern: "(.*)(claude-1.3)?(.*)",
projectId: null,
unit: ModelUsageUnit.Tokens,
tokenizerId: "claude",
},
});
await prisma.observation.createMany({
data: [
{
id: "observation-1",
type: "GENERATION",
projectId: "7a88fb47-b4e2-43b8-a06c-a5ce950dc53a",
model: "gpt-3.5-turbo",
startTime: new Date("2024-01-01T00:00:00.000Z"),
unit: ModelUsageUnit.Tokens,
promptTokens: 200,
completionTokens: 3000,
input: "I am a prompt",
output: "I am a completion",
},
{
type: "GENERATION",
projectId: "7a88fb47-b4e2-43b8-a06c-a5ce950dc53a",
model: "claude-1.3",
startTime: new Date("2024-01-01T00:00:00.000Z"),
unit: ModelUsageUnit.Tokens,
input: "I am a prompt",
output: "I am a completion",
},
{
type: "GENERATION",
projectId: "7a88fb47-b4e2-43b8-a06c-a5ce950dc53a",
model: "claude-1.3",
startTime: new Date("2024-01-01T00:00:00.000Z"),
unit: ModelUsageUnit.Tokens,
input: "I am a prompt",
output: "I am a completion",
},
],
});
await modelMatch();
const observations = await prisma.observation.findMany();
// check that tokens from observation-1 are not changed
const observation1 = observations.find((o) => o.id === "observation-1");
expect(observation1?.promptTokens).toEqual(200);
expect(observation1?.completionTokens).toEqual(3000);
expect(observation1?.totalTokens).toEqual(0);
expect(observations.length).toEqual(3);
observations.forEach((observation) => {
expect(observation.internalModel).toBeDefined();
expect(observation.promptTokens).toBeGreaterThan(0);
expect(observation.completionTokens).toBeGreaterThan(0);
});
});
});
+70 -10
View File
@@ -1,11 +1,13 @@
/** @jest-environment node */
import { prisma } from "@/src/server/db";
import { makeAPICall, pruneDatabase } from "@/src/__tests__/test-utils";
import { v4 as uuidv4 } from "uuid";
import { type Observation } from "@prisma/client";
describe("/api/public/generations API Endpoint", () => {
import { makeAPICall, pruneDatabase } from "@/src/__tests__/test-utils";
import { ModelUsageUnit } from "@/src/constants";
import { prisma } from "@/src/server/db";
import { type ObservationView } from "@prisma/client";
describe("/api/public/observations API Endpoint", () => {
beforeEach(async () => await pruneDatabase());
afterEach(async () => await pruneDatabase());
@@ -26,6 +28,19 @@ describe("/api/public/generations API Endpoint", () => {
},
});
const model = await prisma.model.create({
data: {
id: "model-1",
modelName: "gpt-3.5-turbo",
inputPrice: "0.0000010",
outputPrice: "0.0000020",
totalPrice: "0.1",
matchPattern: "(.*)(gpt-)(35|3.5)(-turbo)?(.*)",
projectId: null,
unit: ModelUsageUnit.Tokens,
},
});
await prisma.observation.create({
data: {
id: uuidv4(),
@@ -33,15 +48,20 @@ describe("/api/public/generations API Endpoint", () => {
name: "generation-name",
startTime: new Date("2021-01-01T00:00:00.000Z"),
endTime: new Date("2021-01-01T00:00:00.000Z"),
model: "model-name",
model: "gpt-3.5-turbo",
modelParameters: { key: "value" },
input: { key: "input" },
output: { key: "output" },
promptTokens: 10,
completionTokens: 20,
totalTokens: 30,
version: "2.0.0",
type: "GENERATION",
project: {
connect: { id: "7a88fb47-b4e2-43b8-a06c-a5ce950dc53a" },
},
internalModel: "gpt-3.5-turbo",
unit: ModelUsageUnit.Tokens,
},
});
@@ -54,13 +74,27 @@ describe("/api/public/generations API Endpoint", () => {
expect(fetchedObservations.status).toBe(200);
if (!isObservationList(fetchedObservations.body)) {
throw new Error("Expected body to be an array of observations");
throw new Error(
"Expected body to be an array of observations" +
JSON.stringify(fetchedObservations.body),
);
}
expect(fetchedObservations.body.data.length).toBe(1);
expect(fetchedObservations.body.data[0]?.traceId).toBe(traceId);
expect(fetchedObservations.body.data[0]?.input).toEqual({ key: "input" });
expect(fetchedObservations.body.data[0]?.output).toEqual({ key: "output" });
expect(fetchedObservations.body.data[0]?.model).toEqual("gpt-3.5-turbo");
expect(fetchedObservations.body.data[0]?.modelId).toEqual(model.id);
expect(
fetchedObservations.body.data[0]?.calculatedInputCost,
).toBeGreaterThan(0);
expect(
fetchedObservations.body.data[0]?.calculatedOutputCost,
).toBeGreaterThan(0);
expect(
fetchedObservations.body.data[0]?.calculatedTotalCost,
).toBeGreaterThan(0);
});
it("should fetch all observations, filtered by generations", async () => {
await pruneDatabase();
@@ -79,6 +113,19 @@ describe("/api/public/generations API Endpoint", () => {
},
});
await prisma.model.create({
data: {
id: "model-1",
modelName: "gpt-3.5-turbo",
inputPrice: "0.0000010",
outputPrice: "0.0000020",
totalPrice: "0.1",
matchPattern: "(.*)(gpt-)(35|3.5)(-turbo)?(.*)",
projectId: null,
unit: ModelUsageUnit.Tokens,
},
});
await prisma.observation.create({
data: {
id: uuidv4(),
@@ -86,11 +133,16 @@ describe("/api/public/generations API Endpoint", () => {
name: "generation-name",
startTime: new Date("2021-01-01T00:00:00.000Z"),
endTime: new Date("2021-01-01T00:00:00.000Z"),
model: "model-name",
model: "gpt-3.5-turbo",
internalModel: "gpt-3.5-turbo",
modelParameters: { key: "value" },
input: { key: "input" },
output: { key: "output" },
promptTokens: 10,
completionTokens: 20,
totalTokens: 30,
version: "2.0.0",
unit: ModelUsageUnit.Tokens,
type: "GENERATION",
project: {
connect: { id: "7a88fb47-b4e2-43b8-a06c-a5ce950dc53a" },
@@ -105,7 +157,6 @@ describe("/api/public/generations API Endpoint", () => {
name: "generation-name",
startTime: new Date("2021-01-01T00:00:00.000Z"),
endTime: new Date("2021-01-01T00:00:00.000Z"),
model: "model-name",
modelParameters: { key: "value" },
input: { key: "input" },
output: { key: "output" },
@@ -123,6 +174,8 @@ describe("/api/public/generations API Endpoint", () => {
undefined,
);
console.log(fetchedObservations.body);
expect(fetchedObservations.status).toBe(200);
if (!isObservationList(fetchedObservations.body)) {
@@ -156,11 +209,18 @@ const isObservationList = (val: unknown): val is ObservationResponse => {
"input" in element &&
"output" in element &&
"metadata" in element &&
"version" in element,
"version" in element &&
"modelId" in element &&
"inputPrice" in element &&
"outputPrice" in element &&
"totalPrice" in element &&
"calculatedInputCost" in element &&
"calculatedOutputCost" in element &&
"calculatedTotalCost" in element,
)
);
};
type ObservationResponse = {
data: Observation[];
data: ObservationView[];
};
+344
View File
@@ -0,0 +1,344 @@
/** @jest-environment node */
import { prisma } from "@/src/server/db";
import { makeAPICall, pruneDatabase } from "@/src/__tests__/test-utils";
import { v4 as uuidv4, v4 } from "uuid";
import { type Prompt } from "@prisma/client";
describe("/api/public/prompts API Endpoint", () => {
beforeEach(async () => await pruneDatabase());
it("should fetch a prompt", async () => {
const promptId = uuidv4();
await prisma.prompt.create({
data: {
id: promptId,
name: "prompt-name",
prompt: "prompt",
isActive: true,
version: 1,
project: {
connect: { id: "7a88fb47-b4e2-43b8-a06c-a5ce950dc53a" },
},
createdBy: "user-1",
},
});
const fetchedObservations = await makeAPICall(
"GET",
"/api/public/prompts?name=prompt-name&version=1",
undefined,
);
expect(fetchedObservations.status).toBe(200);
if (!isPrompt(fetchedObservations.body)) {
throw new Error("Expected body to be a prompt");
}
expect(fetchedObservations.body.id).toBe(promptId);
expect(fetchedObservations.body.name).toBe("prompt-name");
expect(fetchedObservations.body.prompt).toBe("prompt");
expect(fetchedObservations.body.version).toBe(1);
expect(fetchedObservations.body.isActive).toBe(true);
expect(fetchedObservations.body.createdBy).toBe("user-1");
});
it("should fetch active prompt only if no prompt version is given", async () => {
const promptId = uuidv4();
await prisma.prompt.create({
data: {
id: promptId,
name: "prompt-name",
prompt: "prompt",
isActive: false,
version: 1,
project: {
connect: { id: "7a88fb47-b4e2-43b8-a06c-a5ce950dc53a" },
},
createdBy: "user-1",
},
});
const fetchedObservations = await makeAPICall(
"GET",
"/api/public/prompts?name=prompt-name",
undefined,
);
expect(fetchedObservations.status).toBe(404);
});
it("should fetch inactive prompt if prompt version is given", async () => {
const promptId = uuidv4();
const promptTwoId = uuidv4();
await prisma.prompt.create({
data: {
id: promptId,
name: "prompt-name",
prompt: "prompt-one",
isActive: false,
version: 1,
project: {
connect: { id: "7a88fb47-b4e2-43b8-a06c-a5ce950dc53a" },
},
createdBy: "user-1",
},
});
await prisma.prompt.create({
data: {
id: promptTwoId,
name: "prompt-name",
prompt: "prompt",
isActive: true,
version: 2,
project: {
connect: { id: "7a88fb47-b4e2-43b8-a06c-a5ce950dc53a" },
},
createdBy: "user-1",
},
});
const fetchedObservations = await makeAPICall(
"GET",
"/api/public/prompts?name=prompt-name&version=1",
undefined,
);
expect(fetchedObservations.status).toBe(200);
if (!isPrompt(fetchedObservations.body)) {
throw new Error("Expected body to be a prompt");
}
expect(fetchedObservations.body.id).toBe(promptId);
expect(fetchedObservations.body.name).toBe("prompt-name");
expect(fetchedObservations.body.prompt).toBe("prompt-one");
expect(fetchedObservations.body.version).toBe(1);
expect(fetchedObservations.body.isActive).toBe(false);
expect(fetchedObservations.body.createdBy).toBe("user-1");
});
it("should fetch active prompt when multiple exist", async () => {
const promptIdOne = uuidv4();
const promptIdTwo = uuidv4();
await prisma.prompt.create({
data: {
id: promptIdOne,
name: "prompt-name",
prompt: "prompt",
isActive: false,
version: 1,
project: {
connect: { id: "7a88fb47-b4e2-43b8-a06c-a5ce950dc53a" },
},
createdBy: "user-1",
},
});
await prisma.prompt.create({
data: {
id: promptIdTwo,
name: "prompt-name",
prompt: "prompt",
isActive: true,
version: 2,
project: {
connect: { id: "7a88fb47-b4e2-43b8-a06c-a5ce950dc53a" },
},
createdBy: "user-1",
},
});
const fetchedObservations = await makeAPICall(
"GET",
"/api/public/prompts?name=prompt-name",
undefined,
);
expect(fetchedObservations.status).toBe(200);
if (!isPrompt(fetchedObservations.body)) {
throw new Error("Expected body to be a prompt");
}
expect(fetchedObservations.body.id).toBe(promptIdTwo);
expect(fetchedObservations.body.name).toBe("prompt-name");
expect(fetchedObservations.body.prompt).toBe("prompt");
expect(fetchedObservations.body.version).toBe(2);
expect(fetchedObservations.body.isActive).toBe(true);
expect(fetchedObservations.body.createdBy).toBe("user-1");
});
it("should create and fetch a prompt", async () => {
await makeAPICall("POST", "/api/public/prompts", {
name: "prompt-name",
prompt: "prompt",
isActive: true,
projectId: "7a88fb47-b4e2-43b8-a06c-a5ce950dc53a",
});
const fetchedObservations = await makeAPICall(
"GET",
"/api/public/prompts?name=prompt-name&version=1",
undefined,
);
expect(fetchedObservations.status).toBe(200);
if (!isPrompt(fetchedObservations.body)) {
throw new Error("Expected body to be an array of observations");
}
expect(fetchedObservations.body.name).toBe("prompt-name");
expect(fetchedObservations.body.prompt).toBe("prompt");
expect(fetchedObservations.body.version).toBe(1);
expect(fetchedObservations.body.isActive).toBe(true);
expect(fetchedObservations.body.createdBy).toBe("API");
});
it("should relate generation to prompt", async () => {
const traceId = v4();
const generationId = v4();
const promptId = uuidv4();
await prisma.prompt.create({
data: {
id: promptId,
name: "prompt-name",
prompt: "prompt",
isActive: true,
version: 1,
project: {
connect: { id: "7a88fb47-b4e2-43b8-a06c-a5ce950dc53a" },
},
createdBy: "user-1",
},
});
const response = await makeAPICall("POST", "/api/public/ingestion", {
metadata: {
sdk_verion: "1.0.0",
sdk_name: "python",
},
batch: [
{
id: v4(),
type: "trace-create",
timestamp: new Date().toISOString(),
body: {
id: traceId,
name: "trace-name",
},
},
{
id: v4(),
type: "generation-create",
timestamp: new Date().toISOString(),
body: {
id: generationId,
traceId: traceId,
type: "GENERATION",
name: "generation-name",
promptName: "prompt-name",
promptVersion: 1,
},
},
],
});
expect(response.status).toBe(207);
const dbGeneration = await prisma.observation.findUnique({
where: {
id: generationId,
},
});
expect(dbGeneration?.id).toBe(generationId);
expect(dbGeneration?.promptId).toBe(promptId);
});
it("should fail if prompt version is missing", async () => {
const traceId = v4();
const generationId = v4();
const promptId = uuidv4();
await prisma.prompt.create({
data: {
id: promptId,
name: "prompt-name",
prompt: "prompt",
isActive: true,
version: 1,
project: {
connect: { id: "7a88fb47-b4e2-43b8-a06c-a5ce950dc53a" },
},
createdBy: "user-1",
},
});
const response = await makeAPICall("POST", "/api/public/ingestion", {
metadata: {
sdk_verion: "1.0.0",
sdk_name: "python",
},
batch: [
{
id: v4(),
type: "trace-create",
timestamp: new Date().toISOString(),
body: {
id: traceId,
name: "trace-name",
},
},
{
id: v4(),
type: "generation-create",
timestamp: new Date().toISOString(),
body: {
id: generationId,
traceId: traceId,
type: "GENERATION",
name: "generation-name",
promptName: "prompt-name",
},
},
],
});
expect(response.status).toBe(207);
console.log("response body", response.body);
const dbGeneration = await prisma.observation.findUnique({
where: {
id: generationId,
},
});
expect(dbGeneration).toBeNull();
});
});
const isPrompt = (x: unknown): x is Prompt => {
if (typeof x !== "object" || x === null) return false;
const prompt = x as Prompt;
return (
typeof prompt.id === "string" &&
typeof prompt.name === "string" &&
typeof prompt.version === "number" &&
typeof prompt.prompt === "string" &&
typeof prompt.isActive === "boolean" &&
typeof prompt.projectId === "string" &&
typeof prompt.createdBy === "string"
);
};
+2 -2
View File
@@ -22,7 +22,7 @@ describe("Build valid SQL queries", () => {
table: "traces_observations",
values: ["project-id", "project-id"],
strings: [
' FROM traces t LEFT JOIN observations o ON t.id = o.trace_id WHERE t."project_id" = ',
' FROM traces t LEFT JOIN observations_view o ON t.id = o.trace_id WHERE t."project_id" = ',
' AND o."project_id" = ',
" ;",
],
@@ -30,7 +30,7 @@ describe("Build valid SQL queries", () => {
{
table: "observations",
values: ["project-id"],
strings: [' FROM observations o WHERE o."project_id" = ', " ;"],
strings: [' FROM observations_view o WHERE o."project_id" = ', " ;"],
} as const,
{
table: "traces_scores",
@@ -0,0 +1,107 @@
/** @jest-environment node */
import { pruneDatabase } from "@/src/__tests__/test-utils";
import { appRouter } from "@/src/server/api/root";
import { createInnerTRPCContext } from "@/src/server/api/trpc";
import { prisma } from "@/src/server/db";
import type { Session } from "next-auth";
describe("Traces TRPC Router", () => {
beforeEach(async () => await pruneDatabase());
afterEach(async () => await pruneDatabase());
const session: Session = {
expires: "1",
user: {
id: "clgb17vnp000008jjere5g15i",
name: "John Doe",
projects: [
{
id: "7a88fb47-b4e2-43b8-a06c-a5ce950dc53a",
role: "ADMIN",
name: "test",
},
],
featureFlags: {
templateFlag: true,
},
admin: true,
},
};
const ctx = createInnerTRPCContext({ session });
const caller = appRouter.createCaller({ ...ctx, prisma });
test("traces.all RPC returns an array of traces", async () => {
const trace = {
name: "trace-name",
userId: "user-1",
metadata: { key: "value" },
release: "1.0.0",
version: "2.0.0",
};
await prisma.trace.create({
data: { ...trace, projectId: "7a88fb47-b4e2-43b8-a06c-a5ce950dc53a" },
});
const traces = await caller.traces.all({
page: 0,
limit: 10,
// projectId from `seed.ts`
projectId: "7a88fb47-b4e2-43b8-a06c-a5ce950dc53a",
filter: null,
searchQuery: "",
orderBy: null,
});
expect(traces).toBeDefined();
expect(traces).toMatchObject({ traces: [trace] });
});
test("traces.all RPC orders traces by userId", async () => {
const traceTmpl = {
name: "trace-name",
userId: "user-1",
metadata: { key: "value" },
release: "1.0.0",
version: "2.0.0",
};
const trace1 = traceTmpl;
const trace2 = { ...traceTmpl, userId: "user-2" };
await prisma.trace.create({
data: { ...traceTmpl, projectId: "7a88fb47-b4e2-43b8-a06c-a5ce950dc53a" },
});
await prisma.trace.create({
data: {
...trace2,
projectId: "7a88fb47-b4e2-43b8-a06c-a5ce950dc53a",
},
});
const tracesASC = await caller.traces.all({
page: 0,
limit: 10,
// projectId from `seed.ts`
projectId: "7a88fb47-b4e2-43b8-a06c-a5ce950dc53a",
filter: null,
searchQuery: "",
orderBy: {
column: "userId",
order: "ASC",
},
});
expect(tracesASC).toMatchObject({ traces: [trace1, trace2] });
const tracesDESC = await caller.traces.all({
page: 0,
limit: 10,
// projectId from `seed.ts`
projectId: "7a88fb47-b4e2-43b8-a06c-a5ce950dc53a",
filter: null,
searchQuery: "",
orderBy: {
column: "userId",
order: "DESC",
},
});
expect(tracesDESC).toMatchObject({ traces: [trace2, trace1] });
});
});
+62
View File
@@ -0,0 +1,62 @@
/** @jest-environment node */
import { makeAPICall, pruneDatabase } from "@/src/__tests__/test-utils";
import { prisma } from "@/src/server/db";
describe("/api/public/traces API Endpoint", () => {
beforeEach(async () => await pruneDatabase());
afterEach(async () => await pruneDatabase());
it("should create a session via a trace", async () => {
await pruneDatabase();
await makeAPICall("POST", "/api/public/traces", {
name: "trace-name",
projectId: "7a88fb47-b4e2-43b8-a06c-a5ce950dc53a",
sessionId: "session-id",
});
const dbSession = await prisma.traceSession.findFirst({
where: {
id: "session-id",
},
});
expect(dbSession).not.toBeNull();
expect(dbSession).toMatchObject({
id: "session-id",
projectId: "7a88fb47-b4e2-43b8-a06c-a5ce950dc53a",
});
});
it("should get session including traces", async () => {
await pruneDatabase();
await makeAPICall("POST", "/api/public/traces", {
name: "trace-name",
id: "trace-id",
input: { hello: "world" },
output: "hi",
projectId: "7a88fb47-b4e2-43b8-a06c-a5ce950dc53a",
sessionId: "session-id",
});
const response = await makeAPICall(
"GET",
"/api/public/sessions/session-id",
);
expect(response.status).toBe(200);
expect(response.body).toMatchObject({
id: "session-id",
projectId: "7a88fb47-b4e2-43b8-a06c-a5ce950dc53a",
traces: [
{
id: "trace-id",
input: { hello: "world" },
output: "hi",
},
],
});
});
});
+10 -10
View File
@@ -140,8 +140,8 @@ describe("/api/public/spans API Endpoint", () => {
name: "spanName",
},
});
expect(dbSpan?.id).toBe(spanId);
expect(dbSpan?.traceId).toBe(traceId);
expect(dbSpan.id).toBe(spanId);
expect(dbSpan.traceId).toBe(traceId);
});
it("should create trace when creating span without existing trace", async () => {
@@ -248,14 +248,14 @@ describe("/api/public/spans API Endpoint", () => {
expect(createSpan.status).toBe(200);
expect(dbSpan?.id).toBe(spanId);
expect(dbSpan?.traceId).toBe(dbTrace[0]?.id);
expect(dbSpan?.name).toBe(generationName);
expect(dbSpan?.startTime).toEqual(new Date("2021-01-01T00:00:00.000Z"));
expect(dbSpan?.endTime).toEqual(new Date("2021-01-01T00:00:00.000Z"));
expect(dbSpan?.input).toEqual({ key: "value" });
expect(dbSpan?.metadata).toEqual({ key: "value" });
expect(dbSpan?.version).toBe("2.0.0");
expect(dbSpan.id).toBe(spanId);
expect(dbSpan.traceId).toBe(dbTrace[0]?.id);
expect(dbSpan.name).toBe(generationName);
expect(dbSpan.startTime).toEqual(new Date("2021-01-01T00:00:00.000Z"));
expect(dbSpan.endTime).toEqual(new Date("2021-01-01T00:00:00.000Z"));
expect(dbSpan.input).toEqual({ key: "value" });
expect(dbSpan.metadata).toEqual({ key: "value" });
expect(dbSpan.version).toBe("2.0.0");
});
it("should update span", async () => {
+10 -2
View File
@@ -9,6 +9,12 @@ export const pruneDatabase = async () => {
await prisma.score.deleteMany();
await prisma.observation.deleteMany();
await prisma.trace.deleteMany();
await prisma.datasetItem.deleteMany();
await prisma.dataset.deleteMany();
await prisma.datasetRuns.deleteMany();
await prisma.prompt.deleteMany();
await prisma.events.deleteMany();
await prisma.model.deleteMany();
};
export function createBasicAuthHeader(
@@ -24,7 +30,7 @@ export function createBasicAuthHeader(
export async function makeAPICall(
method: "POST" | "GET" | "PUT" | "DELETE" | "PATCH",
url: string,
body: unknown,
body?: unknown,
) {
const finalUrl = `http://localhost:3000/${url}`;
const options = {
@@ -37,7 +43,9 @@ export async function makeAPICall(
"sk-lf-1234567890",
),
},
body: JSON.stringify(body),
// Conditionally include the body property if the method is not "GET"
...(method !== "GET" &&
body !== undefined && { body: JSON.stringify(body) }),
};
const a = await fetch(finalUrl, options);
+78 -11
View File
@@ -40,33 +40,100 @@ describe("/api/public/traces API Endpoint", () => {
id: "trace-id",
name: "trace-name",
userId: "user-1",
projectId: "7a88fb47-b4e2-43b8-a06c-a5ce950dc53a",
metadata: { key: "value" },
release: "1.0.0",
version: "2.0.0",
public: true,
});
const dbTrace1 = await prisma.trace.findFirst({
where: {
id: "trace-id",
},
});
expect(dbTrace1).not.toBeNull();
expect(dbTrace1).toMatchObject({
name: "trace-name",
release: "1.0.0",
externalId: null,
version: "2.0.0",
public: true,
userId: "user-1",
});
await makeAPICall("POST", "/api/public/traces", {
id: "trace-id",
name: "trace-name",
userId: "user-1",
projectId: "7a88fb47-b4e2-43b8-a06c-a5ce950dc53a",
metadata: { key: "value" },
release: "1.0.0",
version: "5.0.0",
public: false,
});
const dbTrace = await prisma.trace.findMany({
const dbTrace2 = await prisma.trace.findFirst({
where: {
name: "trace-name",
},
});
expect(dbTrace.length).toBeGreaterThan(0);
expect(dbTrace[0]?.name).toBe("trace-name");
expect(dbTrace[0]?.release).toBe("1.0.0");
expect(dbTrace[0]?.externalId).toBeNull();
expect(dbTrace[0]?.version).toBe("5.0.0");
expect(dbTrace[0]?.projectId).toBe("7a88fb47-b4e2-43b8-a06c-a5ce950dc53a");
expect(dbTrace2).not.toBeNull();
expect(dbTrace2).toMatchObject({
name: "trace-name",
release: "1.0.0",
externalId: null,
version: "5.0.0",
public: false,
userId: "user-1",
});
});
it("should use tags correctly on POST and GET", async () => {
await pruneDatabase();
await makeAPICall("POST", "/api/public/traces", {
id: "trace-1",
tags: ["tag-1", "tag-2", "tag-3"],
});
await makeAPICall("POST", "/api/public/traces", {
id: "trace-2",
tags: ["tag-1"],
});
await makeAPICall("POST", "/api/public/traces", {
id: "trace-3",
tags: ["tag-2", "tag-3"],
});
// multiple tags
const traces = await makeAPICall(
"GET",
"/api/public/traces?tags=tag-2&tags=tag-3",
);
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access
const traceIds = traces.body.data.map((t: { id: string }) => t.id);
// check for equality ok as ordered by timestamp
expect(traceIds).toEqual(["trace-3", "trace-1"]);
// single tag
const traces2 = await makeAPICall("GET", "/api/public/traces?tags=tag-1");
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access
const traceIds2 = traces2.body.data.map((t: { id: string }) => t.id);
// check for equality ok as ordered by timestamp
expect(traceIds2).toEqual(["trace-2", "trace-1"]);
// wrong tag
const traces3 = await makeAPICall("GET", "/api/public/traces?tags=tag-10");
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access
const traceIds3 = traces3.body.data.map((t: { id: string }) => t.id);
// check for equality ok as ordered by timestamp
expect(traceIds3).toEqual([]);
// no tag
const traces4 = await makeAPICall("GET", "/api/public/traces?tags=");
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access
const traceIds4 = traces4.body.data.map((t: { id: string }) => t.id);
// check for equality ok as ordered by timestamp
expect(traceIds4).toEqual(["trace-3", "trace-2", "trace-1"]);
});
});
+94 -21
View File
@@ -1,17 +1,42 @@
import { ModelUsageUnit } from "@/src/constants";
import { tokenCount } from "@/src/features/ingest/lib/usage";
describe("Token Count Functions", () => {
const generateModel = (model: string, tokenizer: string) => {
return {
id: "1",
modelName: model,
tokenizerId: tokenizer,
tokenizerConfig: {
tokensPerMessage: 3,
tokensPerName: 1,
tokenizerModel: model,
},
createdAt: new Date(),
updatedAt: new Date(),
matchPattern: "",
projectId: null,
startDate: null,
inputPrice: null,
outputPrice: null,
totalPrice: null,
unit: ModelUsageUnit.Tokens,
};
};
describe("token count for strings", () => {
[
{ model: "gpt-3.5", tokens: 114 },
{ model: "gpt-4-1106-preview", tokens: 114 },
{ model: "gpt-4-vision-preview", tokens: 114 },
{ model: "claude", tokens: 118 },
{ model: "claude-instant-1.2", tokens: 118 },
].forEach(({ model, tokens }) => {
{ model: "gpt-3.5-turbo", tokenizer: "openai", tokens: 114 },
{ model: "text-embedding-ada-002", tokenizer: "openai", tokens: 114 },
{ model: "gpt-4-1106-preview", tokenizer: "openai", tokens: 114 },
{ model: "gpt-4-vision-preview", tokenizer: "openai", tokens: 114 },
{ model: "claude", tokenizer: "claude", tokens: 118 },
{ model: "claude-instant-1.2", tokenizer: "claude", tokens: 118 },
{ model: "gpt-3.5-turbo-1106", tokenizer: "openai", tokens: 114 },
].forEach(({ model, tokens, tokenizer }) => {
it(`should return token count ${tokens} for ${model}`, () => {
const result = tokenCount({
model: model,
model: generateModel(model, tokenizer),
text: "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.",
});
expect(result).toBeDefined();
@@ -21,20 +46,67 @@ describe("Token Count Functions", () => {
it("should return undefined for unknown model", () => {
const result = tokenCount({
model: "unknown-model",
model: generateModel("unknown-model", "unknown-tokenizer"),
text: "Hello, World!",
});
expect(result).toBeUndefined();
});
it("check extensive openai chat message", () => {
const result = tokenCount({
model: generateModel("gpt-3.5-turbo", "openai"),
text: [
{
role: "system",
content: "some test",
id: "some-id",
isPersisted: true,
},
{
id: "some-id",
content: "some test",
role: "user",
timestamp: "2024-01-00:00:00.488Z",
isPersisted: true,
},
{
id: "some id",
content:
"Hey Simon! 😊 How's your day going? Have you been up to anything interesting lately?",
role: "user",
timestamp: "2024-01-24T10:00:00.929Z",
isPersisted: true,
},
{
content: true,
role: "user",
id: "some id",
},
{
role: "system",
content: "This is some content",
},
{
id: "another id",
role: "assistant",
content: "This is some content",
},
],
});
expect(result).toBe(155);
});
it("should return for invalid text type", () => {
const result = tokenCount({ model: "gpt-4", text: 1234 });
const result = tokenCount({
model: generateModel("gpt-4", "openai"),
text: 1234,
});
expect(result).toBe(2);
});
it("should return correct token count for empty string", () => {
const result = tokenCount({
model: "gpt-4",
model: generateModel("gpt-4", "openai"),
text: "",
});
expect(result).toBe(0);
@@ -43,7 +115,7 @@ describe("Token Count Functions", () => {
it("should return correct token count for very long string", () => {
const longString = "A".repeat(10000);
const result = tokenCount({
model: "gpt-4",
model: generateModel("gpt-4", "openai"),
text: longString,
});
expect(result).toBeDefined();
@@ -52,14 +124,14 @@ describe("Token Count Functions", () => {
it("should return undefined for null text input", () => {
const result = tokenCount({
model: "gpt-4",
model: generateModel("gpt-4", "openai"),
text: null,
});
expect(result).toBeUndefined();
});
it("should return undefined for undefined text input", () => {
const result = tokenCount({
model: "gpt-4",
model: generateModel("gpt-4", "openai"),
text: undefined,
});
expect(result).toBeUndefined();
@@ -68,13 +140,14 @@ describe("Token Count Functions", () => {
describe("token count for chat messages", () => {
[
{ model: "gpt-4", tokens: 44 },
{ model: "gpt-3.5-turbo-16k-0613", tokens: 44 },
{ model: "claude-instant-1.2", tokens: 48 },
].forEach(({ model, tokens }) => {
{ model: "gpt-4", tokenizer: "openai", tokens: 44 },
{ model: "gpt-3.5-turbo-16k-0613", tokenizer: "openai", tokens: 44 },
{ model: "gpt-3.5-turbo-16k-0613", tokenizer: "openai", tokens: 44 },
{ model: "claude-instant-1.2", tokenizer: "claude", tokens: 48 },
].forEach(({ model, tokens, tokenizer }) => {
it(`should return token count ${tokens} for ${model}`, () => {
const result = tokenCount({
model: model,
model: generateModel(model, tokenizer),
text: [
{ role: "system", content: "You are a helpful assistant." },
{ role: "user", content: "Who won the world series in 2020?" },
@@ -91,7 +164,7 @@ describe("Token Count Functions", () => {
it("should return for non array", () => {
const result = tokenCount({
model: "gpt-4",
model: generateModel("gpt-4", "openai"),
text: { role: "Helo world" },
});
expect(result).toBe(7);
@@ -99,7 +172,7 @@ describe("Token Count Functions", () => {
it("should return for empty array", () => {
const result = tokenCount({
model: "gpt-4",
model: generateModel("gpt-4", "openai"),
text: [],
});
expect(result).toBeUndefined();
@@ -107,7 +180,7 @@ describe("Token Count Functions", () => {
it("should return for array of invalid object", () => {
const result = tokenCount({
model: "gpt-4",
model: generateModel("gpt-4", "openai"),
text: [{ role: "Helo world" }],
});
expect(result).toBe(9);
+49 -9
View File
@@ -1,3 +1,7 @@
import { AlertTriangle } from "lucide-react";
import { VERSION } from "@/src/constants";
import { env } from "@/src/env.mjs";
import { cn } from "@/src/utils/tailwind";
export const LangfuseIcon = ({
@@ -20,19 +24,55 @@ export const LangfuseIcon = ({
export const LangfuseLogo = ({
className,
size = "sm",
version = false,
showEnvLabel = false,
}: {
size?: "sm" | "xl";
className?: string;
version?: boolean;
showEnvLabel?: boolean;
}) => (
<div className={cn("flex items-center", className)}>
<LangfuseIcon size={size === "sm" ? 16 : 20} />
<span
className={cn(
"font-mono font-semibold",
size === "sm" ? "ml-2 text-sm" : "ml-3 text-xl",
<div className={cn("flex gap-4 xl:flex-col xl:items-start", className)}>
{/* Environment Labeling for Langfuse Maintainers */}
{showEnvLabel && env.NEXT_PUBLIC_LANGFUSE_CLOUD_REGION && (
<div
className={cn(
"flex items-center gap-2 self-stretch rounded-md px-3 py-1 ring-1 xl:-mx-2",
env.NEXT_PUBLIC_LANGFUSE_CLOUD_REGION === "STAGING"
? "bg-blue-100 text-blue-500 ring-blue-500"
: "bg-red-100 text-red-500 ring-red-500",
)}
>
<AlertTriangle size={16} />
<span className="whitespace-nowrap">
{["EU", "US"].includes(env.NEXT_PUBLIC_LANGFUSE_CLOUD_REGION)
? `PRODUCTION-${env.NEXT_PUBLIC_LANGFUSE_CLOUD_REGION}`
: env.NEXT_PUBLIC_LANGFUSE_CLOUD_REGION}
</span>
</div>
)}
{/* Langfuse Logo */}
<div className="flex items-center">
<LangfuseIcon size={size === "sm" ? 16 : 20} />
<span
className={cn(
"font-mono font-semibold",
size === "sm" ? "ml-2 text-sm" : "ml-3 text-xl",
)}
>
Langfuse
</span>
{version && (
<a
href="https://github.com/langfuse/langfuse/releases"
target="_blank"
rel="noopener"
title="View releases on GitHub"
className="ml-2 text-xs text-gray-400"
>
{VERSION}
</a>
)}
>
Langfuse
</span>
</div>
</div>
);
-60
View File
@@ -1,60 +0,0 @@
import { StarIcon } from "lucide-react";
import { Button } from "@/src/components/ui/button";
import { api } from "@/src/utils/api";
import { useHasAccess } from "@/src/features/rbac/utils/checkAccess";
import { useEffect, useState } from "react";
export function BookmarkTrace({
traceId,
projectId,
isBookmarked,
size = "sm",
}: {
traceId: string;
projectId: string;
isBookmarked: boolean;
size?: "sm" | "xs";
}) {
const utils = api.useUtils();
const [cacheIsBookmarked, setCacheIsBookmarked] = useState<boolean | null>(
null,
);
const localIsBookmarked = cacheIsBookmarked ?? isBookmarked;
const hasAccess = useHasAccess({ projectId, scope: "traces:bookmark" });
const mutBookmarkTrace = api.traces.bookmark.useMutation({
onSuccess: () => {
setCacheIsBookmarked(!localIsBookmarked);
void utils.traces.invalidate();
},
});
useEffect(() => {
setCacheIsBookmarked(null);
}, [isBookmarked]);
const handleBookmarkClick = () => {
if (!hasAccess) return;
void mutBookmarkTrace.mutateAsync({
traceId,
projectId,
bookmarked: !localIsBookmarked,
});
};
return (
<Button
variant="ghost"
size={size}
onClick={handleBookmarkClick}
disabled={!hasAccess}
loading={mutBookmarkTrace.isLoading}
>
<StarIcon
className={`h-4 w-4 ${
localIsBookmarked ? "fill-current text-yellow-500" : "text-gray-500"
}`}
/>
</Button>
);
}
+36 -22
View File
@@ -1,7 +1,7 @@
"use client";
import * as React from "react";
import { Calendar as CalendarIcon } from "lucide-react";
import { Calendar as CalendarIcon, X } from "lucide-react";
import { Button } from "@/src/components/ui/button";
import { Calendar } from "@/src/components/ui/calendar";
import {
@@ -39,36 +39,50 @@ export type AvailableDateRangeSelections =
export function DatePicker({
date,
onChange,
clearable = false,
className,
}: {
date?: Date | undefined;
onChange: (date: Date | undefined) => void;
clearable?: boolean;
className?: string;
}) {
return (
<Popover>
<PopoverTrigger asChild>
<div className="flex flex-row gap-2 align-middle">
<Popover>
<PopoverTrigger asChild>
<Button
variant={"outline"}
className={cn(
"justify-start text-left font-normal",
!date && "text-muted-foreground",
className,
)}
>
<CalendarIcon className="mr-2 h-4 w-4" />
{date ? format(date, "PPP") : <span>Pick a date</span>}
</Button>
</PopoverTrigger>
<PopoverContent className="w-auto p-0">
<Calendar
mode="single"
selected={date}
onSelect={(d) => onChange(d)}
initialFocus
/>
</PopoverContent>
</Popover>
{date && clearable && (
<Button
variant={"outline"}
className={cn(
"justify-start text-left font-normal",
!date && "text-muted-foreground",
className,
)}
variant="ghost"
size="icon"
onClick={() => onChange(undefined)}
title="reset date"
>
<CalendarIcon className="mr-2 h-4 w-4" />
{date ? format(date, "PPP") : <span>Pick a date</span>}
<X size={14} />
</Button>
</PopoverTrigger>
<PopoverContent className="w-auto p-0">
<Calendar
mode="single"
selected={date}
onSelect={(d) => onChange(d)}
initialFocus
/>
</PopoverContent>
</Popover>
)}
</div>
);
}
@@ -191,7 +205,7 @@ export function DatePickerWithRange({
{DEFAULT_DATE_RANGE_SELECTION}
</SelectItem>
{dateTimeAggregationOptions.toReversed().map((item) => (
<SelectItem key={item} value={`${item}`}>
<SelectItem key={item} value={item}>
{item}
</SelectItem>
))}
+18 -8
View File
@@ -1,6 +1,6 @@
import { TrashIcon } from "lucide-react";
import { useRouter } from "next/router";
import { useState } from "react";
import { Button } from "@/src/components/ui/button";
import { api } from "@/src/utils/api";
import {
@@ -9,6 +9,7 @@ import {
PopoverTrigger,
} from "@/src/components/ui/popover";
import { useHasAccess } from "@/src/features/rbac/utils/checkAccess";
import { usePostHog } from "posthog-js/react";
export function DeleteTrace({
traceId,
@@ -19,13 +20,16 @@ export function DeleteTrace({
projectId: string;
isTableAction?: boolean;
}) {
const [isDeleted, setIsDeleted] = useState(false);
const router = useRouter();
const utils = api.useUtils();
const posthog = usePostHog();
const hasAccess = useHasAccess({ projectId, scope: "traces:delete" });
const mutDeleteTrace = api.traces.delete.useMutation({
const mutDeleteTraces = api.traces.deleteMany.useMutation({
onSuccess: () => {
setIsDeleted(true);
if (!isTableAction) {
void router
.push(`/project/${projectId}/traces`)
@@ -41,14 +45,14 @@ export function DeleteTrace({
}
return (
<Popover>
<Popover key={traceId}>
<PopoverTrigger asChild>
{isTableAction ? (
<Button variant="ghost" size="xs">
<TrashIcon className="h-4 w-4" />
</Button>
) : (
<Button variant="outline" type="button">
<Button variant="outline" type="button" size="icon">
<TrashIcon className="h-4 w-4" />
</Button>
)}
@@ -63,10 +67,16 @@ export function DeleteTrace({
<Button
type="button"
variant="destructive"
loading={mutDeleteTrace.isLoading}
onClick={() =>
void mutDeleteTrace.mutateAsync({ traceId, projectId })
}
loading={mutDeleteTraces.isLoading || isDeleted}
onClick={() => {
void mutDeleteTraces.mutateAsync({
traceIds: [traceId],
projectId,
});
posthog.capture("trace:delete", {
source: isTableAction ? "table-single-row" : "trace",
});
}}
>
Delete trace
</Button>

Some files were not shown because too many files have changed in this diff Show More