Skip to content

Commit

Permalink
Release 1.0.2 (#53)
Browse files Browse the repository at this point in the history
* Bug fix

* signup bug fix

* user invite

* docs: add local setup instructions, cleanup files (#10)

* Update README.md (#11)

* Update README.md

* Update README.md

* Update README.md

* Bugfix auth (#12)

* Update README.md

* Update favicon (#17)

* Release 1.0.3 (#8)

* Bug fix

* signup bug fix

* user invite

* favicon

* Adding pagination to traces (#16)

* Adding pagination to traces

* installing scroller

* query function bug

* fix

* Bug fix pagination

---------

Co-authored-by: Karthik Kalyanaraman <[email protected]>

* Dylan/s3en 2060 adding more frontend pagination (#18)

* Adding pagination to traces

* installing scroller

* bug fixes for trace pagination

* adding delete prompt api

* adding pagination to evaluate

* adding pagination to evals

* adding pagination to prompset, bug fixes

* adding .env

* fix

---------

Co-authored-by: Karthik Kalyanaraman <[email protected]>

* updating prompt dialog (#19)

* Show API key warning message (#20)

* Show API key warning message

* Update instructions

* Fix null dereference checks (#21)

* adding check for missing table (#22)

* adding check for missing table

* adding docs button

* Check empty table

---------

Co-authored-by: Karthik Kalyanaraman <[email protected]>

* Check length of data (#24)

* flicker issue (#26)

* Flicker issue (#27)

* flicker issue

* Fixes

* Fix (#30)

* Fix header (#32)

* updating gitignore

* Rohit/s3 en 2064 fix api key not showing (#29)

* fix api key bug

* final fixes

* fix scroll bar issue

* adjust readme

* Pagination bug

* Pagination bug (#37)

* removing form reset on edit (#39)

* removing form reset on edit

* bug fixes:

* fix

* fix page number bug

---------

Co-authored-by: Karthik Kalyanaraman <[email protected]>

* Dylan/s3en 2079 thumbs up duplication bug (#40)

* refetch/duplicate bug fix

* Prevent stale data in forms

* fix

* linting

* fixing duplication bug

* removing console

* Fix eval

* Fix pagination for promp eval

* Fix promptsets pagination

---------

Co-authored-by: Karthik Kalyanaraman <[email protected]>

* Bug fixes for Traces Pagination (#42)

* Pagination bug

* Fix pagination for traces

* Bug fix

* Fix invalid model (#43)

* Pagination bug

* Bug fix

* Bug fixes (#45)

* Pagination bug

* Bug fix

* fix pricing

* fix the pii function

* Bugfixes

* adding pagination to dataset

* Trace page improvements (#49)

* Pagination bug

* Bug fix

* Fix scrolling pagination

* Filters

* Add model

* utc - local time switch

* Bugfixes and Evaluation Dashboard (#50)

* Pagination bug

* Bug fix

* minor fix

* Evaluations dashboard refresh

* Move prompts as a tab

* UI improvements

* round values

* Add migration script

* Minor bug fixes (#51)

* Pagination bug

* Bug fix

* Bug fix

* Disable LLM view for framework and vector db requests

* Minor bug fixes (#52)

* Pagination bug

* Bug fix

* Bug fix

* Disable LLM view for framework and vector db requests

---------

Co-authored-by: darshit-s3 <[email protected]>
Co-authored-by: Rohit Kadhe <[email protected]>
Co-authored-by: dylanzuber-scale3 <[email protected]>
Co-authored-by: dylan <[email protected]>
Co-authored-by: Ali Waleed <[email protected]>
  • Loading branch information
6 people authored Apr 9, 2024
1 parent 549a9c1 commit ff72079
Show file tree
Hide file tree
Showing 37 changed files with 2,269 additions and 792 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,73 @@

import { CreateData } from "@/components/project/dataset/create-data";
import { EditData } from "@/components/project/dataset/edit-data";
import { Spinner } from "@/components/shared/spinner";
import { Button } from "@/components/ui/button";
import { Separator } from "@/components/ui/separator";
import { PAGE_SIZE } from "@/lib/constants";
import { Data } from "@prisma/client";
import { ChevronLeft } from "lucide-react";
import { useParams } from "next/navigation";
import { useState } from "react";
import { useBottomScrollListener } from "react-bottom-scroll-listener";
import { useQuery } from "react-query";

export default function Dataset() {
const dataset_id = useParams()?.dataset_id as string;
const [page, setPage] = useState<number>(1);
const [totalPages, setTotalPages] = useState<number>(1);
const [showLoader, setShowLoader] = useState(false);
const [currentData, setCurrentData] = useState<Data[]>([]);

useBottomScrollListener(() => {
if (fetchDataset.isRefetching) {
return;
}
if (page <= totalPages) {
setShowLoader(true);
fetchDataset.refetch();
}
});

const fetchDataset = useQuery({
queryKey: [dataset_id],
queryFn: async () => {
const response = await fetch(`/api/dataset?dataset_id=${dataset_id}`);
const response = await fetch(
`/api/dataset?dataset_id=${dataset_id}&page=${page}&pageSize=${PAGE_SIZE}`
);
const result = await response.json();
return result;
},
onSuccess: (data) => {
// Get the newly fetched data and metadata
const newData: Data[] = data?.datasets?.Data || [];
const metadata = data?.metadata || {};

// Update the total pages and current page number
setTotalPages(parseInt(metadata?.total_pages) || 1);
if (parseInt(metadata?.page) <= parseInt(metadata?.total_pages)) {
setPage(parseInt(metadata?.page) + 1);
}

// Merge the new data with the existing data
if (currentData.length > 0) {
const updatedData = [...currentData, ...newData];

// Remove duplicates
const uniqueData = updatedData.filter(
(v: any, i: number, a: any) =>
a.findIndex((t: any) => t.id === v.id) === i
);

setCurrentData(uniqueData);
} else {
setCurrentData(newData);
}
setShowLoader(false);
},
});

if (fetchDataset.isLoading || !fetchDataset.data) {
if (fetchDataset.isLoading || !fetchDataset.data || !currentData) {
return <div>Loading...</div>;
} else {
return (
Expand All @@ -39,16 +87,16 @@ export default function Dataset() {
<p className="text-xs font-medium">Output</p>
<p className="text-xs font-medium text-end">Note</p>
</div>
{fetchDataset.data?.datasets &&
fetchDataset.data?.datasets?.Data?.length === 0 && (
<div className="flex items-center justify-center">
<p className="text-muted-foreground">
No data found in this dataset
</p>
</div>
)}
{fetchDataset.data?.datasets &&
fetchDataset.data?.datasets?.Data?.map((data: any, i: number) => {
{fetchDataset.isLoading && currentData.length === 0 && (
<div className="flex items-center justify-center">
<p className="text-muted-foreground">
No data found in this dataset
</p>
</div>
)}
{!fetchDataset.isLoading &&
currentData.length > 0 &&
currentData.map((data: any, i: number) => {
return (
<div className="flex flex-col" key={i}>
<div className="grid grid-cols-5 items-start justify-stretch gap-3 py-3 px-4">
Expand All @@ -61,13 +109,22 @@ export default function Dataset() {
</p>
<p className="text-xs text-end">{data.note}</p>
<div className="text-end">
<EditData key={data.id} idata={data} datasetId={dataset_id} />
<EditData
key={data.id}
idata={data}
datasetId={dataset_id}
/>
</div>
</div>
<Separator orientation="horizontal" />
</div>
);
})}
{showLoader && (
<div className="flex justify-center py-8">
<Spinner className="h-8 w-8 text-center" />
</div>
)}
</div>
</div>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ export default function Promptset() {
} else {
setCurrentData(newData);
}

setShowLoader(false);
},
});
Expand Down
Loading

0 comments on commit ff72079

Please sign in to comment.