Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance LLM API Pricing Calculator with new features #3197

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

shouryamaanjain
Copy link

Delete bifrost/app/providers.tsx and bifrost/app/PostHogPageView.tsx.

Add tooltips, help icons, and dark mode to bifrost/app/llm-cost/CalculatorInfo.tsx and bifrost/app/llm-cost/ModelPriceCalculator.tsx.

  • Tooltips and Help Icons

    • Add tooltips and help icons to explain input fields and options in CalculatorInfo.tsx and ModelPriceCalculator.tsx.
  • Dark Mode

    • Implement dark mode for better accessibility and user preference in CalculatorInfo.tsx and ModelPriceCalculator.tsx.

Delete `bifrost/app/providers.tsx` and `bifrost/app/PostHogPageView.tsx`.

Add tooltips, help icons, and dark mode to `bifrost/app/llm-cost/CalculatorInfo.tsx` and `bifrost/app/llm-cost/ModelPriceCalculator.tsx`.

* **Tooltips and Help Icons**
  - Add tooltips and help icons to explain input fields and options in `CalculatorInfo.tsx` and `ModelPriceCalculator.tsx`.

* **Dark Mode**
  - Implement dark mode for better accessibility and user preference in `CalculatorInfo.tsx` and `ModelPriceCalculator.tsx`.
Copy link

vercel bot commented Feb 2, 2025

@shouryamaanjain is attempting to deploy a commit to the Helicone Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

fumedev bot commented Feb 2, 2025

Summary

  • Removed PostHog analytics tracking files (providers.tsx and PostHogPageView.tsx)
  • Added tooltips with help icons for input and output token fields in the LLM cost calculator
  • Implemented dark mode support in CalculatorInfo.tsx based on user system preferences
  • Enhanced user experience with explanatory tooltips for better understanding of calculator fields
  • Updated UI components to support both light and dark themes consistently

🔍 Fume is reviewing this PR!

🔗 Track the review progress here:
https://app.fumedev.com/chat/df169e4a-30bc-4aac-8142-4f6fcd5e5d72

Copy link

fumedev bot commented Feb 2, 2025

bifrost/app/layout.tsx line 14

import { PHProvider } from "./providers";
import dynamic from "next/dynamic";
import Script from "next/script";
import Head from "next/head";
import { Layout } from "./components/Layout";
const PostHogPageView = dynamic(() => import("./PostHogPageView"), {
  ssr: false,
});

const inter = Inter({ subsets: ["latin"] });

export const metadata: Metadata = {

The PR suggests deleting PostHogPageView.tsx but it is still being used here. Please provide an alternative implementation for PostHog tracking before deletion.

@@ -433,6 +435,16 @@ Optimize your AI API costs:`;
>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tooltip implementation needs to be completed for provider selection, model selection, cost breakdown sections, and share/contribution buttons. Additionally, ARIA labels for help icons and keyboard navigation for tooltips should be implemented for better accessibility.

Copy link

fumedev bot commented Feb 2, 2025

bifrost/app/llm-cost/ModelPriceCalculator.tsx line 758

      </div>

      <CalculatorInfo model={model} provider={provider} />
    </div>
  );
}

Add tooltips for: 1. Provider/Model filters 2. Sort buttons 3. Share button 4. Cost breakdown sections

Copy link

fumedev bot commented Feb 2, 2025

bifrost/app/llm-cost/CalculatorInfo.tsx line 756

                </p>
              </div>
            </div>
          </section>

          <section className="bg-white p-6 rounded-lg shadow-sm border border-slate-200 mt-8">
            <h3 className="text-2xl font-semibold mb-6 text-slate-700">
              Tips on using the LLM API Pricing Calculator
            </h3>
            <ul className="space-y-4">
              <li className="flex items-start">
                <svg

Dark mode implementation is incomplete. Need to add dark: variants for text, background, border colors, and components like buttons and cards.

Copy link

fumedev bot commented Feb 2, 2025

bifrost/app/layout.tsx line 9

import NavBar from "@/components/layout/navbar";
import Footer from "@/components/layout/footer";
import "@mintlify/mdx/dist/styles.css";
import { Analytics } from "@vercel/analytics/react";
import { SpeedInsights } from "@vercel/speed-insights/next";
import { PHProvider } from "./providers";
import dynamic from "next/dynamic";
import Script from "next/script";
import Head from "next/head";
import { Layout } from "./components/Layout";
const PostHogPageView = dynamic(() => import("./PostHogPageView"), {
  ssr: false,

To remove providers.tsx and PostHogPageView.tsx, update this file by: 1) Remove PHProvider import and wrap, 2) Remove PostHogPageView dynamic import and component, 3) Update body element to not use PHProvider

Copy link

fumedev bot commented Feb 2, 2025

bifrost/app/layout.tsx line 9

import NavBar from "@/components/layout/navbar";
import Footer from "@/components/layout/footer";
import "@mintlify/mdx/dist/styles.css";
import { Analytics } from "@vercel/analytics/react";
import { SpeedInsights } from "@vercel/speed-insights/next";
import { PHProvider } from "./providers";
import dynamic from "next/dynamic";
import Script from "next/script";
import Head from "next/head";
import { Layout } from "./components/Layout";
const PostHogPageView = dynamic(() => import("./PostHogPageView"), {
  ssr: false,

BLOCKING: This PR deletes providers.tsx but PHProvider is still used here and in the JSX. Need to: 1. Remove PHProvider import 2. Remove PHProvider wrapper in JSX 3. Remove PostHogPageView import and usage before the app can build and UI changes can be tested.

Copy link

fumedev bot commented Feb 2, 2025

bifrost/app/layout.tsx line 9

import NavBar from "@/components/layout/navbar";
import Footer from "@/components/layout/footer";
import "@mintlify/mdx/dist/styles.css";
import { Analytics } from "@vercel/analytics/react";
import { SpeedInsights } from "@vercel/speed-insights/next";
import { PHProvider } from "./providers";
import dynamic from "next/dynamic";
import Script from "next/script";
import Head from "next/head";
import { Layout } from "./components/Layout";
const PostHogPageView = dynamic(() => import("./PostHogPageView"), {
  ssr: false,

BLOCKING: Cannot delete providers.tsx and PostHogPageView.tsx until their usages are removed: 1. Remove PHProvider import here 2. Remove PostHogPageView dynamic import on line 15 3. Remove PHProvider wrapper around body (line 75) 4. Remove PostHogPageView component (line 79)

Copy link

fumedev bot commented Feb 2, 2025

Testing

Watch Here

  • Build Test: Failed

    • Error: "Module not found: Can't resolve './providers'"
    • Cause: PR deletes providers.tsx but it's still imported in layout.tsx
  • Attempted UI Testing: Blocked

    • Could not test tooltips or dark mode due to build failure
    • App fails to start due to missing PostHog provider
  • Not Tested (Blocked):

    • Dark mode system preference detection
    • Tooltip positioning and visibility
    • Color contrast in dark mode
    • Accessibility of tooltips
  • Critical Finding: PR needs to remove PostHog dependencies from layout.tsx before UI changes can be tested

Copy link

vercel bot commented Feb 9, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
helicone-bifrost ❌ Failed (Inspect) Feb 9, 2025 0:41am

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant