Skip to content

Commit

Permalink
Release 1.3.2 (#92)
Browse files Browse the repository at this point in the history
* Pagination bug

* Bug fix

* chore: add docker cmd

* Compatibility fixes for SDK version 2.0.0 (#69)

* Pagination bug

* Bug fix

* Fix for schema changes

* Render tool calling

* Support for Langgraph, Qdrant & Groq  (#73)

* Pagination bug

* Bug fix

* Add langgraph support

* QDrant support

* Add Groq support

* update README

* update README

* feat: optimise docker image for self host setup

* adding api access to traces endpoint

* clean up

* refactor

* feat: add clickhouse db create on app start (#79)

* docs: add railway deploy, fix sdk badges (#81)

* untrack .env

* Revert "untrack .env"

This reverts commit 4551d7e.

* Playground and Prompt Management (#83)

* Pagination bug

* Bug fix

* Playground - basic implementation

* Playground - streaming and nonstreaming

* Move playground inside project

* API key flow

* Api key

* Playground refactor

* Add chat hookup

* anthropic streaming support

* Bug fixes to openai playground

* Anthropic bugfixes

* Anthropic bugfix

* Cohere first iteration

* Cohere role fixes

* Cohere api fix

* Parallel running

* Playground cost calculation non streaming

* playground - streaming token calculation

* latency and cost

* Support for Groq

* Add model name

* Prompt management views

* Remove current promptset flow

* Prompt management API hooks

* Prompt registry final

* Playground bugfixes

* Bug fix playground

* Rearrange project nav

* Fix playground

* Fix prompts

* Bugfixes

* Minor fix

* Prompt versioning bugfix

* Bugfix

* fix: clickhouse table find queries (#82)

* Fix to surface multiple LLM requests inside LLM View (#84)

* Pagination bug

* Bug fix

* Fix for surfacing multiple LLM requests in LLMView

* Minor bugfixes (#86)

* Pagination bug

* Bug fix

* Bugfixes

* api to fetch promptset with prompt filters

* bug fixes

* fix invalid redirect

* fix invalid status code

* Project Switcher (#90)

* Pagination bug

* Bug fix

* Project switcher

* Feat: dataset download (#60)

* API: download dataset

* API: Download dataset

* updated download-dataset api

* Updated: download_dataset api

* Updated download dataset API

* Updated Download API: changed Response to Next Response, add a condition to ensure max page size is 500

* updated the download-dataset API: fixed the format and removed redundant lines of code

* Updated download_daatset API: file name and removed 'id' param

* Added the Download dataset button.

* Merged developemnt into my branch

* Updated button size

* Fixes

---------

Co-authored-by: Karthik Kalyanaraman <karthik@scale3labs.com>

* Update prompt registry with instructions to fetch prompts (#91)

* Pagination bug

* Bug fix

* Update prompt registry

---------

Co-authored-by: Darshit Suratwala <darshit@scale3labs.com>
Co-authored-by: darshit-s3 <119623510+darshit-s3@users.noreply.github.com>
Co-authored-by: dylan <dylan@scale3labs.com>
Co-authored-by: dylanzuber-scale3 <116033320+dylanzuber-scale3@users.noreply.github.com>
Co-authored-by: Rohit Kadhe <rohit@scale3labs.com>
Co-authored-by: Rohit Kadhe <113367036+rohit-kadhe@users.noreply.github.com>
Co-authored-by: MayuriS24 <159064413+MayuriS24@users.noreply.github.com>
  • Loading branch information
8 people committed May 9, 2024
1 parent 506d0b3 commit 13181f0
Show file tree
Hide file tree
Showing 11 changed files with 559 additions and 14,004 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import { CreateData } from "@/components/project/dataset/create-data";
import DatasetRowSkeleton from "@/components/project/dataset/dataset-row-skeleton";
import { EditData } from "@/components/project/dataset/edit-data";
import { DownloadDataset } from "@/components/shared/download-dataset";
import { Spinner } from "@/components/shared/spinner";
import { Button } from "@/components/ui/button";
import { Separator } from "@/components/ui/separator";
Expand Down Expand Up @@ -91,6 +92,7 @@ export default function Dataset() {
Back
</Button>
<CreateData datasetId={dataset_id} />
<DownloadDataset datasetId={dataset_id} disabled={fetchDataset.isLoading || currentData?.length === 0} />
</div>
<div className="flex flex-col gap-3 rounded-md border border-muted max-h-screen overflow-y-scroll">
<div className="grid grid-cols-5 items-center justify-stretch gap-3 py-3 px-4 bg-muted">
Expand All @@ -99,7 +101,7 @@ export default function Dataset() {
<p className="text-xs font-medium">Output</p>
<p className="text-xs font-medium text-end">Note</p>
</div>
{fetchDataset.isLoading && currentData.length === 0 && (
{fetchDataset.isLoading && currentData?.length === 0 && (
<div className="flex items-center justify-center">
<p className="text-muted-foreground">
No data found in this dataset
Expand Down
11 changes: 11 additions & 0 deletions app/(protected)/project/[project_id]/prompts/[prompt_id]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"use client";
import CreatePromptDialog from "@/components/shared/create-prompt-dialog";
import { PromptInstructions } from "@/components/shared/setup-instructions";
import { Button } from "@/components/ui/button";
import { Checkbox } from "@/components/ui/checkbox";
import { Label } from "@/components/ui/label";
Expand Down Expand Up @@ -141,6 +142,12 @@ export default function Page() {
))}
</div>
<div className="flex flex-col gap-8 w-full">
<div className="flex flex-col gap-2">
<Label>Prompt Registry ID</Label>
<p className="p-2 rounded-md border-2 border-muted font-semibold text-md">
{promptsetId}
</p>
</div>
<div className="flex flex-col gap-2">
<Label>Prompt</Label>
<p className="p-2 rounded-md border-2 border-muted">
Expand Down Expand Up @@ -222,6 +229,10 @@ export default function Page() {
</p>
</div>
</div>
<div className="flex flex-col gap-2">
<Label>Use the Live prompt directly in your code</Label>
<PromptInstructions id={promptsetId} />
</div>
</div>
</div>
</div>
Expand Down
79 changes: 79 additions & 0 deletions app/api/dataset/download/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
import { authOptions } from "@/lib/auth/options";
import prisma from "@/lib/prisma";
import json2csv from 'json2csv';
import { getServerSession } from "next-auth";
import { redirect } from "next/navigation";
import { NextRequest, NextResponse } from "next/server";

export async function GET(req: NextRequest) {
try {
const session = await getServerSession(authOptions);
if (!session || !session.user) {
redirect("/login");
}
const datasetId = req.nextUrl.searchParams.get("id") as string;
const pageParam = req.nextUrl.searchParams.get("page");
let page = pageParam ? parseInt(pageParam, 10) : 1;
const pageSize = 500;
let dataset;
if (!datasetId) {
return NextResponse.json(
{
message: "No dataset id provided",
},
{ status: 404 }
);
}
else {
dataset = await prisma.dataset.findFirst({
where: {
id: datasetId,
},
include: {
Data: true,
},
});

}
if (!dataset) {
return NextResponse.json(
{
message: "No datasets found",
},
{ status: 404 }
);
}

const data = await prisma.data.findMany({
where: {
datasetId: dataset.id,
},
orderBy: {
createdAt: "desc",
},
take: pageSize,
skip: (page - 1) * pageSize,
});

const csv = json2csv.parse(data);
const datasetName = dataset.name.toLowerCase().replace(/\s+/g, '_');
const timestamp = new Date().toISOString().slice(0, 19).replace(/[-:]/g, '');
const filename = `${datasetName}_${timestamp}.csv`;

console.log(`CSV file '${filename}' `);

return new NextResponse(csv, {
headers: {
'Content-Type': 'text/csv',
'Content-Disposition': `filename:${filename}`,
},
});
} catch (error) {
return NextResponse.json(
{
message: "Error downloading dataset",
},
{ status: 500 }
);
}
}
Loading

0 comments on commit 13181f0

Please sign in to comment.