Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9bb84878e3 | ||
|
|
c7aec93a21 | ||
|
|
b0dbae98e8 | ||
|
|
65e6cc819d | ||
|
|
f307b298c2 | ||
|
|
78c4774b1e |
+2
-1
@@ -1 +1,2 @@
|
||||
* @langfuse/maintainers
|
||||
# Currently inactive
|
||||
# * @langfuse/maintainers
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "langfuse",
|
||||
"version": "2.18.1",
|
||||
"version": "2.19.0",
|
||||
"author": "engineering@langfuse.com",
|
||||
"license": "MIT",
|
||||
"private": true,
|
||||
|
||||
Generated
+4
-4
@@ -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
@@ -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();
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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,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 @@
|
||||
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
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "worker",
|
||||
"version": "2.18.1",
|
||||
"version": "2.19.0",
|
||||
"description": "",
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
|
||||
@@ -1 +1 @@
|
||||
export const VERSION = "v2.18.1";
|
||||
export const VERSION = "v2.19.0";
|
||||
|
||||
Reference in New Issue
Block a user