🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.
TypeScript analyticsautogenevaluationlangchainlarge-language-modelsllama-indexllmllm-evaluationllm-observabilityllmopsmonitoringobservabilityopen-sourceopenaiplaygroundprompt-engineeringprompt-managementself-hostedycombinator
feat(ai-gateway): add docs buttons to models and gateway API keys pages (#19271)
Tobias Wochingerf94da6a0e184
diff --git a/web/src/components/ActionButton.tsx b/web/src/components/ActionButton.tsxindex 50962c61a1..ba19f1e142 100644--- a/web/src/components/ActionButton.tsx+++ b/web/src/components/ActionButton.tsx@@ -1,6 +1,6 @@/* eslint-disable no-nested-ternary, @typescript-eslint/no-use-before-define */import React, { useMemo } from "react";-import { Lock, AlertCircle, Sparkle } from "@langfuse/icons";+import { Lock, AlertCircle, ExternalLink, Sparkle } from "@langfuse/icons";import { Button, type ButtonProps } from "@/src/components/ui/button";import { HoverCard } from "@/src/components/design-system/HoverCard/HoverCard";import Link from "next/link";@@ -158,6 +158,9 @@ const ButtonContent = React.forwardRef<},ref,) {+ const renderLink = href && !isDisabled;+ const isExternal = href && isExternalUrl(href);+const content = (<>{!hasAccess ? (@@ -170,12 +173,16 @@ const ButtonContent = React.forwardRef<<div className="mr-1">{icon}</div>) : null}{children}+ {renderLink && isExternal ? (+ <ExternalLink+ size="sm"+ aria-hidden+ __rawClassName="ml-1 -translate-y-px"+ />+ ) : null}</>);- const renderLink = href && !isDisabled;- const isExternal = href && isExternalUrl(href);-return (<Buttonref={ref}diff --git a/web/src/ee/features/billing/components/BillingSwitchPlanDialog.tsx b/web/src/ee/features/billing/components/BillingSwitchPlanDialog.tsxindex 477eadc5e8..9fcebcb6e9 100644--- a/web/src/ee/features/billing/components/BillingSwitchPlanDialog.tsx+++ b/web/src/ee/features/billing/components/BillingSwitchPlanDialog.tsx@@ -86,7 +86,7 @@ export const BillingSwitchPlanDialog = ({variant="secondary"href="https://langfuse.com/pricing">- Comparison of plans ↗+ Comparison of plans</ActionButton></div></DialogHeader>diff --git a/web/src/features/ai-gateway/components/GatewayApiKeysPage/components/GatewayApiKeysTable/GatewayApiKeysTable.tsx b/web/src/features/ai-gateway/components/GatewayApiKeysPage/components/GatewayApiKeysTable/GatewayApiKeysTable.tsxindex cc812456f2..88d431aab2 100644--- a/web/src/features/ai-gateway/components/GatewayApiKeysPage/components/GatewayApiKeysTable/GatewayApiKeysTable.tsx+++ b/web/src/features/ai-gateway/components/GatewayApiKeysPage/components/GatewayApiKeysTable/GatewayApiKeysTable.tsx@@ -9,6 +9,7 @@ import { createTextTableColumn } from "@/src/components/design-system/table/coluimport { createUserTableColumn } from "@/src/components/design-system/table/columns/createUserTableColumn";import type { AsyncTableData } from "@/src/components/design-system/table/Table";import type { LangfuseColumnDef } from "@/src/components/table/types";+import { GATEWAY_API_KEYS_DOCS_URL } from "@/src/features/ai-gateway/constants/gatewayDocsUrls";import { isApiKeyExpired } from "@/src/features/apiKey";type GatewayApiKey = {@@ -108,6 +109,12 @@ export function GatewayApiKeysTable({pagination={pagination}search={{ ...search, placeholder: "Search by name or user" }}toolbarActions={[+ {+ id: "docs",+ label: "Docs",+ variant: "secondary",+ href: GATEWAY_API_KEYS_DOCS_URL,+ },{id: "create-key",label: "Create key",diff --git a/web/src/features/ai-gateway/components/GatewayModelsPage/components/ConnectedGatewayModelsTable/ConnectedGatewayModelsTable.tsx b/web/src/features/ai-gateway/components/GatewayModelsPage/components/ConnectedGatewayModelsTable/ConnectedGatewayModelsTable.tsxindex f036b7ad71..03f7ba4b23 100644--- a/web/src/features/ai-gateway/components/GatewayModelsPage/components/ConnectedGatewayModelsTable/ConnectedGatewayModelsTable.tsx+++ b/web/src/features/ai-gateway/components/GatewayModelsPage/components/ConnectedGatewayModelsTable/ConnectedGatewayModelsTable.tsx@@ -1,11 +1,12 @@/* eslint-disable @typescript-eslint/no-use-before-define */import { useMemo, useState } from "react";-import Header from "@/src/components/layouts/header";import { Alert } from "@/src/components/design-system/Alert/Alert";+import { Button } from "@/src/components/design-system/Button/Button";import type { PaginationBarProps } from "@/src/components/design-system/PaginationBar/PaginationBar";import { SearchInput } from "@/src/components/design-system/SearchInput/SearchInput";import { SelectInput } from "@/src/components/design-system/SelectInput/SelectInput";+import { GATEWAY_MODELS_DOCS_URL } from "@/src/features/ai-gateway/constants/gatewayDocsUrls";import { providerLabels } from "@/src/features/ai-gateway/constants/providerLabels";import type { GatewayProvider } from "@/src/features/ai-gateway/types/gatewayProvider";import {@@ -84,7 +85,16 @@ export function ConnectedGatewayModelsTable({return (<div className="flex h-full min-h-0 flex-col gap-4">- <Header title="Gateway models" />+ <Header+ title="Gateway models"+ actionButtons={+ <Button+ variant="secondary"+ text="Docs"+ href={GATEWAY_MODELS_DOCS_URL}+ />+ }+ /><p className="text-muted-foreground text-sm">These models are enabled and available to use through the AI Gateway.</p>diff --git a/web/src/features/ai-gateway/constants/agentSetupInstructions.ts b/web/src/features/ai-gateway/constants/agentSetupInstructions.tsindex aa8a44e0e5..832bdeae69 100644--- a/web/src/features/ai-gateway/constants/agentSetupInstructions.ts+++ b/web/src/features/ai-gateway/constants/agentSetupInstructions.ts@@ -1,8 +1,8 @@+import { GATEWAY_DOCS_URL } from "./gatewayDocsUrls";+export const GATEWAY_KEY_PLACEHOLDER = "<your-gateway-key>";export const GATEWAY_USER_ID_PLACEHOLDER = "<you>@example.com";-const GATEWAY_DOCS_URL = "https://langfuse.com/docs/ai-gateway";-export const AGENT_SETUP_DOCS_URLS = {api: `${GATEWAY_DOCS_URL}/get-started`,"claude-desktop": `${GATEWAY_DOCS_URL}/coding-agents/claude-code#claude-desktop`,diff --git a/web/src/features/ai-gateway/constants/gatewayDocsUrls.ts b/web/src/features/ai-gateway/constants/gatewayDocsUrls.tsnew file mode 100644index 0000000000..a7c6534a26--- /dev/null+++ b/web/src/features/ai-gateway/constants/gatewayDocsUrls.ts@@ -0,0 +1,4 @@+export const GATEWAY_DOCS_URL = "https://langfuse.com/docs/ai-gateway";++export const GATEWAY_MODELS_DOCS_URL = `${GATEWAY_DOCS_URL}/get-started#add-provider-connections`;+export const GATEWAY_API_KEYS_DOCS_URL = `${GATEWAY_DOCS_URL}/get-started#create-a-gateway-api-key`;