Skip to content

Commit

Permalink
docs: add mistral sdk cookbook (#800)
Browse files Browse the repository at this point in the history
* docs: add mistral sdk notebook

* add notebooks to integration overview

* reference in decorator docs
  • Loading branch information
marcklingen authored Sep 17, 2024
1 parent bf0b868 commit 720e511
Show file tree
Hide file tree
Showing 8 changed files with 1,668 additions and 1 deletion.
13 changes: 12 additions & 1 deletion components/CookbookIndex.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { type Page } from "nextra";
import { Card, Cards } from "nextra-theme-docs";
import { FileCode } from "lucide-react";

export const CookbookIndex = () => (
export const CookbookIndex = ({ categories }: { categories?: string[] }) => (
<>
{Object.entries(
(
Expand All @@ -20,10 +20,21 @@ export const CookbookIndex = () => (
}, {} as Record<string, Array<Page & { frontMatter: any }>>)
)
.sort(([categoryA], [categoryB]) => {
// if categories are provided, use the order of the provided categories
if (categories) {
const indexA = categories.indexOf(categoryA);
const indexB = categories.indexOf(categoryB);
if (indexA === -1) return 1;
if (indexB === -1) return -1;
return indexA - indexB;
}

// if categories are not provided, use the default order, Other last
if (categoryA === "Other") return 1;
if (categoryB === "Other") return -1;
return categoryA.localeCompare(categoryB);
})
.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">
Expand Down
4 changes: 4 additions & 0 deletions cookbook/_routes.json
Original file line number Diff line number Diff line change
Expand Up @@ -126,5 +126,9 @@
{
"notebook": "example_external_evaluation_pipelines.ipynb",
"docsPath": "docs/scores/external-evaluation-pipelines"
},
{
"notebook": "integration_mistral_sdk.ipynb",
"docsPath": null
}
]
Loading

0 comments on commit 720e511

Please sign in to comment.