From 86ea42f87c72d71a4b6f2b56e6f0cacbdb02e640 Mon Sep 17 00:00:00 2001 From: Harish Mohan Raj Date: Mon, 16 Dec 2024 10:03:00 +0000 Subject: [PATCH 1/8] Add home page and fix pre-commit errors --- .github/workflows/deploy-website-mintlify.yml | 4 +- .../blog/2024-03-03-AutoGen-Update/index.mdx | 2 +- website/docs/FAQ.mdx | 2 +- website/docs/Home.mdx | 26 ++++++ website/mint-style.css | 86 +++++++++++++++++++ website/mint.json | 1 + .../snippets/components/ExploreContent.mdx | 47 ++++++++++ website/snippets/components/KeyFeatures.mdx | 40 +++++++++ .../snippets/components/PopularResources.mdx | 42 +++++++++ 9 files changed, 246 insertions(+), 4 deletions(-) create mode 100644 website/docs/Home.mdx create mode 100644 website/snippets/components/ExploreContent.mdx create mode 100644 website/snippets/components/KeyFeatures.mdx create mode 100644 website/snippets/components/PopularResources.mdx diff --git a/.github/workflows/deploy-website-mintlify.yml b/.github/workflows/deploy-website-mintlify.yml index 36f5545d53..2c8d13d421 100644 --- a/.github/workflows/deploy-website-mintlify.yml +++ b/.github/workflows/deploy-website-mintlify.yml @@ -23,7 +23,7 @@ jobs: run: | # Create a temporary directory for filtered content mkdir -p temp_website - + # Copy all files except .ipynb and node_modules find website -type f -not -path "*/node_modules/*" -not -name "*.ipynb" -exec cp --parents {} temp_website/ \; @@ -32,4 +32,4 @@ jobs: with: branch: mintlify-pages folder: temp_website/website - clean: true # Automatically remove deleted files from the deploy branch \ No newline at end of file + clean: true # Automatically remove deleted files from the deploy branch diff --git a/website/blog/2024-03-03-AutoGen-Update/index.mdx b/website/blog/2024-03-03-AutoGen-Update/index.mdx index 3a9a700496..11e7b7301b 100644 --- a/website/blog/2024-03-03-AutoGen-Update/index.mdx +++ b/website/blog/2024-03-03-AutoGen-Update/index.mdx @@ -38,7 +38,7 @@ Many users have deep understanding of the value in different dimensions, such as > The same reason autogen is significant is the same reason OOP is a good idea. Autogen packages up all that complexity into an agent I can create in one line, or modify with another. -{/* +{/* I had lots of ideas I wanted to implement, but it needed a framework like this and I am just not the guy to make such a robust and intelligent framework. */} diff --git a/website/docs/FAQ.mdx b/website/docs/FAQ.mdx index aa12938b9e..7c58cf7e98 100644 --- a/website/docs/FAQ.mdx +++ b/website/docs/FAQ.mdx @@ -284,4 +284,4 @@ RUN apt-get clean && \ apt-get install sudo git npm # and whatever packages need to be installed in this specific version of the devcontainer ``` -This is a combination of StackOverflow suggestions [here](https://stackoverflow.com/a/48777773/2114580) and [here](https://stackoverflow.com/a/76092743/2114580). \ No newline at end of file +This is a combination of StackOverflow suggestions [here](https://stackoverflow.com/a/48777773/2114580) and [here](https://stackoverflow.com/a/76092743/2114580). diff --git a/website/docs/Home.mdx b/website/docs/Home.mdx new file mode 100644 index 0000000000..8becab57dc --- /dev/null +++ b/website/docs/Home.mdx @@ -0,0 +1,26 @@ +--- +title: "Home" +mode: "wide" +--- + +import { PopularResources } from '/snippets/components/PopularResources.mdx'; +import { KeyFeatures } from '/snippets/components/KeyFeatures.mdx'; +import { ExploreContent } from '/snippets/components/ExploreContent.mdx'; + +
+
+ +

AG2

+

The Open Source Agent OS

+ Getting Started - 3min ⏱️ +
+
+ +### Popular resources + + +### Key Features + + +### Explore content + diff --git a/website/mint-style.css b/website/mint-style.css index 8244ec9032..e1a144cb44 100644 --- a/website/mint-style.css +++ b/website/mint-style.css @@ -68,6 +68,92 @@ h4 { } } +/* Home page hero section starts */ +.homepage-hero-section { + display: flex; + justify-content: center; + align-items: center; + background-color: #4B9CD6; /* #4B9CD6 */ +} +.hero-content { + display: flex; + flex-direction: column; + align-items: center; +} +.homepage-hero-section .hero-content .hero-logo { + margin: 2em auto 0; +} +.homepage-hero-section .hero-content .hero-title { + margin: 0; + color: #fff; +} +.homepage-hero-section .hero-content .hero-subtitle { + margin: 0 0 1em 0; + color: #fff; +} +.homepage-hero-section .hero-content .hero-btn { + margin: 0 auto 2em; + background-color: #ebedf0; + border-radius: 5px; + padding: 5px 30px; + border: none; + cursor: pointer; + text-align: center; + display: inline-block; +} +/* Home page hero section ends */ +/* Home page popular resources section starts */ +.popular-resources .card { + padding: 0; + box-shadow: none; + border: none; + background: transparent; +} + +.popular-resources .card .px-6.py-5 { + padding: 0; + text-align: center; +} +.popular-resources .youtube-video a { + color: #4b9cd6; + display: inline-block; +} +.popular-resources .youtube-video a:hover { + text-decoration: underline; +} +/* Home page popular resources section ends */ + +/* Home page key features section starts */ +.key-features .card { + padding: 0.5rem; + box-shadow: none; + border: none; + background: transparent; +} +.key-features .card .px-6.py-5 { + padding: 0; + text-align: center; +} +.key-features .card .key-feature img { + width:132px; + height:132px; + margin:0 auto; +} +.key-features .card .key-feature h5 { + color: #4b9cd6; + font-weight: bold; + margin: 0.75rem 0; +} +.key-features .card .key-feature p { + font-size: 0.85rem; +} +/* Home page key features section ends */ +/* Home page explore content section starts */ + +.explore-content h2 { + font-size: 1.5rem !important; +} +/* Home page explore content section ends */ #search-bar-entry { border-radius: 0 !important; height: 36px; diff --git a/website/mint.json b/website/mint.json index d760b92734..422cee60e2 100644 --- a/website/mint.json +++ b/website/mint.json @@ -53,6 +53,7 @@ { "group": "", "pages": [ + "docs/Home", "docs/Getting-Started" ] }, diff --git a/website/snippets/components/ExploreContent.mdx b/website/snippets/components/ExploreContent.mdx new file mode 100644 index 0000000000..d40186d320 --- /dev/null +++ b/website/snippets/components/ExploreContent.mdx @@ -0,0 +1,47 @@ +export const ExploreContent = () => { + + const contents = [ + { + title: "Get Started", + link: "/docs/Getting-Started", + description: "Learn how to get started with AG2. Follow the instruction to quickly build-up your first AG2 application.", + }, + { + title: "Tutorial", + link: "docs/tutorial/introduction", + description: "This tutorial introduces basic concepts and building blocks of AG2.", + }, + { + title: "User Guide", + link: "docs/topics", + description: "Users' guide to different functionalities of AG2, including CodeExecution, GroupChat, and more.", + }, + { + title: "Examples", + link: "docs/Examples", + description: "Learn different examples demonstrating the usage of AG2 in various scenarios.", + }, + { + title: "Applications", + link: "docs/Gallery", + description: "A collection of different applications built using AG2.", + }, + { + title: "Contributions", + link: "docs/contributor-guide/contributing", + description: "Learn about how you can contribute to AG2 and this documentation, including pushing patches, code review and more.", + }, + ]; + + return ( +
+ + {contents.map((feature, index) => ( + + {feature.description} + + ))} + +
+ ) +} diff --git a/website/snippets/components/KeyFeatures.mdx b/website/snippets/components/KeyFeatures.mdx new file mode 100644 index 0000000000..65d0c1383a --- /dev/null +++ b/website/snippets/components/KeyFeatures.mdx @@ -0,0 +1,40 @@ +export const KeyFeatures = () => { + const FeatureList = [ + { + title: 'Multi-Agent Conversation Framework', + Svg: '/static/img/conv_2.svg', + docLink: '/docs/Use-Cases/agent_chat', + description: "AG2 provides multi-agent conversation framework as a high-level abstraction. With this framework, one can conveniently build LLM workflows." + }, + { + title: 'Easily Build Diverse Applications', + Svg: '/static/img/autogen_app.svg', + docLink: '/docs/Use-Cases/agent_chat#diverse-applications-implemented-with-autogen', + description: "AG2 offers a collection of working systems spanning a wide range of applications from various domains and complexities.", + }, + { + title: 'Enhanced LLM Inference & Optimization', + Svg: '/static/img/extend.svg', + docLink: '/docs/Use-Cases/enhanced_inference', + description: 'AG2 supports enhanced LLM inference APIs, which can be used to improve inference performance and reduce cost.', + }, + ]; + + return ( +
+ + {FeatureList.map((feature, index) => ( + +
+ {feature.title} + +
{feature.title}
+
+

{feature.description}

+
+
+ ))} +
+
+ ); +}; diff --git a/website/snippets/components/PopularResources.mdx b/website/snippets/components/PopularResources.mdx new file mode 100644 index 0000000000..2832729eb6 --- /dev/null +++ b/website/snippets/components/PopularResources.mdx @@ -0,0 +1,42 @@ +export const PopularResources = ({ src, linkText }) => { + const convertEmbedToWatchUrl = (embedUrl) => { + const url = new URL(embedUrl); + const videoId = url.pathname.split('/')[2]; + return `https://www.youtube.com/watch?v=${videoId}`; + }; + + const resourcesList = [ + { + src: "https://www.youtube.com/embed/RLwyXRVvlNk", + linkText: "Foundation Capital Interview with Dr. Chi Wang" + }, + { + src: "https://www.youtube.com/embed/TBNTH-fwGPE", + linkText: "Learn AG2 on DeepLearningAI" + } + ] + + return ( + + ); +}; From 3adcfc09fcc7d974aea54f3e06ba245d74621369 Mon Sep 17 00:00:00 2001 From: Harish Mohan Raj Date: Mon, 16 Dec 2024 15:05:15 +0000 Subject: [PATCH 2/8] WIP: Add examples page --- website/docs/notebooks.mdx | 2 +- website/{docs => examples}/Examples.mdx | 4 +- website/{docs => examples}/Gallery.mdx | 12 +- website/mint-app-gallery-deps.js | 52 ++++++++ website/mint-style.css | 57 +++++++++ website/mint.json | 9 +- .../components/ClientSideComponent.mdx | 7 ++ website/snippets/components/GalleryPage.mdx | 112 ++++++++++++++++++ .../data/{gallery.json => GalleryItems.mdx} | 2 +- 9 files changed, 247 insertions(+), 10 deletions(-) rename website/{docs => examples}/Examples.mdx (99%) rename website/{docs => examples}/Gallery.mdx (79%) create mode 100644 website/mint-app-gallery-deps.js create mode 100644 website/snippets/components/ClientSideComponent.mdx create mode 100644 website/snippets/components/GalleryPage.mdx rename website/snippets/data/{gallery.json => GalleryItems.mdx} (99%) diff --git a/website/docs/notebooks.mdx b/website/docs/notebooks.mdx index 8c3ef35994..447cc8d5a0 100644 --- a/website/docs/notebooks.mdx +++ b/website/docs/notebooks.mdx @@ -3,7 +3,7 @@ hide_table_of_contents: true --- import {findAllNotebooks} from '../src/components/NotebookUtils'; -import GalleryPage from '../src/components/GalleryPage'; +import GalleryPage from '/snippets/components/GalleryPage.mdx'; # Notebooks diff --git a/website/docs/Examples.mdx b/website/examples/Examples.mdx similarity index 99% rename from website/docs/Examples.mdx rename to website/examples/Examples.mdx index 896de486f6..ab036218e1 100644 --- a/website/docs/Examples.mdx +++ b/website/examples/Examples.mdx @@ -1,4 +1,6 @@ -# Examples +--- +title: Examples by Category +--- ## Automated Multi Agent Chat diff --git a/website/docs/Gallery.mdx b/website/examples/Gallery.mdx similarity index 79% rename from website/docs/Gallery.mdx rename to website/examples/Gallery.mdx index 2f00bf1cf7..cfb19a6e99 100644 --- a/website/docs/Gallery.mdx +++ b/website/examples/Gallery.mdx @@ -1,18 +1,18 @@ --- -hide_table_of_contents: true +title: Application Gallery +mode: "wide" --- -import GalleryPage from "/snippets/components/GalleryPage.js"; -import galleryData from "/snippets/data/gallery.json"; - -# Gallery +import { GalleryPage } from "/snippets/components/GalleryPage.mdx"; +import { galleryItems } from "/snippets/data/GalleryItems.mdx"; +import { ClientSideComponent } from "/snippets/components/ClientSideComponent.mdx"; This page contains a list of demos that use AutoGen in various applications from the community. **Contribution guide:** Built something interesting with AutoGen? Submit a PR to add it to the list! See the [Contribution Guide below](#contributing) for more details. - + ## Contributing diff --git a/website/mint-app-gallery-deps.js b/website/mint-app-gallery-deps.js new file mode 100644 index 0000000000..01390d9827 --- /dev/null +++ b/website/mint-app-gallery-deps.js @@ -0,0 +1,52 @@ +// Load jQuery if not present +if (typeof jQuery === "undefined") { + const jqueryScript = document.createElement("script"); + jqueryScript.src = + "https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js"; + document.head.appendChild(jqueryScript); + + jqueryScript.onload = function () { + // Load Chosen after jQuery + const chosenScript = document.createElement("script"); + chosenScript.src = + "https://cdnjs.cloudflare.com/ajax/libs/chosen/1.8.7/chosen.jquery.min.js"; + document.head.appendChild(chosenScript); + + // Add Chosen CSS + const chosenStyles = document.createElement("link"); + chosenStyles.rel = "stylesheet"; + chosenStyles.href = + "https://cdnjs.cloudflare.com/ajax/libs/chosen/1.8.7/chosen.min.css"; + document.head.appendChild(chosenStyles); + + // Initialize Chosen when everything is loaded + chosenScript.onload = function () { + initializeGallerySelect(); + }; + }; +} + +// Function to initialize Chosen on gallery select +function initializeGallerySelect() { + setTimeout(() => { + $(".examples-gallery-container .tag-filter") + .chosen({ + width: "100%", + placeholder_text_multiple: "Filter by tags", + }) + .on("change", function (evt, params) { + const selectedValues = $(this).val() || []; + // Create and dispatch a custom event + const changeEvent = new Event("change"); + evt.target.selectedValues = selectedValues; + evt.target.dispatchEvent(changeEvent); + }); + }, 500); +} + +// Initialize on page load and after dynamic content loads +document.addEventListener("DOMContentLoaded", function () { + if (window.jQuery && window.jQuery.fn.chosen) { + initializeGallerySelect(); + } +}); diff --git a/website/mint-style.css b/website/mint-style.css index e1a144cb44..a61d1b8889 100644 --- a/website/mint-style.css +++ b/website/mint-style.css @@ -100,6 +100,7 @@ h4 { cursor: pointer; text-align: center; display: inline-block; + color: #000; } /* Home page hero section ends */ /* Home page popular resources section starts */ @@ -154,6 +155,62 @@ h4 { font-size: 1.5rem !important; } /* Home page explore content section ends */ + +/* Examples page Gallery section starts */ +.examples-gallery-container h5{ + font-weight: bold; +} +.examples-gallery-container p{ + font-size: 0.7rem; + margin-top: 0.25rem; + line-height: 1.5; +} +.examples-gallery-container .card { + padding: 0.5rem; +} +.examples-gallery-container .card .px-6.py-5 { + padding: 0; +} +.examples-gallery-container .tags-container { + margin-top:1rem; +} +.examples-gallery-container .tag { + display: inline-flex; + flex-wrap: wrap; + background-color: #f0f0f0; + padding: 0 12px; + border-radius: 12px; + font-size: 0.7rem; + color: #666; + cursor: pointer; + transition: background-color 0.2s; + margin: 0.35rem 0.1rem 0 0; + font-size: 0.7rem; +} + +.examples-gallery-container .tag:hover { + background-color: #e0e0e0; +} + +.examples-gallery-container .chosen-container-multi .chosen-choices li.search-field { + padding: 0px !important; + margin: 0px !important; +} +.examples-gallery-container .chosen-container-multi .chosen-choices li.search-field::before, +.examples-gallery-container .chosen-container-multi .chosen-drop .chosen-results .active-result::before, +.examples-gallery-container .chosen-container-multi .chosen-drop .chosen-results .result-selected::before, +.examples-gallery-container .chosen-container-multi .chosen-choices li.search-choice::before { + display: none; +} +.examples-gallery-container .chosen-container-multi .chosen-choices li.search-choice, +.examples-gallery-container .chosen-container-multi .chosen-drop .chosen-results .active-result, +.examples-gallery-container .chosen-container-multi .chosen-drop .chosen-results .result-selected { + padding-left: 5px !important; +} +.examples-gallery-container .search-choice-close { + border-bottom: none; +} +/* Examples page Gallery section ends */ #search-bar-entry { border-radius: 0 !important; height: 36px; diff --git a/website/mint.json b/website/mint.json index 422cee60e2..30ecc29fe9 100644 --- a/website/mint.json +++ b/website/mint.json @@ -37,7 +37,7 @@ }, { "name": "Examples", - "url": "notebook" + "url": "examples" }, { "name": "Community Talks", @@ -160,6 +160,13 @@ "talks/2024-09-23/index", "talks/2024-08-26/index" ] + }, + { + "group": "Examples", + "pages": [ + "examples/Examples", + "examples/Gallery" + ] } ], "footerSocials": { diff --git a/website/snippets/components/ClientSideComponent.mdx b/website/snippets/components/ClientSideComponent.mdx new file mode 100644 index 0000000000..2c23171c06 --- /dev/null +++ b/website/snippets/components/ClientSideComponent.mdx @@ -0,0 +1,7 @@ +export const ClientSideComponent = ({ Component, componentProps }) => { + if (typeof document === "undefined") { + return null; + } + + return ; +}; diff --git a/website/snippets/components/GalleryPage.mdx b/website/snippets/components/GalleryPage.mdx new file mode 100644 index 0000000000..b3ed1bcd86 --- /dev/null +++ b/website/snippets/components/GalleryPage.mdx @@ -0,0 +1,112 @@ +export const GalleryPage = ({ + galleryItems, + allowDefaultImage = true, + target = "_blank", +}) => { + + let selectedTags = []; + const defaultImageIfNoImage = allowDefaultImage ?? true; + + const allTags = [...new Set(galleryItems.flatMap((item) => item.tags))]; + + const imageFunc = (item) => { + const image = ( + {item.title} + ); + const imageToUse = item.image + ? image + : defaultImageIfNoImage + ? image + : null; + return imageToUse; + }; + + const handleTagChange = (tags) => { + selectedTags = tags; + filterItems(); + }; + + const filterItems = () => { + const cards = document.querySelectorAll('.examples-gallery-container .card'); + cards.forEach(card => { + const cardTags = Array.from(card.querySelectorAll('.tag')).map(tag => tag.textContent); + if (selectedTags.length === 0 || selectedTags.some(tag => cardTags.includes(tag))) { + card.style.display = ''; + } else { + card.style.display = 'none'; + } + }); + }; + + const handleSelectChange = (event) => { + const selectedOptions = event.target.selectedValues || Array.from(event.target.selectedOptions).map(option => option.value); + handleTagChange(selectedOptions); + }; + + const TagsView = ({ tags }) => ( +
+ {tags?.map((tag, index) => ( + { + if (!selectedTags.includes(tag)) { + handleTagChange([...selectedTags, tag]); + + const select = document.querySelector('.tag-filter'); + if (select && window.jQuery) { + $(select).val([...selectedTags, tag]).trigger('chosen:updated'); + } + } + evt.preventDefault(); + evt.stopPropagation(); + return false; + }} + > + {tag} + + ))} +
+ ); + return ( +
+ + + {galleryItems.map((item, index) => ( + + {imageFunc(item)} +
{item.title}
+

{item.description || item.title}

+ +
+ ))} +
+
+ ); +}; diff --git a/website/snippets/data/gallery.json b/website/snippets/data/GalleryItems.mdx similarity index 99% rename from website/snippets/data/gallery.json rename to website/snippets/data/GalleryItems.mdx index 02e9e5cdd6..f6ea6f2c78 100644 --- a/website/snippets/data/gallery.json +++ b/website/snippets/data/GalleryItems.mdx @@ -1,4 +1,4 @@ -[ +export const galleryItems = [ { "title": "AutoTx - Crypto Transactions Agent", "link": "https://www.agentcoin.org/blog/autotx", From c421ff0e91ae02cb78aca3074587817ddde299d6 Mon Sep 17 00:00:00 2001 From: Harish Mohan Raj Date: Mon, 16 Dec 2024 15:35:39 +0000 Subject: [PATCH 3/8] WIP: Add examples page --- website/mint-app-gallery-deps.js | 9 +++++---- website/snippets/components/GalleryPage.mdx | 16 +++++++--------- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/website/mint-app-gallery-deps.js b/website/mint-app-gallery-deps.js index 01390d9827..21d0d2b017 100644 --- a/website/mint-app-gallery-deps.js +++ b/website/mint-app-gallery-deps.js @@ -36,10 +36,11 @@ function initializeGallerySelect() { }) .on("change", function (evt, params) { const selectedValues = $(this).val() || []; - // Create and dispatch a custom event - const changeEvent = new Event("change"); - evt.target.selectedValues = selectedValues; - evt.target.dispatchEvent(changeEvent); + // Dispatch custom event with selected values + const customEvent = new CustomEvent("gallery:tagChange", { + detail: selectedValues, + }); + document.dispatchEvent(customEvent); }); }, 500); } diff --git a/website/snippets/components/GalleryPage.mdx b/website/snippets/components/GalleryPage.mdx index b3ed1bcd86..ed785f49ac 100644 --- a/website/snippets/components/GalleryPage.mdx +++ b/website/snippets/components/GalleryPage.mdx @@ -4,6 +4,10 @@ export const GalleryPage = ({ target = "_blank", }) => { + document.addEventListener('gallery:tagChange', (event) => { + handleTagChange(event.detail); + }); + let selectedTags = []; const defaultImageIfNoImage = allowDefaultImage ?? true; @@ -37,9 +41,9 @@ export const GalleryPage = ({ }; const handleTagChange = (tags) => { - selectedTags = tags; - filterItems(); - }; + selectedTags = tags; + filterItems(); + }; const filterItems = () => { const cards = document.querySelectorAll('.examples-gallery-container .card'); @@ -53,11 +57,6 @@ export const GalleryPage = ({ }); }; - const handleSelectChange = (event) => { - const selectedOptions = event.target.selectedValues || Array.from(event.target.selectedOptions).map(option => option.value); - handleTagChange(selectedOptions); - }; - const TagsView = ({ tags }) => (
{tags?.map((tag, index) => ( @@ -88,7 +87,6 @@ export const GalleryPage = ({ {galleryItems.map((item, index) => ( - + {imageFunc(item)}
{item.title}
+ {badges(item)}

{item.description || item.title}

From 8effe1be8d2f825c47dc0e0cab028e58fc3b53ce Mon Sep 17 00:00:00 2001 From: Harish Mohan Raj Date: Mon, 16 Dec 2024 22:30:03 +0000 Subject: [PATCH 8/8] Add notebooks section --- notebook/agentchat_custom_model.ipynb | 2 +- website/.gitignore | 2 +- website/{examples => docs}/Examples.mdx | 0 website/{examples => docs}/Gallery.mdx | 0 website/docs/Notebooks.mdx | 15 + website/docs/notebooks.mdx | 15 - website/mint-app-gallery-deps.js | 2 +- website/mint-style.css | 3 + website/mint.json | 93 +- website/process_notebooks.py | 135 ++- website/snippets/components/GalleryPage.mdx | 2 +- website/snippets/data/NotebooksMetadata.mdx | 901 ++++++++++++++++++++ 12 files changed, 1143 insertions(+), 27 deletions(-) rename website/{examples => docs}/Examples.mdx (100%) rename website/{examples => docs}/Gallery.mdx (100%) create mode 100644 website/docs/Notebooks.mdx delete mode 100644 website/docs/notebooks.mdx create mode 100644 website/snippets/data/NotebooksMetadata.mdx diff --git a/notebook/agentchat_custom_model.ipynb b/notebook/agentchat_custom_model.ipynb index 354f1c2556..101c4b64a6 100644 --- a/notebook/agentchat_custom_model.ipynb +++ b/notebook/agentchat_custom_model.ipynb @@ -441,7 +441,7 @@ ], "metadata": { "front_matter": { - "description": "Define and laod a custom model", + "description": "Define and load a custom model", "tags": [ "integration", "custom model" diff --git a/website/.gitignore b/website/.gitignore index 21fd07b316..9cd41d9a23 100644 --- a/website/.gitignore +++ b/website/.gitignore @@ -9,7 +9,7 @@ package-lock.json .docusaurus .cache-loader docs/reference -/docs/notebooks +/notebooks docs/tutorial/*.mdx docs/tutorial/**/*.png diff --git a/website/examples/Examples.mdx b/website/docs/Examples.mdx similarity index 100% rename from website/examples/Examples.mdx rename to website/docs/Examples.mdx diff --git a/website/examples/Gallery.mdx b/website/docs/Gallery.mdx similarity index 100% rename from website/examples/Gallery.mdx rename to website/docs/Gallery.mdx diff --git a/website/docs/Notebooks.mdx b/website/docs/Notebooks.mdx new file mode 100644 index 0000000000..3a412eb16e --- /dev/null +++ b/website/docs/Notebooks.mdx @@ -0,0 +1,15 @@ +--- +title: Notebooks +mode: "wide" +--- + +import { GalleryPage } from '/snippets/components/GalleryPage.mdx'; +import { ClientSideComponent } from "/snippets/components/ClientSideComponent.mdx"; +import { notebooksMetadata } from "/snippets/data/NotebooksMetadata.mdx"; + +This page contains a collection of notebooks that demonstrate how to use +AutoGen. The notebooks are tagged with the topics they cover. +For example, a notebook that demonstrates how to use function calling will +be tagged with `tool/function`. + + diff --git a/website/docs/notebooks.mdx b/website/docs/notebooks.mdx deleted file mode 100644 index 447cc8d5a0..0000000000 --- a/website/docs/notebooks.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_table_of_contents: true ---- - -import {findAllNotebooks} from '../src/components/NotebookUtils'; -import GalleryPage from '/snippets/components/GalleryPage.mdx'; - -# Notebooks - -This page contains a collection of notebooks that demonstrate how to use -AutoGen. The notebooks are tagged with the topics they cover. -For example, a notebook that demonstrates how to use function calling will -be tagged with `tool/function`. - - diff --git a/website/mint-app-gallery-deps.js b/website/mint-app-gallery-deps.js index dcc08bde46..f7ad0834d8 100644 --- a/website/mint-app-gallery-deps.js +++ b/website/mint-app-gallery-deps.js @@ -86,7 +86,7 @@ const debouncedInitialize = debounce(initializeGallerySelect, 100); // Watch for URL changes using MutationObserver const observer = new MutationObserver((mutations) => { - if (window.location.pathname.includes("/Gallery")) { + if (window.location.pathname.includes("/notebooks")) { debouncedInitialize(); } }); diff --git a/website/mint-style.css b/website/mint-style.css index 5ac7c4d31e..3b87609baf 100644 --- a/website/mint-style.css +++ b/website/mint-style.css @@ -211,6 +211,9 @@ h4 { font-size: 0.7rem; } +.examples-gallery-container .badges a{ + display: inline-block; +} .examples-gallery-container .tag:hover { background-color: #e0e0e0; } diff --git a/website/mint.json b/website/mint.json index 30ecc29fe9..542eba96f6 100644 --- a/website/mint.json +++ b/website/mint.json @@ -37,7 +37,7 @@ }, { "name": "Examples", - "url": "examples" + "url": "notebooks" }, { "name": "Community Talks", @@ -77,7 +77,9 @@ "pages": [ { "group": "OpenAI Assistant", - "pages": ["docs/topics/openai-assistant/gpt_assistant_agent"] + "pages": [ + "docs/topics/openai-assistant/gpt_assistant_agent" + ] }, { "group": "Using Non-OpenAI Models", @@ -164,8 +166,91 @@ { "group": "Examples", "pages": [ - "examples/Examples", - "examples/Gallery" + "notebooks/Examples", + "notebooks/Gallery", + { + "group": "Notebooks", + "pages": [ + "/notebooks/Notebooks", + "/notebooks/agentchat_RetrieveChat_mongodb", + "/notebooks/agentchat_RetrieveChat_pgvector", + "/notebooks/agentchat_RetrieveChat_qdrant", + "/notebooks/agentchat_agentops", + "/notebooks/agentchat_agentoptimizer", + "/notebooks/agentchat_auto_feedback_from_code_execution", + "/notebooks/agentchat_azr_ai_search", + "/notebooks/agentchat_captainagent", + "/notebooks/agentchat_cost_token_tracking", + "/notebooks/agentchat_custom_model", + "/notebooks/agentchat_dalle_and_gpt4v", + "/notebooks/agentchat_databricks_dbrx", + "/notebooks/agentchat_function_call", + "/notebooks/agentchat_function_call_async", + "/notebooks/agentchat_function_call_code_writing", + "/notebooks/agentchat_function_call_currency_calculator", + "/notebooks/agentchat_group_chat_with_llamaindex_agents", + "/notebooks/agentchat_groupchat", + "/notebooks/agentchat_groupchat_RAG", + "/notebooks/agentchat_groupchat_customized", + "/notebooks/agentchat_groupchat_finite_state_machine", + "/notebooks/agentchat_groupchat_research", + "/notebooks/agentchat_groupchat_stateflow", + "/notebooks/agentchat_groupchat_vis", + "/notebooks/agentchat_guidance", + "/notebooks/agentchat_human_feedback", + "/notebooks/agentchat_image_generation_capability", + "/notebooks/agentchat_inception_function", + "/notebooks/agentchat_langchain", + "/notebooks/agentchat_lmm_gpt-4v", + "/notebooks/agentchat_lmm_llava", + "/notebooks/agentchat_logging", + "/notebooks/agentchat_with_memory", + "/notebooks/agentchat_multi_task_async_chats", + "/notebooks/agentchat_multi_task_chats", + "/notebooks/agentchat_nested_chats_chess", + "/notebooks/agentchat_nested_chats_chess_altmodels", + "/notebooks/agentchat_nested_sequential_chats", + "/notebooks/agentchat_nestedchat", + "/notebooks/agentchat_nestedchat_optiguide", + "/notebooks/agentchat_oai_assistant_function_call", + "/notebooks/agentchat_oai_assistant_groupchat", + "/notebooks/agentchat_oai_assistant_retrieval", + "/notebooks/agentchat_oai_assistant_twoagents_basic", + "/notebooks/agentchat_oai_code_interpreter", + "/notebooks/agentchat_openlit", + "/notebooks/agentchat_planning", + "/notebooks/agentchat_reasoning_agent", + "/notebooks/agentchat_society_of_mind", + "/notebooks/agentchat_sql_spider", + "/notebooks/agentchat_stream", + "/notebooks/agentchat_structured_outputs", + "/notebooks/agentchat_surfer", + "/notebooks/agentchat_swarm", + "/notebooks/agentchat_swarm_graphrag_telemetry_trip_planner", + "/notebooks/agentchat_swarm_graphrag_trip_planner", + "/notebooks/agentchat_swarm_w_groupchat_legacy", + "/notebooks/agentchat_teachability", + "/notebooks/agentchat_teachable_oai_assistants", + "/notebooks/agentchat_teaching", + "/notebooks/agentchat_transform_messages", + "/notebooks/agentchat_two_users", + "/notebooks/agentchat_video_transcript_translate_with_whisper", + "/notebooks/agentchat_web_info", + "/notebooks/agentchat_webscraping_with_apify", + "/notebooks/agentchat_websockets", + "/notebooks/agentchats_sequential_chats", + "/notebooks/agenteval_cq_math", + "/notebooks/async_human_input", + "/notebooks/autobuild_agent_library", + "/notebooks/autobuild_basic", + "/notebooks/autogen_uniformed_api_calling", + "/notebooks/gpt_assistant_agent_function_call", + "/notebooks/lats_search", + "/docs/notebooks/tool-use", + "/notebooks/JSON_mode_example", + "/notebooks/agentchat_RetrieveChat" + ] + } ] } ], diff --git a/website/process_notebooks.py b/website/process_notebooks.py index 05f199b37c..ba45051a1b 100755 --- a/website/process_notebooks.py +++ b/website/process_notebooks.py @@ -23,7 +23,7 @@ from dataclasses import dataclass from multiprocessing import current_process from pathlib import Path -from typing import Dict, Optional, Tuple, Union +from typing import Dict, List, Optional, Tuple, Union from termcolor import colored @@ -77,7 +77,7 @@ def check_quarto_bin(quarto_bin: str = "quarto") -> None: def notebooks_target_dir(website_directory: Path) -> Path: """Return the target directory for notebooks.""" - return website_directory / "docs" / "notebooks" + return website_directory / "notebooks" def load_metadata(notebook: Path) -> typing.Dict: @@ -230,7 +230,7 @@ def process_notebook(src_notebook: Path, website_dir: Path, notebook_dir: Path, src_notebook, f"Failed to render {src_notebook}\n\nstderr:\n{result.stderr}\nstdout:\n{result.stdout}" ) - post_process_mdx(target_file, src_notebook, front_matter) + post_process_mdx(target_file, src_notebook, front_matter, website_dir) return fmt_ok(src_notebook) @@ -316,8 +316,49 @@ def get_error_info(nb: NotebookNode) -> Optional[NotebookError]: return None +def add_front_matter_to_metadata_mdx( + front_matter: Dict[str, Union[str, List[str]]], website_dir: Path, rendered_mdx: Path +) -> None: + metadata_mdx = website_dir / "snippets" / "data" / "NotebooksMetadata.mdx" + + metadata = [] + if metadata_mdx.exists(): + with open(metadata_mdx, "r", encoding="utf-8") as f: + content = f.read() + if content: + start = content.find("export const notebooksMetadata = [") + end = content.rfind("]") + if start != -1 and end != -1: + metadata = json.loads(content[start + 32 : end + 1]) + + # Create new entry for current notebook + entry = { + "title": front_matter.get("title", ""), + "link": f"/notebooks/{rendered_mdx.stem}", + "description": front_matter.get("description", ""), + "image": front_matter.get("image"), + "tags": front_matter.get("tags", []), + "source": front_matter.get("source_notebook"), + } + # Update metadata list + existing_entry = next((item for item in metadata if item["title"] == entry["title"]), None) + if existing_entry: + metadata[metadata.index(existing_entry)] = entry + else: + metadata.append(entry) + + # Write metadata back to file + with open(metadata_mdx, "w", encoding="utf-8") as f: + f.write( + "{/*\nAuto-generated file - DO NOT EDIT\nPlease edit the add_front_matter_to_metadata_mdx function in process_notebooks.py\n*/}\n\n" + ) + f.write("export const notebooksMetadata = ") + f.write(json.dumps(metadata, indent=4)) + f.write(";\n") + + # rendered_notebook is the final mdx file -def post_process_mdx(rendered_mdx: Path, source_notebooks: Path, front_matter: Dict) -> None: +def post_process_mdx(rendered_mdx: Path, source_notebooks: Path, front_matter: Dict, website_dir: Path) -> None: with open(rendered_mdx, "r", encoding="utf-8") as f: content = f.read() @@ -374,6 +415,9 @@ def post_process_mdx(rendered_mdx: Path, source_notebooks: Path, front_matter: D + content[title_end:] ) + # Create the front matter metadata js file for examples by notebook section + add_front_matter_to_metadata_mdx(front_matter, website_dir, rendered_mdx) + # Dump front_matter to ysaml front_matter = yaml.dump(front_matter, default_flow_style=False) @@ -430,6 +474,83 @@ def f() -> None: thread.start() +def copy_examples_mdx_files(website_dir: str) -> None: + # The mdx files to copy to the notebooks directory + example_section_mdx_files = ["Examples", "Gallery", "Notebooks"] + + # Create notebooks directory if it doesn't exist + website_dir = Path(website_dir) + notebooks_dir = website_dir / "notebooks" + notebooks_dir.mkdir(parents=True, exist_ok=True) + + for mdx_file in example_section_mdx_files: + src_mdx_file_path = (website_dir / "docs" / f"{mdx_file}.mdx").resolve() + dest_mdx_file_path = (notebooks_dir / f"{mdx_file}.mdx").resolve() + # Copy mdx file to notebooks directory + shutil.copy(src_mdx_file_path, dest_mdx_file_path) + + +def update_navigation_with_notebooks(website_dir: Path) -> None: + """ + Updates mint.json navigation to include notebook entries from NotebooksMetadata.mdx. + + Args: + website_dir (Path): Root directory of the website + """ + mint_json_path = (website_dir / "mint.json").resolve() + metadata_path = (website_dir / "snippets" / "data" / "NotebooksMetadata.mdx").resolve() + + if not mint_json_path.exists(): + print(f"mint.json not found at {mint_json_path}") + return + + if not metadata_path.exists(): + print(f"NotebooksMetadata.mdx not found at {metadata_path}") + return + + # Read mint.json + with open(mint_json_path, "r", encoding="utf-8") as f: + mint_config = json.load(f) + + # Read NotebooksMetadata.mdx and extract metadata links + with open(metadata_path, "r", encoding="utf-8") as f: + content = f.read() + # Extract the array between the brackets + start = content.find("export const notebooksMetadata = [") + end = content.rfind("]") + if start == -1 or end == -1: + print("Could not find notebooksMetadata in the file") + return + metadata_str = content[start + 32 : end + 1] + notebooks_metadata = json.loads(metadata_str) + + # Find the Examples group in navigation + examples_group = None + for group in mint_config["navigation"]: + if group.get("group") == "Examples": + examples_group = group + break + + if examples_group is None: + print("Examples group not found in navigation") + return + + # Create notebooks entry + notebooks_entry = { + "group": "Notebooks", + "pages": ["/notebooks/Notebooks"] + [item["link"] for item in notebooks_metadata], + } + + # Replace the pages list in Examples group with our standard pages plus notebooks + examples_group["pages"] = ["notebooks/Examples", "notebooks/Gallery", notebooks_entry] + + # Write back to mint.json + with open(mint_json_path, "w", encoding="utf-8") as f: + json.dump(mint_config, f, indent=2) + + print(f"Updated navigation in {mint_json_path}") + + def main() -> None: script_dir = Path(__file__).parent.absolute() parser = argparse.ArgumentParser() @@ -519,6 +640,12 @@ def main() -> None: notebook, args.website_directory, args.notebook_directory, args.quarto_bin, args.dry_run ) ) + + # Post-processing steps after all notebooks are handled + if not args.dry_run: + copy_examples_mdx_files(args.website_directory) + update_navigation_with_notebooks(args.website_directory) + else: print("Unknown subcommand") sys.exit(1) diff --git a/website/snippets/components/GalleryPage.mdx b/website/snippets/components/GalleryPage.mdx index 7c097be832..7d413a36e0 100644 --- a/website/snippets/components/GalleryPage.mdx +++ b/website/snippets/components/GalleryPage.mdx @@ -120,7 +120,7 @@ export const GalleryPage = ({ } const colab_href = `https://colab.research.google.com/github/ag2ai/ag2/blob/main/${item.source}`; const github_href = `https://github.com/ag2ai/ag2/blob/main/${item.source}`; - return ( + return ( Open In Colab Static Badge diff --git a/website/snippets/data/NotebooksMetadata.mdx b/website/snippets/data/NotebooksMetadata.mdx new file mode 100644 index 0000000000..db614a1817 --- /dev/null +++ b/website/snippets/data/NotebooksMetadata.mdx @@ -0,0 +1,901 @@ +{/* +Auto-generated file - DO NOT EDIT +Please edit the add_front_matter_to_metadata_mdx function in process_notebooks.py +*/} + +export const notebooksMetadata = [ + { + "title": "Using RetrieveChat Powered by MongoDB Atlas for Retrieve Augmented Code Generation and Question Answering", + "link": "/notebooks/agentchat_RetrieveChat_mongodb", + "description": "Explore the use of AutoGen's RetrieveChat for tasks like code generation from docstrings, answering complex questions with human feedback, and exploiting features like Update Context, custom prompts, and few-shot learning.", + "image": null, + "tags": [ + "MongoDB", + "integration", + "RAG" + ], + "source": "/notebook/agentchat_RetrieveChat_mongodb.ipynb" + }, + { + "title": "Using RetrieveChat Powered by PGVector for Retrieve Augmented Code Generation and Question Answering", + "link": "/notebooks/agentchat_RetrieveChat_pgvector", + "description": "Explore the use of AutoGen's RetrieveChat for tasks like code generation from docstrings, answering complex questions with human feedback, and exploiting features like Update Context, custom prompts, and few-shot learning.", + "image": null, + "tags": [ + "PGVector", + "integration", + "RAG" + ], + "source": "/notebook/agentchat_RetrieveChat_pgvector.ipynb" + }, + { + "title": "Using RetrieveChat with Qdrant for Retrieve Augmented Code Generation and Question Answering", + "link": "/notebooks/agentchat_RetrieveChat_qdrant", + "description": "This notebook demonstrates the usage of QdrantRetrieveUserProxyAgent for RAG.", + "image": null, + "tags": [ + "Qdrant", + "integration", + "RAG" + ], + "source": "/notebook/agentchat_RetrieveChat_qdrant.ipynb" + }, + { + "title": "Agent Tracking with AgentOps", + "link": "/notebooks/agentchat_agentops", + "description": "Use AgentOps to simplify the development process and monitor your agents in production.", + "image": null, + "tags": [ + "integration", + "monitoring", + "debugging" + ], + "source": "/notebook/agentchat_agentops.ipynb" + }, + { + "title": "AgentOptimizer: An Agentic Way to Train Your LLM Agent", + "link": "/notebooks/agentchat_agentoptimizer", + "description": "AgentOptimizer is able to prompt LLMs to iteratively optimize function/skills of AutoGen agents according to the historical conversation and performance.", + "image": null, + "tags": [ + "optimization", + "tool/function" + ], + "source": "/notebook/agentchat_agentoptimizer.ipynb" + }, + { + "title": "Task Solving with Code Generation, Execution and Debugging", + "link": "/notebooks/agentchat_auto_feedback_from_code_execution", + "description": "Use conversable language learning model agents to solve tasks and provide automatic feedback through a comprehensive example of writing, executing, and debugging Python code to compare stock price changes.", + "image": null, + "tags": [ + "code generation" + ], + "source": "/notebook/agentchat_auto_feedback_from_code_execution.ipynb" + }, + { + "title": "Assistants with Azure Cognitive Search and Azure Identity", + "link": "/notebooks/agentchat_azr_ai_search", + "description": "This notebook demonstrates the use of Assistant Agents in conjunction with Azure Cognitive Search and Azure Identity", + "image": null, + "tags": [ + "integration", + "RAG", + "Azure Identity", + "Azure AI Search" + ], + "source": "/notebook/agentchat_azr_ai_search.ipynb" + }, + { + "title": "CaptainAgent", + "link": "/notebooks/agentchat_captainagent", + "description": "Introducing CaptainAgent, a powerful agent that can manage and orchestrate other agents and tools to solve complex tasks.", + "image": null, + "tags": [ + "autobuild", + "CaptainAgent" + ], + "source": "/notebook/agentchat_captainagent.ipynb" + }, + { + "title": "Usage tracking with AutoGen", + "link": "/notebooks/agentchat_cost_token_tracking", + "description": "cost calculation", + "image": null, + "tags": [ + "cost" + ], + "source": "/notebook/agentchat_cost_token_tracking.ipynb" + }, + { + "title": "Agent Chat with custom model loading", + "link": "/notebooks/agentchat_custom_model", + "description": "Define and load a custom model", + "image": null, + "tags": [ + "integration", + "custom model" + ], + "source": "/notebook/agentchat_custom_model.ipynb" + }, + { + "title": "Agent Chat with Multimodal Models: DALLE and GPT-4V", + "link": "/notebooks/agentchat_dalle_and_gpt4v", + "description": "Multimodal agent chat with DALL-E and GPT-4v.", + "image": null, + "tags": [ + "multimodal", + "gpt-4v" + ], + "source": "/notebook/agentchat_dalle_and_gpt4v.ipynb" + }, + { + "title": "Use AutoGen in Databricks with DBRX", + "link": "/notebooks/agentchat_databricks_dbrx", + "description": "Use Databricks DBRX and Foundation Model APIs to build AutoGen applications backed by open-source LLMs.", + "image": null, + "tags": [ + "integration", + "code generation", + "dbrx", + "databricks", + "open source", + "lakehouse", + "custom model", + "data intelligence" + ], + "source": "/notebook/agentchat_databricks_dbrx.ipynb" + }, + { + "title": "Auto Generated Agent Chat: Task Solving with Provided Tools as Functions", + "link": "/notebooks/agentchat_function_call", + "description": "Register function calls using AssistantAgent and UserProxyAgent to execute python or shell code in customized ways. Demonstrating two ways of registering functions.", + "image": null, + "tags": [ + "code generation", + "tool/function" + ], + "source": "/notebook/agentchat_function_call.ipynb" + }, + { + "title": "Task Solving with Provided Tools as Functions (Asynchronous Function Calls)", + "link": "/notebooks/agentchat_function_call_async", + "description": "Learn how to implement both synchronous and asynchronous function calls using AssistantAgent and UserProxyAgent in AutoGen, with examples of their application in individual and group chat settings for task execution with language models.", + "image": null, + "tags": [ + "tool/function", + "async" + ], + "source": "/notebook/agentchat_function_call_async.ipynb" + }, + { + "title": "Writing a software application using function calls", + "link": "/notebooks/agentchat_function_call_code_writing", + "description": "Equip your agent with functions that can efficiently implement features into your software application.", + "image": null, + "tags": [ + "code generation", + "tool/function", + "fastapi", + "software engineering" + ], + "source": "/notebook/agentchat_function_call_code_writing.ipynb" + }, + { + "title": "Currency Calculator: Task Solving with Provided Tools as Functions", + "link": "/notebooks/agentchat_function_call_currency_calculator", + "description": "Learn how to register function calls using AssistantAgent and UserProxyAgent.", + "image": null, + "tags": [ + "tool/function" + ], + "source": "/notebook/agentchat_function_call_currency_calculator.ipynb" + }, + { + "title": "Groupchat with Llamaindex agents", + "link": "/notebooks/agentchat_group_chat_with_llamaindex_agents", + "description": "Integrate llamaindex agents with Autogen.", + "image": null, + "tags": [ + "react", + "llamaindex", + "integration", + "group chat", + "software engineering" + ], + "source": "/notebook/agentchat_group_chat_with_llamaindex_agents.ipynb" + }, + { + "title": "Group Chat", + "link": "/notebooks/agentchat_groupchat", + "description": "Explore the utilization of large language models in automated group chat scenarios, where agents perform tasks collectively, demonstrating how they can be configured, interact with each other, and retrieve specific information from external resources.", + "image": null, + "tags": [ + "orchestration", + "group chat", + "code generation" + ], + "source": "/notebook/agentchat_groupchat.ipynb" + }, + { + "title": "Group Chat with Retrieval Augmented Generation", + "link": "/notebooks/agentchat_groupchat_RAG", + "description": "Implement and manage a multi-agent chat system using AutoGen, where AI assistants retrieve information, generate code, and interact collaboratively to solve complex tasks, especially in areas not covered by their training data.", + "image": null, + "tags": [ + "group chat", + "orchestration", + "RAG" + ], + "source": "/notebook/agentchat_groupchat_RAG.ipynb" + }, + { + "title": "Group Chat with Customized Speaker Selection Method", + "link": "/notebooks/agentchat_groupchat_customized", + "description": "Introduce group chat with customized speaker selection method.", + "image": null, + "tags": [ + "orchestration", + "group chat" + ], + "source": "/notebook/agentchat_groupchat_customized.ipynb" + }, + { + "title": "FSM - User can input speaker transition constraints", + "link": "/notebooks/agentchat_groupchat_finite_state_machine", + "description": "Explore the demonstration of the Finite State Machine implementation, which allows the user to input speaker transition constraints.", + "image": null, + "tags": [ + "group chat", + "fsm", + "orchestration" + ], + "source": "/notebook/agentchat_groupchat_finite_state_machine.ipynb" + }, + { + "title": "Perform Research with Multi-Agent Group Chat", + "link": "/notebooks/agentchat_groupchat_research", + "description": "Perform research using a group chat with a number of specialized agents.", + "image": null, + "tags": [ + "group chat", + "planning", + "code generation" + ], + "source": "/notebook/agentchat_groupchat_research.ipynb" + }, + { + "title": "StateFlow: Build Workflows through State-Oriented Actions", + "link": "/notebooks/agentchat_groupchat_stateflow", + "description": "StateFlow: Build workflows through state-oriented actions.", + "image": null, + "tags": [ + "orchestration", + "group chat", + "stateflow", + "research" + ], + "source": "/notebook/agentchat_groupchat_stateflow.ipynb" + }, + { + "title": "Group Chat with Coder and Visualization Critic", + "link": "/notebooks/agentchat_groupchat_vis", + "description": "Explore a group chat example using agents such as a coder and visualization agent.", + "image": null, + "tags": [ + "group chat", + "code generation" + ], + "source": "/notebook/agentchat_groupchat_vis.ipynb" + }, + { + "title": "Using Guidance with AutoGen", + "link": "/notebooks/agentchat_guidance", + "description": "Constrained responses via guidance.", + "image": null, + "tags": [ + "guidance", + "integration", + "JSON" + ], + "source": "/notebook/agentchat_guidance.ipynb" + }, + { + "title": "Auto Generated Agent Chat: Task Solving with Code Generation, Execution, Debugging & Human Feedback", + "link": "/notebooks/agentchat_human_feedback", + "description": "Code generation, execution, debugging and human feedback.", + "image": null, + "tags": [ + "human", + "code generation" + ], + "source": "/notebook/agentchat_human_feedback.ipynb" + }, + { + "title": "Generate Dalle Images With Conversable Agents", + "link": "/notebooks/agentchat_image_generation_capability", + "description": "Generate images with conversable agents.", + "image": null, + "tags": [ + "capability", + "multimodal" + ], + "source": "/notebook/agentchat_image_generation_capability.ipynb" + }, + { + "title": "Auto Generated Agent Chat: Function Inception", + "link": "/notebooks/agentchat_inception_function", + "description": "Function Inception: Enable AutoGen agents to update/remove functions during conversations.", + "image": null, + "tags": [ + "function inception", + "tool/function" + ], + "source": "/notebook/agentchat_inception_function.ipynb" + }, + { + "title": "Auto Generated Agent Chat: Task Solving with Langchain Provided Tools as Functions", + "link": "/notebooks/agentchat_langchain", + "description": "Use Langchain tools.", + "image": null, + "tags": [ + "langchain", + "integration", + "tool/function" + ], + "source": "/notebook/agentchat_langchain.ipynb" + }, + { + "title": "Engaging with Multimodal Models: GPT-4V in AutoGen", + "link": "/notebooks/agentchat_lmm_gpt-4v", + "description": "Leveraging multimodal models through two different methodologies: MultimodalConversableAgent and VisionCapability.", + "image": null, + "tags": [ + "multimodal", + "gpt-4v" + ], + "source": "/notebook/agentchat_lmm_gpt-4v.ipynb" + }, + { + "title": "Agent Chat with Multimodal Models: LLaVA", + "link": "/notebooks/agentchat_lmm_llava", + "description": "Leveraging multimodal models like llava.", + "image": null, + "tags": [ + "multimodal", + "llava" + ], + "source": "/notebook/agentchat_lmm_llava.ipynb" + }, + { + "title": "Runtime Logging with AutoGen", + "link": "/notebooks/agentchat_logging", + "description": "Provide capabilities of runtime logging for debugging and performance analysis.", + "image": null, + "tags": [ + "logging", + "debugging" + ], + "source": "/notebook/agentchat_logging.ipynb" + }, + { + "title": "Agent with memory using Mem0", + "link": "/notebooks/agentchat_with_memory", + "description": "Use Mem0 to create agents with memory.", + "image": null, + "tags": [ + "mem0", + "integration", + "memory" + ], + "source": "/notebook/agentchat_with_memory.ipynb" + }, + { + "title": "Solving Multiple Tasks in a Sequence of Async Chats", + "link": "/notebooks/agentchat_multi_task_async_chats", + "description": "Use conversational agents to solve a set of tasks with a sequence of async chats.", + "image": null, + "tags": [ + "orchestration", + "async", + "sequential chats" + ], + "source": "/notebook/agentchat_multi_task_async_chats.ipynb" + }, + { + "title": "Solving Multiple Tasks in a Sequence of Chats", + "link": "/notebooks/agentchat_multi_task_chats", + "description": "Use conversational agents to solve a set of tasks with a sequence of chats.", + "image": null, + "tags": [ + "orchestration", + "sequential chats" + ], + "source": "/notebook/agentchat_multi_task_chats.ipynb" + }, + { + "title": "Nested Chats for Tool Use in Conversational Chess", + "link": "/notebooks/agentchat_nested_chats_chess", + "description": "LLM-backed agents playing chess with each other using nested chats.", + "image": null, + "tags": [ + "nested chat", + "tool/function", + "orchestration" + ], + "source": "/notebook/agentchat_nested_chats_chess.ipynb" + }, + { + "title": "Conversational Chess using non-OpenAI clients", + "link": "/notebooks/agentchat_nested_chats_chess_altmodels", + "description": "LLM-backed agents playing chess with each other using nested chats.", + "image": null, + "tags": [ + "nested chat", + "tool/function", + "orchestration" + ], + "source": "/notebook/agentchat_nested_chats_chess_altmodels.ipynb" + }, + { + "title": "Solving Complex Tasks with A Sequence of Nested Chats", + "link": "/notebooks/agentchat_nested_sequential_chats", + "description": "Solve complex tasks with one or more sequence chats nested as inner monologue.", + "image": null, + "tags": [ + "nested chat", + "sequential chats", + "orchestration" + ], + "source": "/notebook/agentchat_nested_sequential_chats.ipynb" + }, + { + "title": "Solving Complex Tasks with Nested Chats", + "link": "/notebooks/agentchat_nestedchat", + "description": "Solve complex tasks with a chat nested as inner monologue.", + "image": null, + "tags": [ + "nested chat", + "reflection", + "reasoning", + "orchestration" + ], + "source": "/notebook/agentchat_nestedchat.ipynb" + }, + { + "title": "OptiGuide with Nested Chats in AutoGen", + "link": "/notebooks/agentchat_nestedchat_optiguide", + "description": "This is a nested chat re-implementation of OptiGuide which is an LLM-based supply chain optimization framework.", + "image": null, + "tags": [ + "nested chat", + "hierarchical chat", + "code generation", + "orchestration" + ], + "source": "/notebook/agentchat_nestedchat_optiguide.ipynb" + }, + { + "title": "Chat with OpenAI Assistant using function call in AutoGen: OSS Insights for Advanced GitHub Data Analysis", + "link": "/notebooks/agentchat_oai_assistant_function_call", + "description": "This Jupyter Notebook demonstrates how to leverage OSS Insight (Open Source Software Insight) for advanced GitHub data analysis by defining `Function calls` in AutoGen for the OpenAI Assistant.", + "image": null, + "tags": [ + "OpenAI Assistant", + "tool/function" + ], + "source": "/notebook/agentchat_oai_assistant_function_call.ipynb" + }, + { + "title": "Auto Generated Agent Chat: Group Chat with GPTAssistantAgent", + "link": "/notebooks/agentchat_oai_assistant_groupchat", + "description": "Use GPTAssistantAgent in group chat.", + "image": null, + "tags": [ + "OpenAI Assistant", + "group chat" + ], + "source": "/notebook/agentchat_oai_assistant_groupchat.ipynb" + }, + { + "title": "RAG OpenAI Assistants in AutoGen", + "link": "/notebooks/agentchat_oai_assistant_retrieval", + "description": "OpenAI Assistant with retrieval augmentation.", + "image": null, + "tags": [ + "RAG", + "OpenAI Assistant" + ], + "source": "/notebook/agentchat_oai_assistant_retrieval.ipynb" + }, + { + "title": "OpenAI Assistants in AutoGen", + "link": "/notebooks/agentchat_oai_assistant_twoagents_basic", + "description": "Two-agent chat with OpenAI assistants.", + "image": null, + "tags": [ + "OpenAI Assistant" + ], + "source": "/notebook/agentchat_oai_assistant_twoagents_basic.ipynb" + }, + { + "title": "Auto Generated Agent Chat: GPTAssistant with Code Interpreter", + "link": "/notebooks/agentchat_oai_code_interpreter", + "description": "This Jupyter Notebook showcases the integration of the Code Interpreter tool which executes Python code dynamically within applications.", + "image": null, + "tags": [ + "OpenAI Assistant", + "code interpreter" + ], + "source": "/notebook/agentchat_oai_code_interpreter.ipynb" + }, + { + "title": "Agent Observability with OpenLIT", + "link": "/notebooks/agentchat_openlit", + "description": "Use OpenLIT to easily monitor AI agents in production with OpenTelemetry.", + "image": null, + "tags": [ + "integration", + "monitoring", + "observability", + "debugging" + ], + "source": "/notebook/agentchat_openlit.ipynb" + }, + { + "title": "Auto Generated Agent Chat: Collaborative Task Solving with Coding and Planning Agent", + "link": "/notebooks/agentchat_planning", + "description": "Use planning agent in a function call.", + "image": null, + "tags": [ + "planning", + "orchestration", + "nested chat", + "tool/function" + ], + "source": "/notebook/agentchat_planning.ipynb" + }, + { + "title": "ReasoningAgent (Tree of Thoughts with Beam Search)", + "link": "/notebooks/agentchat_reasoning_agent", + "description": "Use ReasoningAgent for o1 style reasoning in Agentic workflows with LLMs using AG2", + "image": null, + "tags": [ + "reasoning agent", + "tree of thoughts" + ], + "source": "/notebook/agentchat_reasoning_agent.ipynb" + }, + { + "title": "SocietyOfMindAgent", + "link": "/notebooks/agentchat_society_of_mind", + "description": "Explore the demonstration of the SocietyOfMindAgent in the AutoGen library, which runs a group chat as an internal monologue, but appears to the external world as a single agent, offering a structured way to manage complex interactions among multiple agents and handle issues such as extracting responses from complex dialogues and dealing with context window constraints.", + "image": null, + "tags": [ + "orchestration", + "nested chat", + "group chat" + ], + "source": "/notebook/agentchat_society_of_mind.ipynb" + }, + { + "title": "SQL Agent for Spider text-to-SQL benchmark", + "link": "/notebooks/agentchat_sql_spider", + "description": "Natural language text to SQL query using the Spider text-to-SQL benchmark.", + "image": null, + "tags": [ + "SQL", + "tool/function" + ], + "source": "/notebook/agentchat_sql_spider.ipynb" + }, + { + "title": "Interactive LLM Agent Dealing with Data Stream", + "link": "/notebooks/agentchat_stream", + "description": "Automated continual learning from new data.", + "image": null, + "tags": [ + "streaming", + "async", + "learning" + ], + "source": "/notebook/agentchat_stream.ipynb" + }, + { + "title": "Structured output", + "link": "/notebooks/agentchat_structured_outputs", + "description": "OpenAI offers a functionality for defining a structure of the messages generated by LLMs, AutoGen enables this functionality by propagating response_format passed to your agents to the underlying client.", + "image": null, + "tags": [ + "structured output" + ], + "source": "/notebook/agentchat_structured_outputs.ipynb" + }, + { + "title": "WebSurferAgent", + "link": "/notebooks/agentchat_surfer", + "description": "Browse the web with agents.", + "image": null, + "tags": [ + "web", + "nested chat", + "tool/function" + ], + "source": "/notebook/agentchat_surfer.ipynb" + }, + { + "title": "Swarm Orchestration with AG2", + "link": "/notebooks/agentchat_swarm", + "description": "Swarm Ochestration", + "image": null, + "tags": [ + "orchestration", + "group chat", + "swarm" + ], + "source": "/notebook/agentchat_swarm.ipynb" + }, + { + "title": "Using a local Telemetry server to monitor a GraphRAG agent", + "link": "/notebooks/agentchat_swarm_graphrag_telemetry_trip_planner", + "description": "FalkorDB GraphRAG utilises a knowledge graph and can be added as a capability to agents. Together with a swarm orchestration of agents is highly effective at providing a RAG capability.", + "image": null, + "tags": [ + "RAG", + "tool/function", + "swarm" + ], + "source": "/notebook/agentchat_swarm_graphrag_telemetry_trip_planner.ipynb" + }, + { + "title": "Trip planning with a FalkorDB GraphRAG agent using a Swarm", + "link": "/notebooks/agentchat_swarm_graphrag_trip_planner", + "description": "FalkorDB GraphRAG utilises a knowledge graph and can be added as a capability to agents. Together with a swarm orchestration of agents is highly effective at providing a RAG capability.", + "image": null, + "tags": [ + "RAG", + "tool/function", + "swarm" + ], + "source": "/notebook/agentchat_swarm_graphrag_trip_planner.ipynb" + }, + { + "title": "(Legacy) Implement Swarm-style orchestration with GroupChat", + "link": "/notebooks/agentchat_swarm_w_groupchat_legacy", + "description": "(Legacy) Implement Swarm-style orchestration with GroupChat", + "image": null, + "tags": [ + "orchestration", + "group chat", + "stateflow", + "swarm" + ], + "source": "/notebook/agentchat_swarm_w_groupchat_legacy.ipynb" + }, + { + "title": "Chatting with a teachable agent", + "link": "/notebooks/agentchat_teachability", + "description": "Learn how to persist memories across chat sessions using the Teachability capability", + "image": null, + "tags": [ + "teachability", + "learning", + "RAG", + "capability" + ], + "source": "/notebook/agentchat_teachability.ipynb" + }, + { + "title": "Making OpenAI Assistants Teachable", + "link": "/notebooks/agentchat_teachable_oai_assistants", + "description": "Teach OpenAI assistants.", + "image": null, + "tags": [ + "teachability", + "capability", + "learning", + "RAG", + "OpenAI Assistant" + ], + "source": "/notebook/agentchat_teachable_oai_assistants.ipynb" + }, + { + "title": "Auto Generated Agent Chat: Teaching AI New Skills via Natural Language Interaction", + "link": "/notebooks/agentchat_teaching", + "description": "Teach the agent news skills using natural language.", + "image": null, + "tags": [ + "learning", + "teaching" + ], + "source": "/notebook/agentchat_teaching.ipynb" + }, + { + "title": "Preprocessing Chat History with `TransformMessages`", + "link": "/notebooks/agentchat_transform_messages", + "description": "Preprocessing chat history with `TransformMessages`", + "image": null, + "tags": [ + "long context handling", + "capability" + ], + "source": "/notebook/agentchat_transform_messages.ipynb" + }, + { + "title": "Auto Generated Agent Chat: Collaborative Task Solving with Multiple Agents and Human Users", + "link": "/notebooks/agentchat_two_users", + "description": "Involve multiple human users via function calls and nested chat.", + "image": null, + "tags": [ + "human", + "tool/function" + ], + "source": "/notebook/agentchat_two_users.ipynb" + }, + { + "title": "Translating Video audio using Whisper and GPT-3.5-turbo", + "link": "/notebooks/agentchat_video_transcript_translate_with_whisper", + "description": "Use tools to extract and translate the transcript of a video file.", + "image": null, + "tags": [ + "whisper", + "multimodal", + "tool/function" + ], + "source": "/notebook/agentchat_video_transcript_translate_with_whisper.ipynb" + }, + { + "title": "Auto Generated Agent Chat: Solving Tasks Requiring Web Info", + "link": "/notebooks/agentchat_web_info", + "description": "Solve tasks requiring web info.", + "image": null, + "tags": [ + "web", + "code generation" + ], + "source": "/notebook/agentchat_web_info.ipynb" + }, + { + "title": "Web Scraping using Apify Tools", + "link": "/notebooks/agentchat_webscraping_with_apify", + "description": "Scrapping web pages and summarizing the content using agents with tools.", + "image": null, + "tags": [ + "web", + "apify", + "integration", + "tool/function" + ], + "source": "/notebook/agentchat_webscraping_with_apify.ipynb" + }, + { + "title": "Websockets: Streaming input and output using websockets", + "link": "/notebooks/agentchat_websockets", + "description": "Websockets facilitate real-time, bidirectional communication between web clients and servers, enhancing the responsiveness and interactivity of AutoGen-powered applications.", + "image": null, + "tags": [ + "websockets", + "streaming" + ], + "source": "/notebook/agentchat_websockets.ipynb" + }, + { + "title": "Solving Multiple Tasks in a Sequence of Chats with Different Conversable Agent Pairs", + "link": "/notebooks/agentchats_sequential_chats", + "description": "Use AutoGen to solve a set of tasks with a sequence of chats.", + "image": null, + "tags": [ + "orchestration", + "sequential chats" + ], + "source": "/notebook/agentchats_sequential_chats.ipynb" + }, + { + "title": "Demonstrating the `AgentEval` framework using the task of solving math problems as an example", + "link": "/notebooks/agenteval_cq_math", + "description": "AgentEval: a multi-agent system for assessing utility of LLM-powered applications", + "image": null, + "tags": [ + "eval" + ], + "source": "/notebook/agenteval_cq_math.ipynb" + }, + { + "title": "Agent Chat with Async Human Inputs", + "link": "/notebooks/async_human_input", + "description": "Async human inputs.", + "image": null, + "tags": [ + "async", + "human" + ], + "source": "/notebook/async_human_input.ipynb" + }, + { + "title": "Automatically Build Multi-agent System from Agent Library", + "link": "/notebooks/autobuild_agent_library", + "description": "Automatically build multi-agent system from agent library", + "image": null, + "tags": [ + "autobuild" + ], + "source": "/notebook/autobuild_agent_library.ipynb" + }, + { + "title": "AutoBuild", + "link": "/notebooks/autobuild_basic", + "description": "Automatically build multi-agent system with AgentBuilder", + "image": null, + "tags": [ + "autobuild" + ], + "source": "/notebook/autobuild_basic.ipynb" + }, + { + "title": "A Uniform interface to call different LLMs", + "link": "/notebooks/autogen_uniformed_api_calling", + "description": "Uniform interface to call different LLM.", + "image": null, + "tags": [ + "integration", + "custom model" + ], + "source": "/notebook/autogen_uniformed_api_calling.ipynb" + }, + { + "title": "From Dad Jokes To Sad Jokes: Function Calling with GPTAssistantAgent", + "link": "/notebooks/gpt_assistant_agent_function_call", + "description": "Use tools in a GPTAssistantAgent Multi-Agent System by utilizing functions such as calling an API and writing to a file.", + "image": null, + "tags": [ + "OpenAI Assistant", + "tool/function" + ], + "source": "/notebook/gpt_assistant_agent_function_call.ipynb" + }, + { + "title": "Language Agent Tree Search", + "link": "/notebooks/lats_search", + "description": "Language Agent Tree Search.", + "image": null, + "tags": [ + "LATS", + "search", + "reasoning", + "reflection" + ], + "source": "/notebook/lats_search.ipynb" + }, + { + "title": "Tool Use", + "link": "/docs/notebooks/tool-use", + "description": "", + "image": null, + "tags": [], + "source": "/website/docs/tutorial/tool-use.ipynb" + }, + { + "title": "Mitigating Prompt hacking with JSON Mode in Autogen", + "link": "/notebooks/JSON_mode_example", + "description": "Use JSON mode and Agent Descriptions to mitigate prompt manipulation and control speaker transition.", + "image": null, + "tags": [ + "JSON", + "description", + "prompt hacking", + "group chat", + "orchestration" + ], + "source": "/notebook/JSON_mode_example.ipynb" + }, + { + "title": "Using RetrieveChat for Retrieve Augmented Code Generation and Question Answering", + "link": "/notebooks/agentchat_RetrieveChat", + "description": "Explore the use of AutoGen's RetrieveChat for tasks like code generation from docstrings, answering complex questions with human feedback, and exploiting features like Update Context, custom prompts, and few-shot learning.", + "image": null, + "tags": [ + "RAG" + ], + "source": "/notebook/agentchat_RetrieveChat.ipynb" + } +];