From 292c9cec0aca9fab4ca2860efab55da597e9c866 Mon Sep 17 00:00:00 2001 From: Karthik Kalyanaraman <105607645+karthikscale3@users.noreply.github.com> Date: Wed, 22 May 2024 14:55:56 -0700 Subject: [PATCH] Release 1.4.5 (#121) * 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 4551d7eb33a22b4ba94be8eb1e20d620c6e0a567. * 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 * Update prompt registry with instructions to fetch prompts (#91) * Pagination bug * Bug fix * Update prompt registry * Minor bugfix (#94) * Pagination bug * Bug fix * Minor bugfix * chore: update github repo badges * optimizing token count function * Add GPT4-O Pricing and Playground (#98) * Pagination bug * Bug fix * Add GPT4-O support * Add GPT4-O support * Update cost * Dylan/s3en 2234 add perplexity support to playground (#89) * adding perplexity to playground types * adding ui stuff:' * adding perplexity chat api * fixing perplexity model dropdown --------- Co-authored-by: Karthik Kalyanaraman * api changes * add api access to get api and fix all bugs * bug fix * bug fix * updating descriptions to optional * prio python * cleanup and fixes * more bug fixes * more fixes * remove console log * updating trace_service functions * add migration * add format function, updating from day to hour * adding dropwdown menu * updating query key * updating query keys v2 * clean up * fix bug * Minor bugfix (#102) * Pagination bug * Bug fix * Minor bugfix * fixes * Bug fixes to Evaluations (#111) * Pagination bug * Bug fix * Bug fixes to evals v2 * Minor fix * upgrading tiktoken, adding omni to pricing (#110) Co-authored-by: Karthik Kalyanaraman * Update package * Dataset bugfix (#113) * Pagination bug * Bug fix * Dataset bugfix * Minor linking fix (#114) * Pagination bug * Bug fix * Dataset bugfix * Minor fix * api bug fix (#116) * fixing dropdown color (#117) * Support for Image inputs (#119) * Pagination bug * Bug fix * Support image inputs * Bug fix Spans with status_code = "ERROR" (#120) * Pagination bug * Bug fix * Support image inputs * Bug fixes * Dylan/s3en 2265 save prompt and model settings directly from playground (#99) * bug fixes, adding save prompt button in playground * adding save prompt dialog * adding create registry dialog * working registry selection * Adding new prompt to exist registry * storing * button padding fix * refactor, adding combobox * increasing dropdwon width --------- Co-authored-by: Karthik Kalyanaraman --------- Co-authored-by: Darshit Suratwala Co-authored-by: darshit-s3 <119623510+darshit-s3@users.noreply.github.com> Co-authored-by: dylan Co-authored-by: dylanzuber-scale3 <116033320+dylanzuber-scale3@users.noreply.github.com> Co-authored-by: Rohit Kadhe Co-authored-by: Rohit Kadhe <113367036+rohit-kadhe@users.noreply.github.com> Co-authored-by: MayuriS24 <159064413+MayuriS24@users.noreply.github.com> --- .../[project_id]/prompts/[prompt_id]/page.tsx | 8 +- components/evaluate/evaluation-table.tsx | 26 +- components/playground/common.tsx | 93 ++- .../playground/prompt-registry-dialog.tsx | 206 +++++++ components/project/dataset/create.tsx | 5 + components/project/traces/logs-view.tsx | 10 +- components/project/traces/trace-row.tsx | 44 +- components/project/traces/traces.tsx | 4 +- components/shared/create-prompt-dialog.tsx | 543 ++++++++++-------- lib/utils.ts | 20 + package-lock.json | 12 + package.json | 1 + 12 files changed, 683 insertions(+), 289 deletions(-) create mode 100644 components/playground/prompt-registry-dialog.tsx diff --git a/app/(protected)/project/[project_id]/prompts/[prompt_id]/page.tsx b/app/(protected)/project/[project_id]/prompts/[prompt_id]/page.tsx index 99a5cc95..167d8831 100644 --- a/app/(protected)/project/[project_id]/prompts/[prompt_id]/page.tsx +++ b/app/(protected)/project/[project_id]/prompts/[prompt_id]/page.tsx @@ -20,6 +20,7 @@ export default function Page() { const router = useRouter(); const [prompts, setPrompts] = useState([]); const [selectedPrompt, setSelectedPrompt] = useState(); + const [createDialogOpen, setCreateDialogOpen] = useState(false); const [live, setLive] = useState(false); const queryClient = useQueryClient(); @@ -72,6 +73,8 @@ export default function Page() { @@ -93,11 +96,15 @@ export default function Page() { currentPrompt={selectedPrompt} promptsetId={promptsetId} version={prompts.length + 1} + open={createDialogOpen} + setOpen={setCreateDialogOpen} /> ) : ( )} @@ -247,7 +254,6 @@ function PageLoading() { Back -
diff --git a/components/evaluate/evaluation-table.tsx b/components/evaluate/evaluation-table.tsx index 9f86b601..46af7b3f 100644 --- a/components/evaluate/evaluation-table.tsx +++ b/components/evaluate/evaluation-table.tsx @@ -164,17 +164,21 @@ export default function EvaluationTable({ !currentData ? ( ) : ( - currentData.map((span: any, i: number) => ( - - )) + currentData.map((span: any, i: number) => { + if (span.status_code !== "ERROR") { + return ( + + ); + } + }) )} {showLoader && (
diff --git a/components/playground/common.tsx b/components/playground/common.tsx index e68fef71..6d31b5f8 100644 --- a/components/playground/common.tsx +++ b/components/playground/common.tsx @@ -1,3 +1,6 @@ +"use client"; + +import PromptRegistryDialog from "@/components/playground/prompt-registry-dialog"; import LLMPicker from "@/components/shared/llm-picker"; import { Button } from "@/components/ui/button"; import { Separator } from "@/components/ui/separator"; @@ -9,6 +12,8 @@ import { import { cn } from "@/lib/utils"; import { MinusCircleIcon, PlusIcon } from "lucide-react"; import { useEffect, useRef, useState } from "react"; +import { useQuery } from "react-query"; +import { toast } from "sonner"; export function RoleBadge({ role, @@ -34,15 +39,24 @@ export function ExpandingTextArea({ value, onChange, setFocusing, + saveButtonRef, + handleSave, }: { value: string; onChange: any; setFocusing?: any; + saveButtonRef: React.RefObject; + handleSave: (open: boolean) => void; }) { const textAreaRef = useRef(null); const handleClickOutside = (event: any) => { - if (textAreaRef.current && !textAreaRef.current.contains(event.target)) { + if ( + textAreaRef.current && + !textAreaRef.current.contains(event.target) && + saveButtonRef.current && + !saveButtonRef.current.contains(event.target) + ) { setFocusing(false); } }; @@ -63,13 +77,25 @@ export function ExpandingTextArea({ }; return ( -