Skip to content

Commit

Permalink
Merge branch 'main' into chatbot-analytics-post
Browse files Browse the repository at this point in the history
  • Loading branch information
jannikmaierhoefer authored Oct 2, 2024
2 parents fb281a1 + 1579bf7 commit d976cab
Show file tree
Hide file tree
Showing 130 changed files with 3,644 additions and 2,751 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
npm i langfuse-langchain
```

```typescript
```ts
import { CallbackHandler } from "langfuse-langchain";
// Deno: import CallbackHandler from "https://esm.sh/langfuse-langchain";

Expand Down
2 changes: 1 addition & 1 deletion components-mdx/get-started-langchain-js-env.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ npm i langfuse-langchain

<Env />

```typescript
```ts
import { CallbackHandler } from "langfuse-langchain";
// Deno: import CallbackHandler from "https://esm.sh/langfuse-langchain";

Expand Down
2 changes: 1 addition & 1 deletion components-mdx/public-metrics.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
src="https://lookerstudio.google.com/embed/reporting/5198bcda-7d3d-447d-b596-ebe778c5fe99/page/p_vkzvcv38gd"
frameborder="0"
style={{ border: 0 }}
allowfullscreen
allowFullScreen
sandbox="allow-storage-access-by-user-activation allow-scripts allow-same-origin allow-popups allow-popups-to-escape-sandbox"
className="w-full aspect-square mt-5 rounded overflow-hidden"
></iframe>
Expand Down
16 changes: 11 additions & 5 deletions components/CookbookIndex.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { getPagesUnderRoute } from "nextra/context";
import { type Page } from "nextra";
import { Card, Cards } from "nextra-theme-docs";
import { Cards } from "nextra/components";
import { FileCode } from "lucide-react";

export const CookbookIndex = ({ categories }: { categories?: string[] }) => (
Expand Down Expand Up @@ -37,20 +37,26 @@ export const CookbookIndex = ({ categories }: { categories?: string[] }) => (
.filter(([category]) => !categories || categories.includes(category))
.map(([category, pages]) => (
<div key={category}>
<h3 className="nx-font-semibold nx-tracking-tight nx-text-slate-900 dark:nx-text-slate-100 nx-mt-8 nx-text-2xl">
<h3 className="_font-semibold _tracking-tight _text-slate-900 dark:_text-slate-100 _mt-8 _text-2xl">
{category}
</h3>
<Cards num={2}>
{pages.map((page) => (
<Card
<Cards.Card
href={page.route}
key={page.route}
title={page.meta?.title || page.frontMatter?.title || page.name}
title={
page.frontMatter?.title ||
page.name
.split("_")
.map((word) => word.charAt(0).toUpperCase() + word.slice(1))
.join(" ")
}
icon={<FileCode />}
arrow
>
{""}
</Card>
</Cards.Card>
))}
</Cards>
</div>
Expand Down
38 changes: 38 additions & 0 deletions components/MenuSwitcher.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import { CircleHelp } from "lucide-react";
import { FileCode } from "lucide-react";
import { LibraryBig } from "lucide-react";
import Link from "next/link";
import { useRouter } from "next/router";
import React from "react";

export const MenuSwitcher = () => {
const { asPath } = useRouter();
return (
<div className="-mx-2 hidden md:block">
{[
{ title: "Docs", path: "/docs", Icon: LibraryBig },
{ title: "Guides", path: "/guides", Icon: FileCode },
{ title: "FAQ", path: "/faq", Icon: CircleHelp },
].map((item) =>
asPath.startsWith(item.path) ? (
<div
key={item.path}
className="group mb-3 flex flex-row items-center gap-3 _text-primary-800 dark:_text-primary-600"
>
<item.Icon className="w-7 h-7 p-1 border rounded _bg-primary-100 dark:_bg-primary-400/10" />
{item.title}
</div>
) : (
<Link
href={item.path}
key={item.path}
className="group mb-3 flex flex-row items-center gap-3 text-gray-500 hover:text-primary/100"
>
<item.Icon className="w-7 h-7 p-1 border rounded group-hover:bg-border/30" />
{item.title}
</Link>
)
)}
</div>
);
};
2 changes: 1 addition & 1 deletion components/NotebookBanner.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Callout } from "nextra-theme-docs";
import { Callout } from "nextra/components";
import { Button } from "./ui/button";

export const NotebookBanner: React.FC<{ src: string; className?: string }> = ({
Expand Down
26 changes: 19 additions & 7 deletions components/VideoIndex.tsx
Original file line number Diff line number Diff line change
@@ -1,27 +1,39 @@
import { getPagesUnderRoute } from "nextra/context";
import { type Page } from "nextra";
import { Card, Cards } from "nextra-theme-docs";
import { Cards } from "nextra/components";
import { Video } from "lucide-react";
import Image from "next/image";

export const VideoIndex = () => (
<Cards num={3}>
<Cards num={2}>
{(
getPagesUnderRoute("/guides/videos") as Array<Page & { frontMatter: any }>
).map((page, i) => (
<Card
<Cards.Card
href={page.route}
key={page.route}
title={page.meta?.title || page.frontMatter?.title || page.name}
image={Boolean(page.frontMatter.ogImage)}
title={
page.frontMatter?.title ||
page.name
.split("_")
.map((word) => word.charAt(0).toUpperCase() + word.slice(1))
.join(" ")
}
// image={Boolean(page.frontMatter.ogImage)}
icon={<Video />}
arrow
>
{page.frontMatter.ogImage ? (
<div className="relative aspect-video">
<Image
src={page.frontMatter.ogImage}
alt={page.meta?.title || page.frontMatter?.title || page.name}
alt={
page.frontMatter?.title ||
page.name
.split("_")
.map((word) => word.charAt(0).toUpperCase() + word.slice(1))
.join(" ")
}
objectFit="cover"
fill
sizes="(max-width: 560px) 100vw, (max-width: 1350px) 50vw, 33vw"
Expand All @@ -30,7 +42,7 @@ export const VideoIndex = () => (
) : (
""
)}
</Card>
</Cards.Card>
))}
</Cards>
);
5 changes: 5 additions & 0 deletions components/blog/BlogIndex.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ export const BlogIndex = ({ maxItems }: { maxItems?: number }) => (
<div className="grid grid-cols-1 sm:grid-cols-2 xl:grid-cols-3 gap-7">
{(getPagesUnderRoute("/blog") as Array<Page & { frontMatter: any }>)
.filter((page) => page.frontMatter?.showInBlogIndex !== false)
.sort(
(a, b) =>
new Date(b.frontMatter.date).getTime() -
new Date(a.frontMatter.date).getTime()
)
.slice(0, maxItems)
.map((page) => (
<Link key={page.route} href={page.route} className="block mb-8 group">
Expand Down
6 changes: 3 additions & 3 deletions components/faq/FaqIndex.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { getPagesUnderRoute } from "nextra/context";
import { type Page } from "nextra";
import { Card, Cards } from "nextra-theme-docs";
import { Cards } from "nextra/components";
import { MessageCircleQuestion } from "lucide-react";
import Link from "next/link";

Expand Down Expand Up @@ -50,7 +50,7 @@ export const FaqIndex = () => {
</h3>
<Cards num={1}>
{pages.slice(0, PREVIEW_PAGES_PER_TAG).map((page) => (
<Card
<Cards.Card
href={page.route}
key={page.route}
title={
Expand All @@ -60,7 +60,7 @@ export const FaqIndex = () => {
arrow
>
{""}
</Card>
</Cards.Card>
))}
</Cards>
<p className="mt-4">
Expand Down
8 changes: 4 additions & 4 deletions components/faq/FaqPreview.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { getPagesUnderRoute } from "nextra/context";
import { type Page } from "nextra";
import { Card, Cards } from "nextra-theme-docs";
import { Cards } from "nextra/components";
import { MessageCircleQuestion } from "lucide-react";
import Link from "next/link";

Expand Down Expand Up @@ -46,15 +46,15 @@ export const FaqList = ({
return (
<Cards num={1}>
{pages.map((page) => (
<Card
<Cards.Card
href={page.route}
key={page.route}
title={page.meta?.title || page.frontMatter?.title || page.name}
icon={<MessageCircleQuestion />}
arrow
>
{""}
</Card>
</Cards.Card>
))}
</Cards>
);
Expand All @@ -71,7 +71,7 @@ export const FaqList = ({
<Link
key={page.route}
href={page.route}
className="nx-text-primary-600 nx-underline nx-decoration-from-font [text-underline-position:from-font]"
className="_text-primary-600 _underline _decoration-from-font [text-underline-position:from-font]"
>
<span className="">
{page.meta?.title || page.frontMatter?.title || page.name}
Expand Down
2 changes: 1 addition & 1 deletion components/gh-discussions/GhDiscussionsPreviewInternal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ const GhDiscussionsPreviewInternal = ({
</Button>
</div>
</div>
<div className="border rounded">
<div className="border rounded bg-card">
<TabsContent value="Support">
{renderDiscussions("Support")}
</TabsContent>
Expand Down
9 changes: 6 additions & 3 deletions components/home/Changelog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ export default function Changelog({ className }: { className?: string }) {

return (
<div
className={cn("rounded border p-5 max-w-lg mx-5 sm:mx-auto", className)}
className={cn(
"rounded border p-5 max-w-lg mx-5 sm:mx-auto bg-card",
className
)}
role="region" // Added role for the container
aria-labelledby="changelog-heading" // Added aria-labelledby to reference the heading
>
Expand All @@ -52,7 +55,7 @@ export default function Changelog({ className }: { className?: string }) {
<div className="w-px bg-secondary" />
</div>

<div className="relative flex h-6 w-6 flex-none items-center justify-center bg-background">
<div className="relative flex h-6 w-6 flex-none items-center justify-center bg-card">
<div className="h-1.5 w-1.5 rounded-full bg-secondary ring-1 ring-primary/80 opacity-60 group-hover:opacity-100" />
</div>
<p className="flex-auto py-0.5 text-sm leading-5 text-primary/70 opacity-80 group-hover:opacity-100">
Expand Down Expand Up @@ -84,7 +87,7 @@ export default function Changelog({ className }: { className?: string }) {
<div className="w-px bg-secondary" />
</div>

<div className="relative flex h-6 w-6 flex-none items-center justify-center bg-background">
<div className="relative flex h-6 w-6 flex-none items-center justify-center bg-card">
<div className="h-1.5 w-1.5 rounded-full bg-secondary ring-1 ring-primary/80 opacity-60 group-hover:opacity-100" />
</div>
<p className="flex-auto py-0.5 text-sm leading-5 text-primary/60 opacity-80 group-hover:opacity-100">
Expand Down
2 changes: 1 addition & 1 deletion components/home/Integrations.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export default function Integrations() {
]}
/>
<div
className="relative flex w-full mx-auto max-w-3xl items-center justify-center overflow-hidden rounded border bg-background py-4 px-2 md:p-12"
className="relative flex w-full mx-auto max-w-3xl items-center justify-center overflow-hidden rounded border bg-card py-4 px-2 md:p-12"
ref={containerRef}
>
<div className="flex h-full w-full flex-col items-stretch justify-between gap-2 md:gap-4">
Expand Down
2 changes: 1 addition & 1 deletion cookbook/example_external_evaluation_pipelines.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
" frameborder=\"0\"\n",
" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\"\n",
" referrerpolicy=\"strict-origin-when-cross-origin\"\n",
" allowfullscreen\n",
" allowFullScreen\n",
"></iframe>"
]
},
Expand Down
10 changes: 5 additions & 5 deletions cookbook/example_llm_security_monitoring.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -892,18 +892,18 @@
"provenance": []
},
"kernelspec": {
"display_name": "Deno",
"language": "typescript",
"name": "deno"
"display_name": ".venv",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": "typescript",
"file_extension": ".ts",
"mimetype": "text/x.typescript",
"name": "typescript",
"name": "python",
"nbconvert_exporter": "script",
"pygments_lexer": "typescript",
"version": "5.4.5"
"version": "3.9.18"
},
"widgets": {
"application/vnd.jupyter.widget-state+json": {
Expand Down
Loading

0 comments on commit d976cab

Please sign in to comment.