From 2ddf8da04dd45a93b0bfb9fc2219f37502873aa1 Mon Sep 17 00:00:00 2001 From: Karthik Kalyanaraman <105607645+karthikscale3@users.noreply.github.com> Date: Mon, 21 Oct 2024 20:33:18 -0700 Subject: [PATCH] Release 3.0.14 (#307) * Pagination bug * Bug fix * Update package * Bugfixes * Add migration file * adding ability to add to dataset from traces tab * fixing z-index bug * fixing llm parsing, disable button for non llm traces * cleaning up api providers page * more bug fixes, auditing models * adding api key auth to create project api key (#270) * Improvements to prompt playground (#272) * fixing static text area, fixing overlap * creating custo ui for playground taces * fetching traces on dialog open * fixes * fixes * fixes --------- Co-authored-by: Karthik Kalyanaraman * fix * fix * support for o1-preview and o1-mini (#275) * fixing live prompt bug (#277) * DSPy enhancements (#280) * DSPy experiments * LiteLLM support * eval charts * experiment metrics * empty state * minor fix * fix * clearing invite form fields on send (#279) * Track project creation count metrics (#271) * adding posthog * bug fixes, adding new env vars * adding posthog api key to dockerfile * updating read me * removing sensitive data * removing more data * adding sign up count by team * minor * update * fixes --------- Co-authored-by: Karthik Kalyanaraman * minor * minor (#282) * add vercel ai pricing (#283) * fix (#284) * Fixes (#289) * Add `Gemini` Cost table (#291) * add gemini cost tables * remove protobuf helper * Fixing token counts if `output_tokens` is `0` + adding embedding cost tables (#292) * make tracing endpoint `route.ts` oTel compatible backend. (#298) * make tracing endpoint `route.ts` oTel compatible backend. * handle null events * fallback for status code * remove console statement * Upload csv feature (#265) * all changes for upload csv feature * upddated package.json.lock * updated package.lock.json * update package lock * fixes * validation --------- Co-authored-by: Oluwadabira Akinwumi Co-authored-by: Karthik Kalyanaraman * Update package lock (#299) * all changes for upload csv feature * upddated package.json.lock * updated package.lock.json * update package lock * fixes * validation * validation --------- Co-authored-by: Oluwadabira Akinwumi * add proto files inside `next.config.mjs` and migrate protofiles to root level (#302) * Support xAI (#306) * support xai * support xai --------- Co-authored-by: dylan Co-authored-by: dylanzuber-scale3 <116033320+dylanzuber-scale3@users.noreply.github.com> Co-authored-by: Ali Waleed Co-authored-by: dabiras3 Co-authored-by: Oluwadabira Akinwumi --- components/shared/vendor-metadata.tsx | 16 +++ lib/constants.ts | 7 ++ lib/utils.ts | 10 ++ package-lock.json | 155 ++++++++++++++++++++++++++ public/xai.png | Bin 0 -> 4795 bytes 5 files changed, 188 insertions(+) create mode 100644 public/xai.png diff --git a/components/shared/vendor-metadata.tsx b/components/shared/vendor-metadata.tsx index 769ba083..98c23fca 100644 --- a/components/shared/vendor-metadata.tsx +++ b/components/shared/vendor-metadata.tsx @@ -343,6 +343,22 @@ export function VendorLogo({ ); } + if (vendor.includes("xai")) { + const color = vendorColor("vercel"); + return ( + XAI Logo + ); + } + if (vendor.includes("embedchain")) { const color = vendorColor("embedchain"); return ( diff --git a/lib/constants.ts b/lib/constants.ts index 86a3e545..252d4f6e 100644 --- a/lib/constants.ts +++ b/lib/constants.ts @@ -146,6 +146,13 @@ export const OPENAI_PRICING: Record = { }; +export const XAI_PRICING: Record = { + "grok-beta": { + input: 0.005, + output: 0.015, + }, +}; + export const ANTHROPIC_PRICING: Record = { "claude-3-haiku": { input: 0.00025, diff --git a/lib/utils.ts b/lib/utils.ts index 682eb209..57f2b328 100644 --- a/lib/utils.ts +++ b/lib/utils.ts @@ -19,6 +19,7 @@ import { OPENAI_PRICING, PERPLEXITY_PRICING, SpanStatusCode, + XAI_PRICING, } from "./constants"; export function cn(...inputs: ClassValue[]) { @@ -527,6 +528,8 @@ export function calculatePriceFromUsage( vendor = "anthropic"; } else if (model.includes("mistral")) { vendor = "mistral"; // Assuming there is a MISTRAL_PRICING object + } else if (model.includes("grok")) { + vendor = "xai"; } else if (model.includes("gemini")) { vendor = model.includes("flash") || model.includes("pro") @@ -635,6 +638,8 @@ export function calculatePriceFromUsage( costTable = AZURE_PRICING[correctModel]; } else if (vendor === "gemini") { costTable = GEMINI_PRICING[model]; + } else if (vendor === "xai") { + costTable = XAI_PRICING[model]; } if (costTable) { const total = @@ -756,6 +761,11 @@ export function getVendorFromSpan(span: Span): string { serviceName.includes("perplexity") ) { vendor = "perplexity"; + } else if ( + span.name.includes("xai") || + serviceName.includes("xai") + ) { + vendor = "xai"; } else if (span.name.includes("openai") || serviceName.includes("openai")) { vendor = "openai"; } else if ( diff --git a/package-lock.json b/package-lock.json index 570ecd5a..f743af41 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3117,6 +3117,33 @@ } } }, + "node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-dismissable-layer": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@radix-ui/react-dismissable-layer/-/react-dismissable-layer-1.1.0.tgz", + "integrity": "sha512-/UovfmmXGptwGcBQawLzvn2jOfM0t4z3/uKffoBlj724+n3FvBbZ7M0aaBOmkp6pqFYpO4yx8tSVJjx3Fl2jig==", + "license": "MIT", + "dependencies": { + "@radix-ui/primitive": "1.1.0", + "@radix-ui/react-compose-refs": "1.1.0", + "@radix-ui/react-primitive": "2.0.0", + "@radix-ui/react-use-callback-ref": "1.1.0", + "@radix-ui/react-use-escape-keydown": "1.1.0" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, "node_modules/@radix-ui/react-direction": { "version": "1.1.0", "license": "MIT", @@ -3248,6 +3275,33 @@ } } }, + "node_modules/@radix-ui/react-hover-card/node_modules/@radix-ui/react-dismissable-layer": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@radix-ui/react-dismissable-layer/-/react-dismissable-layer-1.1.0.tgz", + "integrity": "sha512-/UovfmmXGptwGcBQawLzvn2jOfM0t4z3/uKffoBlj724+n3FvBbZ7M0aaBOmkp6pqFYpO4yx8tSVJjx3Fl2jig==", + "license": "MIT", + "dependencies": { + "@radix-ui/primitive": "1.1.0", + "@radix-ui/react-compose-refs": "1.1.0", + "@radix-ui/react-primitive": "2.0.0", + "@radix-ui/react-use-callback-ref": "1.1.0", + "@radix-ui/react-use-escape-keydown": "1.1.0" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, "node_modules/@radix-ui/react-icons": { "version": "1.3.0", "license": "MIT", @@ -3330,6 +3384,33 @@ } } }, + "node_modules/@radix-ui/react-menu/node_modules/@radix-ui/react-dismissable-layer": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@radix-ui/react-dismissable-layer/-/react-dismissable-layer-1.1.0.tgz", + "integrity": "sha512-/UovfmmXGptwGcBQawLzvn2jOfM0t4z3/uKffoBlj724+n3FvBbZ7M0aaBOmkp6pqFYpO4yx8tSVJjx3Fl2jig==", + "license": "MIT", + "dependencies": { + "@radix-ui/primitive": "1.1.0", + "@radix-ui/react-compose-refs": "1.1.0", + "@radix-ui/react-primitive": "2.0.0", + "@radix-ui/react-use-callback-ref": "1.1.0", + "@radix-ui/react-use-escape-keydown": "1.1.0" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, "node_modules/@radix-ui/react-menubar": { "version": "1.1.1", "license": "MIT", @@ -3395,6 +3476,33 @@ } } }, + "node_modules/@radix-ui/react-popover/node_modules/@radix-ui/react-dismissable-layer": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@radix-ui/react-dismissable-layer/-/react-dismissable-layer-1.1.0.tgz", + "integrity": "sha512-/UovfmmXGptwGcBQawLzvn2jOfM0t4z3/uKffoBlj724+n3FvBbZ7M0aaBOmkp6pqFYpO4yx8tSVJjx3Fl2jig==", + "license": "MIT", + "dependencies": { + "@radix-ui/primitive": "1.1.0", + "@radix-ui/react-compose-refs": "1.1.0", + "@radix-ui/react-primitive": "2.0.0", + "@radix-ui/react-use-callback-ref": "1.1.0", + "@radix-ui/react-use-escape-keydown": "1.1.0" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, "node_modules/@radix-ui/react-popper": { "version": "1.2.0", "license": "MIT", @@ -6674,6 +6782,24 @@ "react-dom": "^16.8 || ^17.0 || ^18.0" } }, + "node_modules/cmdk/node_modules/@radix-ui/react-dismissable-layer": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@radix-ui/react-dismissable-layer/-/react-dismissable-layer-1.0.0.tgz", + "integrity": "sha512-n7kDRfx+LB1zLueRDvZ1Pd0bxdJWDUZNQ/GWoxDn2prnuJKRdxsjulejX/ePkOsLi2tTm6P24mDqlMSgQpsT6g==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.13.10", + "@radix-ui/primitive": "1.0.0", + "@radix-ui/react-compose-refs": "1.0.0", + "@radix-ui/react-primitive": "1.0.0", + "@radix-ui/react-use-callback-ref": "1.0.0", + "@radix-ui/react-use-escape-keydown": "1.0.0" + }, + "peerDependencies": { + "react": "^16.8 || ^17.0 || ^18.0", + "react-dom": "^16.8 || ^17.0 || ^18.0" + } + }, "node_modules/cmdk/node_modules/@radix-ui/react-focus-guards": { "version": "1.0.0", "license": "MIT", @@ -6684,6 +6810,22 @@ "react": "^16.8 || ^17.0 || ^18.0" } }, + "node_modules/cmdk/node_modules/@radix-ui/react-focus-scope": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@radix-ui/react-focus-scope/-/react-focus-scope-1.0.0.tgz", + "integrity": "sha512-C4SWtsULLGf/2L4oGeIHlvWQx7Rf+7cX/vKOAD2dXW0A1b5QXwi3wWeaEgW+wn+SEVrraMUk05vLU9fZZz5HbQ==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.13.10", + "@radix-ui/react-compose-refs": "1.0.0", + "@radix-ui/react-primitive": "1.0.0", + "@radix-ui/react-use-callback-ref": "1.0.0" + }, + "peerDependencies": { + "react": "^16.8 || ^17.0 || ^18.0", + "react-dom": "^16.8 || ^17.0 || ^18.0" + } + }, "node_modules/cmdk/node_modules/@radix-ui/react-id": { "version": "1.0.0", "license": "MIT", @@ -6764,6 +6906,19 @@ "react": "^16.8 || ^17.0 || ^18.0" } }, + "node_modules/cmdk/node_modules/@radix-ui/react-use-escape-keydown": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@radix-ui/react-use-escape-keydown/-/react-use-escape-keydown-1.0.0.tgz", + "integrity": "sha512-JwfBCUIfhXRxKExgIqGa4CQsiMemo1Xt0W/B4ei3fpzpvPENKpMKQ8mZSB6Acj3ebrAEgi2xiQvcI1PAAodvyg==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.13.10", + "@radix-ui/react-use-callback-ref": "1.0.0" + }, + "peerDependencies": { + "react": "^16.8 || ^17.0 || ^18.0" + } + }, "node_modules/cmdk/node_modules/@radix-ui/react-use-layout-effect": { "version": "1.0.0", "license": "MIT", diff --git a/public/xai.png b/public/xai.png new file mode 100644 index 0000000000000000000000000000000000000000..c95972771a05a7ea8922e5b0847847289fbb809c GIT binary patch literal 4795 zcmZu!cUY54vrj0}1S2JYw9q@DHz7a(Nr-f$7(iOU2uUcRDFPw_B2@$t2<1=|q#l~6 z^o|l#q$nUwx=1^KH2H$Zd%pABd-r+fo!Ob+Z|2>d-9Prexv3E|;{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