diff --git a/test/website/test_process_notebooks.py b/test/website/test_process_notebooks.py index 1644b26be..18cf4f104 100644 --- a/test/website/test_process_notebooks.py +++ b/test/website/test_process_notebooks.py @@ -14,6 +14,8 @@ sys.path.append(str(Path(__file__).resolve().parent.parent.parent / "website")) from process_notebooks import ( add_authors_and_social_img_to_blog_posts, + add_front_matter_to_metadata_mdx, + cleanup_tmp_dirs_if_no_metadata, convert_callout_blocks, ensure_mint_json_exists, extract_example_group, @@ -34,6 +36,171 @@ def test_ensure_mint_json(): ensure_mint_json_exists(tmp_path) # Should not raise any exception +def test_cleanup_tmp_dirs_if_no_metadata(): + # Test without the tmp_dir / "snippets" / "data" / "NotebooksMetadata.mdx" + # the tmp_dir / "notebooks" should be removed. + with tempfile.TemporaryDirectory() as tmp_dir: + tmp_path = Path(tmp_dir) + notebooks_dir = tmp_path / "notebooks" + notebooks_dir.mkdir(parents=True, exist_ok=True) + (notebooks_dir / "example-1.mdx").touch() + (notebooks_dir / "example-2.mdx").touch() + + cleanup_tmp_dirs_if_no_metadata(tmp_path) + assert not notebooks_dir.exists() + + # Test with the tmp_dir / "snippets" / "data" / "NotebooksMetadata.mdx" + # the tmp_dir / "notebooks" should not be removed. + with tempfile.TemporaryDirectory() as tmp_dir: + tmp_path = Path(tmp_dir) + + notebooks_dir = tmp_path / "notebooks" + notebooks_dir.mkdir(parents=True, exist_ok=True) + (notebooks_dir / "example-1.mdx").touch() + (notebooks_dir / "example-2.mdx").touch() + + metadata_dir = tmp_path / "snippets" / "data" + metadata_dir.mkdir(parents=True, exist_ok=True) + (metadata_dir / "NotebooksMetadata.mdx").touch() + + cleanup_tmp_dirs_if_no_metadata(tmp_path) + assert notebooks_dir.exists() + + +class TestAddFrontMatterToMetadataMdx: + def test_without_metadata_mdx(self): + front_matter_dict = { + "title": "some title", + "link": "/notebooks/some-title", + "description": "some description", + "image": "some image", + "tags": ["tag1", "tag2"], + "source_notebook": "/notebook/some-title.ipynb", + } + with tempfile.TemporaryDirectory() as tmp_dir: + tmp_path = Path(tmp_dir) + + metadata_dir = tmp_path / "snippets" / "data" + metadata_dir.mkdir(parents=True, exist_ok=True) + + rendered_mdx = tmp_path / "source" + rendered_mdx.mkdir(parents=True, exist_ok=True) + (rendered_mdx / "some-title.mdx").touch() + + # when the metadata file is not present, the file should be created and the front matter should be added + add_front_matter_to_metadata_mdx(front_matter_dict, tmp_path, rendered_mdx) + + assert (metadata_dir / "NotebooksMetadata.mdx").exists() + + with open(metadata_dir / "NotebooksMetadata.mdx", "r") as f: + actual = f.read() + + assert ( + actual + == """{/* +Auto-generated file - DO NOT EDIT +Please edit the add_front_matter_to_metadata_mdx function in process_notebooks.py +*/} + +export const notebooksMetadata = [ + { + "title": "some title", + "link": "/notebooks/source", + "description": "some description", + "image": "some image", + "tags": [ + "tag1", + "tag2" + ], + "source": "/notebook/some-title.ipynb" + } +]; +""" + ) + + def test_with_metadata_mdx(self): + front_matter_dict = { + "title": "some title", + "link": "/notebooks/some-title", + "description": "some description", + "image": "some image", + "tags": ["tag1", "tag2"], + "source_notebook": "/notebook/some-title.ipynb", + } + with tempfile.TemporaryDirectory() as tmp_dir: + tmp_path = Path(tmp_dir) + + metadata_dir = tmp_path / "snippets" / "data" + metadata_dir.mkdir(parents=True, exist_ok=True) + metadata_content = """{/* +Auto-generated file - DO NOT EDIT +Please edit the add_front_matter_to_metadata_mdx function in process_notebooks.py +*/} + +export const notebooksMetadata = [ + { + "title": "some other title", + "link": "/notebooks/some-other-title", + "description": "some other description", + "image": "some other image", + "tags": [ + "tag3", + "tag4" + ], + "source": "/notebook/some-other-title.ipynb" + } +]; +""" + with open(metadata_dir / "NotebooksMetadata.mdx", "w") as f: + f.write(metadata_content) + + rendered_mdx = tmp_path / "source" + rendered_mdx.mkdir(parents=True, exist_ok=True) + (rendered_mdx / "some-title.mdx").touch() + + # when the metadata file is present, the front matter should be added to the existing metadata + add_front_matter_to_metadata_mdx(front_matter_dict, tmp_path, rendered_mdx) + + assert (metadata_dir / "NotebooksMetadata.mdx").exists() + + with open(metadata_dir / "NotebooksMetadata.mdx", "r") as f: + actual = f.read() + + assert ( + actual + == """{/* +Auto-generated file - DO NOT EDIT +Please edit the add_front_matter_to_metadata_mdx function in process_notebooks.py +*/} + +export const notebooksMetadata = [ + { + "title": "some other title", + "link": "/notebooks/some-other-title", + "description": "some other description", + "image": "some other image", + "tags": [ + "tag3", + "tag4" + ], + "source": "/notebook/some-other-title.ipynb" + }, + { + "title": "some title", + "link": "/notebooks/source", + "description": "some description", + "image": "some image", + "tags": [ + "tag1", + "tag2" + ], + "source": "/notebook/some-title.ipynb" + } +]; +""" + ) + + class TestAddBlogsToNavigation: @pytest.fixture def test_dir(self): diff --git a/website/.gitignore b/website/.gitignore index f50e629db..2ff9bb477 100644 --- a/website/.gitignore +++ b/website/.gitignore @@ -11,6 +11,7 @@ docs/reference /notebooks /blog mint.json +/snippets/data/NotebooksMetadata.mdx docs/tutorial/*.mdx docs/tutorial/**/*.png diff --git a/website/process_notebooks.py b/website/process_notebooks.py index 56f850e83..41f6a312c 100755 --- a/website/process_notebooks.py +++ b/website/process_notebooks.py @@ -321,15 +321,21 @@ def add_front_matter_to_metadata_mdx( metadata_mdx = website_dir / "snippets" / "data" / "NotebooksMetadata.mdx" + if not metadata_mdx.exists(): + 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 = [];\n") + metadata = [] - if metadata_mdx.exists(): - with open(metadata_mdx, 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]) + with open(metadata_mdx, 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 = { @@ -899,6 +905,21 @@ def ensure_mint_json_exists(website_dir: Path) -> None: sys.exit(1) +def cleanup_tmp_dirs_if_no_metadata(website_dir: Path) -> None: + """Remove the temporary notebooks directory if NotebooksMetadata.mdx is not found. + + This is to ensure a clean build and generate the metadata file as well as to + update the navigation with correct entries. + """ + metadata_mdx = website_dir / "snippets" / "data" / "NotebooksMetadata.mdx" + if not metadata_mdx.exists(): + print(f"NotebooksMetadata.mdx not found at {metadata_mdx}") + + notebooks_dir = website_dir / "notebooks" + print(f"Removing the {notebooks_dir} and to ensure a clean build.") + shutil.rmtree(notebooks_dir, ignore_errors=True) + + def main() -> None: script_dir = Path(__file__).parent.absolute() parser = argparse.ArgumentParser() @@ -929,6 +950,7 @@ def main() -> None: sys.exit(1) ensure_mint_json_exists(args.website_directory) + cleanup_tmp_dirs_if_no_metadata(args.website_directory) if args.notebooks: collected_notebooks = args.notebooks diff --git a/website/snippets/data/NotebooksMetadata.mdx b/website/snippets/data/NotebooksMetadata.mdx deleted file mode 100644 index 6ace92fb1..000000000 --- a/website/snippets/data/NotebooksMetadata.mdx +++ /dev/null @@ -1,1051 +0,0 @@ -{/* -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": "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": "Auto Generated Agent Chat: Using MathChat to Solve Math Problems", - "link": "/notebooks/agentchat_MathChat", - "description": "Using MathChat to Solve Math Problems", - "image": null, - "tags": [ - "math" - ], - "source": "/notebook/agentchat_MathChat.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" - }, - { - "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": "Cross-Framework LLM Tool for CaptainAgent", - "link": "/notebooks/agentchat_captainagent_crosstool", - "description": "Cross-Framework LLM Tool for CaptainAgent", - "image": null, - "tags": [ - "tools", - "langchain", - "crewai" - ], - "source": "/notebook/agentchat_captainagent_crosstool.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": "Using FalkorGraphRagCapability with agents for GraphRAG Question & Answering", - "link": "/notebooks/agentchat_graph_rag_falkordb", - "description": "Using FalkorGraphRagCapability with agents for GraphRAG Question & Answering", - "image": null, - "tags": [ - "RAG", - "FalkorDB" - ], - "source": "/notebook/agentchat_graph_rag_falkordb.ipynb" - }, - { - "title": "Using Neo4j's graph database with AG2 agents for Question & Answering", - "link": "/notebooks/agentchat_graph_rag_neo4j", - "description": "Neo4j GraphRAG utilises a knowledge graph and can be added as a capability to agents.", - "image": null, - "tags": [ - "RAG" - ], - "source": "/notebook/agentchat_graph_rag_neo4j.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": "RealtimeAgent in a Swarm Orchestration", - "link": "/notebooks/agentchat_realtime_swarm_websocket", - "description": "Swarm Ochestration", - "image": null, - "tags": [ - "orchestration", - "group chat", - "swarm" - ], - "source": "/notebook/agentchat_realtime_swarm_websocket.ipynb" - }, - { - "title": "RealtimeAgent with local websocket connection", - "link": "/notebooks/agentchat_realtime_websocket", - "description": "RealtimeAgent using websockets", - "image": null, - "tags": [ - "realtime", - "websockets" - ], - "source": "/notebook/agentchat_realtime_websocket.ipynb" - }, - { - "title": "ReasoningAgent - Advanced LLM Reasoning with Multiple Search Strategies", - "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": "Enhanced Swarm Orchestration with AG2", - "link": "/notebooks/agentchat_swarm_enhanced", - "description": "Swarm Ochestration", - "image": null, - "tags": [ - "orchestration", - "group chat", - "swarm" - ], - "source": "/notebook/agentchat_swarm_enhanced.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": "Config loader utility functions", - "link": "/notebooks/config_loader_utility_functions", - "description": "Config loader utility functions", - "image": null, - "tags": [ - "utility", - "config" - ], - "source": "/notebook/config_loader_utility_functions.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": "Cross-Framework LLM Tool Integration with AG2", - "link": "/notebooks/tools_interoperability", - "description": "Cross-Framework LLM Tool Integration with AG2", - "image": null, - "tags": [ - "tools", - "langchain", - "crewai", - "pydanticai" - ], - "source": "/notebook/tools_interoperability.ipynb" - }, - { - "title": "Agentic RAG workflow on tabular data from a PDF file", - "link": "/notebooks/agentchat_tabular_data_rag_workflow", - "description": "Agentic RAG workflow on tabular data from a PDF file", - "image": null, - "tags": [ - "RAG", - "groupchat" - ], - "source": "/notebook/agentchat_tabular_data_rag_workflow.ipynb" - }, - { - "title": "RealtimeAgent with WebRTC connection", - "link": "/notebooks/agentchat_realtime_webrtc", - "description": "RealtimeAgent using websockets", - "image": null, - "tags": [ - "realtime", - "websockets" - ], - "source": "/notebook/agentchat_realtime_webrtc.ipynb" - }, - { - "title": "Tools with Dependency Injection", - "link": "/notebooks/tools_dependency_injection", - "description": "Tools Dependency Injection", - "image": null, - "tags": [ - "tools", - "dependency injection", - "function calling" - ], - "source": "/notebook/tools_dependency_injection.ipynb" - }, - { - "title": "Chat Context Dependency Injection", - "link": "/notebooks/tools_chat_context_dependency_injection", - "description": "Chat Context Dependency Injection", - "image": null, - "tags": [ - "tools", - "dependency injection", - "function calling" - ], - "source": "/notebook/tools_chat_context_dependency_injection.ipynb" - }, - { - "title": "Using Neo4j's native GraphRAG SDK with AG2 agents for Question & Answering", - "link": "/notebooks/agentchat_graph_rag_neo4j_native", - "description": "Neo4j Native GraphRAG utilizes a knowledge graph and can be added as a capability to agents.", - "image": null, - "tags": [ - "RAG" - ], - "source": "/notebook/agentchat_graph_rag_neo4j_native.ipynb" - } -];