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

chore: deprecate llm cache #2515

Merged
merged 2 commits into from
Oct 29, 2024
Merged

chore: deprecate llm cache #2515

merged 2 commits into from
Oct 29, 2024

Conversation

chronark
Copy link
Collaborator

@chronark chronark commented Oct 20, 2024

Summary by CodeRabbit

Release Notes

  • New Features

    • Enhanced DesktopSidebar and MobileSideBar components with support for LLM gateway information.
    • Updated navigation logic to conditionally display the "Semantic Cache" item based on LLM gateways.
  • Bug Fixes

    • Improved redirect behavior after deleting a gateway, now directing users to the root path.
  • Documentation

    • Removed references to semantic caching from the documentation, including related guides and settings.
  • Chores

    • Streamlined the user interface by removing the semantic cache creation options from the dashboard.

Copy link

vercel bot commented Oct 20, 2024

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

Name Status Preview Comments Updated (UTC)
dashboard ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 28, 2024 1:37pm
engineering ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 28, 2024 1:37pm
play ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 28, 2024 1:37pm
workflows ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 28, 2024 1:37pm
www ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 28, 2024 1:37pm

Copy link

changeset-bot bot commented Oct 20, 2024

⚠️ No Changeset found

Latest commit: 5f23856

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

coderabbitai bot commented Oct 20, 2024

📝 Walkthrough

Walkthrough

This pull request introduces modifications across several components in the dashboard application, primarily adding a new property llmGateways to various Props types, which allows the components to handle LLM gateway information. Changes also include updates to the routing logic in the DeleteGateway component and the removal of several components and files related to semantic caching. The overall structure and logic of existing components remain intact, with the primary focus on enhancing data handling and modifying redirection behaviors.

Changes

File Path Change Summary
apps/dashboard/app/(app)/desktop-sidebar.tsx Added llmGateways property to Props type, modifying the workspace object structure.
apps/dashboard/app/(app)/layout.tsx Updated db.query.workspaces.findFirst to include llmGateways, retrieving only the id column.
apps/dashboard/app/(app)/mobile-sidebar.tsx Added llmGateways property to Props type, modifying the workspace object structure.
apps/dashboard/app/(app)/semantic-cache/[gatewayId]/settings/delete-gateway.tsx Changed redirection after gateway deletion from /semantic-cache to /.
apps/dashboard/app/(app)/semantic-cache/form.tsx Removed CreateLLMGatewayForm component.
apps/dashboard/app/(app)/semantic-cache/new/page.tsx Removed NewSemanticCachePage component.
apps/dashboard/app/(app)/semantic-cache/new/util/generate-semantic-cache-default-name.ts Removed generateSemanticCacheDefaultName function.
apps/dashboard/app/(app)/semantic-cache/page.tsx Changed redirect logic to root path / if llmGateways is empty.
apps/dashboard/app/(app)/workspace-navigations.tsx Updated createWorkspaceNavigation function to include llmGateways in the workspace parameter and modified navigation item visibility based on this property.
apps/dashboard/app/new/create-semantic-cache.tsx Removed CreateSemanticCacheButton component.
apps/dashboard/app/new/page.tsx Removed import of CreateSemanticCacheButton and simplified UI layout by removing semantic cache options.
apps/dashboard/lib/trpc/routers/index.ts Removed createLlmGateway route definition from llmGateway router.
apps/docs/mint.json Removed "Semantic cache" section and associated pages from navigation.
apps/docs/semantic-cache/introduction.mdx Removed documentation for semantic caching overview.
apps/docs/semantic-cache/settings.mdx Removed documentation for configuring semantic cache behavior.
apps/docs/semantic-cache/why-semantic-caching.mdx Removed explanation of semantic caching in application development.

Possibly related PRs

Suggested labels

🕹️ oss.gg, :joystick: 150 points, hacktoberfest

Suggested reviewers

  • mcstepp
  • perkinsjr

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between fed8d2a and 5f23856.

📒 Files selected for processing (2)
  • apps/dashboard/app/(app)/semantic-cache/[gatewayId]/settings/delete-gateway.tsx (1 hunks)
  • apps/docs/mint.json (0 hunks)
💤 Files with no reviewable changes (1)
  • apps/docs/mint.json
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/dashboard/app/(app)/semantic-cache/[gatewayId]/settings/delete-gateway.tsx

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

github-actions bot commented Oct 20, 2024

Thank you for following the naming conventions for pull request titles! 🙏

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Outside diff range and nitpick comments (2)
apps/dashboard/app/new/page.tsx (2)

82-82: Grid layout updated appropriately, consider responsive behavior

The grid layout has been correctly updated to reflect the removal of the semantic cache option. The change from lg:grid-cols-3 to md:grid-cols-2 is appropriate for the new two-option layout.

However, there's a minor typo in the class name: md::grid-cols-2 has an extra colon. It should be md:grid-cols-2.

Consider this minor fix:

-        <div className="grid grid-cols-1 gap-8 md::grid-cols-2">
+        <div className="grid grid-cols-1 gap-8 md:grid-cols-2">

Also, you might want to review the responsive behavior on medium-sized screens to ensure the layout looks as intended with this change.


Line range hint 1-238: Summary: LLM cache deprecation successfully implemented

The changes in this file effectively implement the deprecation of the LLM cache feature:

  1. The semantic cache option has been completely removed from the UI.
  2. The grid layout has been updated to accommodate two options instead of three.
  3. Related imports have been cleaned up.

These changes are consistent with the PR objective and maintain the overall structure and functionality of the component. The code remains clean and well-organized after the modifications.

As you continue to remove the LLM cache feature, ensure that any related backend services, API endpoints, or database tables are also cleaned up to maintain consistency across the entire application architecture.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 39b236f and fed8d2a.

⛔ Files ignored due to path filters (2)
  • apps/docs/semantic-cache/llmcache-monitor.png is excluded by !**/*.png
  • apps/docs/semantic-cache/llmcache.png is excluded by !**/*.png
📒 Files selected for processing (17)
  • apps/dashboard/app/(app)/desktop-sidebar.tsx (1 hunks)
  • apps/dashboard/app/(app)/layout.tsx (1 hunks)
  • apps/dashboard/app/(app)/mobile-sidebar.tsx (1 hunks)
  • apps/dashboard/app/(app)/semantic-cache/[gatewayId]/settings/delete-gateway.tsx (1 hunks)
  • apps/dashboard/app/(app)/semantic-cache/form.tsx (0 hunks)
  • apps/dashboard/app/(app)/semantic-cache/new/page.tsx (0 hunks)
  • apps/dashboard/app/(app)/semantic-cache/new/util/generate-semantic-cache-default-name.ts (0 hunks)
  • apps/dashboard/app/(app)/semantic-cache/page.tsx (1 hunks)
  • apps/dashboard/app/(app)/workspace-navigations.tsx (2 hunks)
  • apps/dashboard/app/new/create-semantic-cache.tsx (0 hunks)
  • apps/dashboard/app/new/page.tsx (2 hunks)
  • apps/dashboard/lib/trpc/routers/index.ts (0 hunks)
  • apps/dashboard/lib/trpc/routers/llmGateway/create.ts (0 hunks)
  • apps/docs/mint.json (0 hunks)
  • apps/docs/semantic-cache/introduction.mdx (0 hunks)
  • apps/docs/semantic-cache/settings.mdx (0 hunks)
  • apps/docs/semantic-cache/why-semantic-caching.mdx (0 hunks)
💤 Files with no reviewable changes (10)
  • apps/dashboard/app/(app)/semantic-cache/form.tsx
  • apps/dashboard/app/(app)/semantic-cache/new/page.tsx
  • apps/dashboard/app/(app)/semantic-cache/new/util/generate-semantic-cache-default-name.ts
  • apps/dashboard/app/new/create-semantic-cache.tsx
  • apps/dashboard/lib/trpc/routers/index.ts
  • apps/dashboard/lib/trpc/routers/llmGateway/create.ts
  • apps/docs/mint.json
  • apps/docs/semantic-cache/introduction.mdx
  • apps/docs/semantic-cache/settings.mdx
  • apps/docs/semantic-cache/why-semantic-caching.mdx
🧰 Additional context used
📓 Learnings (1)
apps/dashboard/app/(app)/workspace-navigations.tsx (2)
Learnt from: chronark
PR: unkeyed/unkey#2180
File: apps/dashboard/lib/constants/workspace-navigations.tsx:56-118
Timestamp: 2024-10-08T15:33:04.290Z
Learning: When typing the `workspace` parameter in functions like `createWorkspaceNavigation`, prefer importing the `Workspace` type from the database module and picking the necessary keys (e.g., `features`) instead of redefining the interface.
Learnt from: chronark
PR: unkeyed/unkey#2180
File: apps/dashboard/lib/constants/workspace-navigations.tsx:56-118
Timestamp: 2024-10-04T20:44:38.489Z
Learning: When typing the `workspace` parameter in functions like `createWorkspaceNavigation`, prefer importing the `Workspace` type from the database module and picking the necessary keys (e.g., `features`) instead of redefining the interface.
🔇 Additional comments (5)
apps/dashboard/app/(app)/layout.tsx (1)

25-27: LGTM! Verify impact on dependent components.

The addition of llmGateways to the workspace query is appropriate and aligns with the PR objective. It efficiently retrieves only the necessary id field.

To ensure consistency, please verify that the DesktopSidebar and MobileSideBar components are updated to handle this new llmGateways property. Run the following script to check for any usage of llmGateways in these components:

apps/dashboard/app/(app)/workspace-navigations.tsx (2)

58-59: LGTM: Type definition update aligns with best practices.

The updated type definition for the workspace parameter is consistent with our learnings about using Pick<Workspace, ...>. The addition of the llmGateways property is appropriate for the new functionality.


108-108: Verify impact on user experience.

The change to hide the "Semantic Cache" navigation item when there are no LLM gateways is logical and aligns with the PR objective. However, we should ensure that this doesn't negatively impact the user experience, especially for users who previously had access to this feature.

To verify the impact, let's check how many workspaces currently have LLM gateways:

This will help us understand how many users might be affected by this change.

✅ Verification successful

Verified: Minimal impact on user experience.

The change to hide the "Semantic Cache" navigation item affects only 2 workspaces without LLM gateways. Ensure that users in these workspaces are informed about the removal to maintain clarity.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Count workspaces with and without LLM gateways

# Search for workspace definitions
echo "Workspaces with LLM gateways:"
rg -c 'llmGateways.*\[.+\]' 

echo "Workspaces without LLM gateways:"
rg -c 'llmGateways.*\[\s*\]'

Length of output: 494

apps/dashboard/app/(app)/desktop-sidebar.tsx (1)

23-25: LGTM. Verify usage of the new llmGateways property.

The addition of the llmGateways property to the workspace object in the Props type is consistent with changes made in other components, as mentioned in the PR summary. This change expands the data model for the workspace.

To ensure the new property is being utilized effectively:

  1. Verify that the llmGateways data is being passed correctly to this component.
  2. Check if there are any places in the component where this new data should be used.

If the verification shows that llmGateways is not being used in the component, consider updating the component to utilize this new data, or remove it if it's not needed to avoid potential dead code.

apps/dashboard/app/new/page.tsx (1)

8-8: LGTM: Import statements updated correctly

The removal of the DatabaseZap import is consistent with the deprecation of the LLM cache feature. The remaining imports are unchanged and still relevant to the component.

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.

2 participants