Compare commits

...
6 Commits
Author SHA1 Message Date
Marc Klingen 9bb84878e3 chore: release v2.19.0
CI/CD / lint (push) Waiting to run
CI/CD / test-docker-build (push) Waiting to run
CI/CD / tests (20) (push) Waiting to run
CI/CD / e2e-tests (push) Waiting to run
CI/CD / all-ci-passed (push) Blocked by required conditions
CI/CD / push-docker-image (push) Blocked by required conditions
release.yml / release (push) Waiting to run
2024-04-08 23:08:11 +02:00
Thomas CalvetandGitHub c7aec93a21 feat(api): expose promptId via GET /observations (#1619) 2024-04-08 23:01:25 +02:00
b0dbae98e8 chore: add docs to nav and overflow of score comment (#1620)
* Add Docs link to bottom navigation

* Update HoverCardContent styling

* open docs in new tab

* break score comments

---------

Co-authored-by: Marc Klingen <git@marcklingen.com>
2024-04-08 20:55:10 +00:00
65e6cc819d feat(prompts): improve type safety by using columnHelper (#1586)
Co-authored-by: Max Deichmann <m.deichmann@tum.de>
2024-04-08 20:26:59 +00:00
Marc Klingen f307b298c2 chore: remove codeowners 2024-04-08 22:16:01 +02:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
78c4774b1e chore(deps): bump @aws-sdk/lib-storage from 3.540.0 to 3.550.0 (#1622)
Bumps [@aws-sdk/lib-storage](https://github.com/aws/aws-sdk-js-v3/tree/HEAD/lib/lib-storage) from 3.540.0 to 3.550.0.
- [Release notes](https://github.com/aws/aws-sdk-js-v3/releases)
- [Changelog](https://github.com/aws/aws-sdk-js-v3/blob/main/lib/lib-storage/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-js-v3/commits/v3.550.0/lib/lib-storage)

---
updated-dependencies:
- dependency-name: "@aws-sdk/lib-storage"
  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-04-08 20:13:49 +00:00
13 changed files with 78 additions and 58 deletions
+2 -1
View File
@@ -1 +1,2 @@
* @langfuse/maintainers
# Currently inactive
# * @langfuse/maintainers
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "langfuse",
"version": "2.18.1",
"version": "2.19.0",
"author": "engineering@langfuse.com",
"license": "MIT",
"private": true,
+4 -4
View File
@@ -159,8 +159,8 @@ importers:
specifier: ^3.507.0
version: 3.536.0
'@aws-sdk/lib-storage':
specifier: ^3.540.0
version: 3.540.0(@aws-sdk/client-s3@3.536.0)
specifier: ^3.550.0
version: 3.550.0(@aws-sdk/client-s3@3.536.0)
'@aws-sdk/s3-request-presigner':
specifier: ^3.540.0
version: 3.540.0
@@ -1097,8 +1097,8 @@ packages:
- aws-crt
dev: false
/@aws-sdk/lib-storage@3.540.0(@aws-sdk/client-s3@3.536.0):
resolution: {integrity: sha512-xNLOpuOSzGO90fwn+GBsM//a4ALYl85WEsovKyJI6jYJTMCGLrzJQeq8cxeC5Xz6w8Ol86lf80Gll/cz4phy7g==}
/@aws-sdk/lib-storage@3.550.0(@aws-sdk/client-s3@3.536.0):
resolution: {integrity: sha512-zDUM4hV/t148DCXschwDusH9tzg7U1MpuUaUPJlklx9Va+NnjrjtWHwL/JeZ5sfGR/1wTZIg3sKho/4P2oAYrQ==}
engines: {node: '>=14.0.0'}
peerDependencies:
'@aws-sdk/client-s3': ^3.0.0
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "web",
"version": "2.18.1",
"version": "2.19.0",
"private": true,
"license": "MIT",
"engines": {
@@ -23,7 +23,7 @@
"dependencies": {
"@anthropic-ai/tokenizer": "^0.0.4",
"@aws-sdk/client-s3": "^3.507.0",
"@aws-sdk/lib-storage": "^3.540.0",
"@aws-sdk/lib-storage": "^3.550.0",
"@aws-sdk/s3-request-presigner": "^3.540.0",
"@headlessui/react": "^1.7.18",
"@heroicons/react": "^2.1.3",
@@ -41,6 +41,19 @@ describe("/api/public/observations API Endpoint", () => {
},
});
const prompt = await prisma.prompt.create({
data: {
name: "prompt-name",
prompt: "prompt-one",
isActive: false,
version: 1,
project: {
connect: { id: "7a88fb47-b4e2-43b8-a06c-a5ce950dc53a" },
},
createdBy: "user-1",
},
});
await prisma.observation.create({
data: {
id: uuidv4(),
@@ -62,6 +75,9 @@ describe("/api/public/observations API Endpoint", () => {
},
internalModel: "gpt-3.5-turbo",
unit: ModelUsageUnit.Tokens,
prompt: {
connect: { id: prompt.id },
},
},
});
@@ -95,6 +111,7 @@ describe("/api/public/observations API Endpoint", () => {
expect(
fetchedObservations.body.data[0]?.calculatedTotalCost,
).toBeGreaterThan(0);
expect(fetchedObservations.body.data[0]?.promptId).toBe(prompt.id);
});
it("should fetch all observations, filtered by generations", async () => {
await pruneDatabase();
+1 -1
View File
@@ -40,7 +40,7 @@ export const GroupedScoreBadges = ({
<HoverCardTrigger className="ml-1 inline-block cursor-pointer">
<MessageCircle size={12} />
</HoverCardTrigger>
<HoverCardContent>
<HoverCardContent className="overflow-hidden whitespace-normal break-normal">
<p>{s.comment}</p>
</HoverCardContent>
</HoverCard>
+2
View File
@@ -502,6 +502,7 @@ const MainNavigation: React.FC<{
"group flex gap-x-3 rounded-md p-2 text-sm font-semibold leading-6",
)}
onClick={onNavitemClick}
target={item.newTab ? "_blank" : undefined}
>
{item.icon && (
<item.icon
@@ -580,6 +581,7 @@ const MainNavigation: React.FC<{
: "text-gray-700 hover:bg-gray-50 hover:text-indigo-600",
"flex w-full items-center gap-x-3 rounded-md py-2 pl-9 pr-2 text-sm leading-6",
)}
target={subItem.newTab ? "_blank" : undefined}
>
{subItem.name}
{subItem.label && (
+9
View File
@@ -9,6 +9,7 @@ import {
Settings,
UsersIcon,
PenSquareIcon,
LibraryBig,
TerminalIcon,
} from "lucide-react";
@@ -21,6 +22,7 @@ export type Route = {
pathname?: string; // link, ignored if children
children?: Array<Route>; // folder
bottom?: boolean; // bottom of the sidebar, only for first level routes
newTab?: boolean; // open in new tab
};
export const ROUTES: Route[] = [
@@ -93,6 +95,13 @@ export const ROUTES: Route[] = [
icon: Settings,
bottom: true,
},
{
name: "Docs",
pathname: "https://langfuse.com/docs",
icon: LibraryBig,
bottom: true,
newTab: true,
},
{
name: "Support",
pathname: "/project/[projectId]/support",
+1 -1
View File
@@ -1 +1 @@
export const VERSION = "v2.18.1";
export const VERSION = "v2.19.0";
@@ -13,8 +13,9 @@ import { useHasAccess } from "@/src/features/rbac/utils/checkAccess";
import useProjectIdFromURL from "@/src/hooks/useProjectIdFromURL";
import { api } from "@/src/utils/api";
import { type RouterOutput } from "@/src/utils/types";
import { createColumnHelper } from "@tanstack/react-table";
type RowData = {
type PromptTableRow = {
name: string;
version: number;
id: string;
@@ -46,12 +47,12 @@ export function PromptTable() {
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [prompts.isSuccess, prompts.data]);
const columns: LangfuseColumnDef<RowData>[] = [
{
accessorKey: "name",
const columnHelper = createColumnHelper<PromptTableRow>();
const promptColumns = [
columnHelper.accessor("name", {
header: "Name",
cell: ({ row }) => {
const name: string = row.getValue("name");
cell: (row) => {
const name = row.getValue();
return name ? (
<TableLink
path={`/project/${projectId}/prompts/${encodeURIComponent(name)}`}
@@ -60,40 +61,33 @@ export function PromptTable() {
/>
) : undefined;
},
},
{
accessorKey: "version",
}),
columnHelper.accessor("version", {
header: "Latest Version",
cell: ({ row }) => {
const version = row.getValue("version");
return version;
cell: (row) => {
return row.getValue();
},
},
{
accessorKey: "type",
}),
columnHelper.accessor("type", {
header: "Type",
cell: ({ row }) => {
return capitalize(row.getValue("type"));
cell: (row) => {
return row.getValue();
},
},
{
accessorKey: "createdAt",
}),
columnHelper.accessor("createdAt", {
header: "Latest Version Created At",
cell: ({ row }) => {
const createdAt: Date = row.getValue("createdAt");
cell: (row) => {
const createdAt = row.getValue();
return createdAt.toLocaleString();
},
},
{
accessorKey: "numberOfObservations",
}),
columnHelper.accessor("numberOfObservations", {
header: "Number of Generations",
cell: ({ row }) => {
const numberOfObservations: number = row.getValue(
"numberOfObservations",
);
const name: string = row.getValue("name");
cell: (row) => {
const numberOfObservations = row.getValue();
const name = row.row.original.name;
const filter = encodeURIComponent(
`Prompt Name;stringOptions;;any of;${name}`,
`promptName;stringOptions;;any of;${name}`,
);
return (
<TableLink
@@ -102,24 +96,20 @@ export function PromptTable() {
/>
);
},
},
{
accessorKey: "actions",
}),
columnHelper.display({
id: "actions",
header: "Actions",
cell: ({ row }) => {
return (
<DeletePrompt
projectId={projectId}
promptName={row.getValue("name")}
/>
);
cell: (row) => {
const name = row.row.original.name;
return <DeletePrompt projectId={projectId} promptName={name} />;
},
},
];
}),
] as LangfuseColumnDef<PromptTableRow>[];
const convertToTableRow = (
item: RouterOutput["prompts"]["all"][number],
): RowData => {
): PromptTableRow => {
return {
id: item.id,
name: item.name,
@@ -134,7 +124,7 @@ export function PromptTable() {
return (
<div>
<DataTable
columns={columns}
columns={promptColumns}
data={
prompts.isLoading
? { isLoading: true, isError: false }
@@ -155,7 +155,8 @@ const getObservation = async (
o."calculated_input_cost" as "calculatedInputCost",
o."calculated_output_cost" as "calculatedOutputCost",
o."calculated_total_cost" as "calculatedTotalCost",
o."latency"
o."latency",
o."prompt_id" as "promptId"
FROM observations_view o LEFT JOIN traces ON o."trace_id" = traces."id" AND traces."project_id" = o."project_id"
WHERE o."project_id" = ${authenticatedProjectId}
${nameCondition}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "worker",
"version": "2.18.1",
"version": "2.19.0",
"description": "",
"license": "MIT",
"main": "index.js",
+1 -1
View File
@@ -1 +1 @@
export const VERSION = "v2.18.1";
export const VERSION = "v2.19.0";