Skip to content

feat(notebooks): Add and update comprehensive notebook examples (#220, #221)#241

Merged
Zochory merged 2 commits intomainfrom
notebooks-examples
Oct 19, 2025
Merged

feat(notebooks): Add and update comprehensive notebook examples (#220, #221)#241
Zochory merged 2 commits intomainfrom
notebooks-examples

Conversation

@Zochory
Copy link
Member

@Zochory Zochory commented Oct 19, 2025

Adds agent_as_workflow.ipynb and updates existing notebooks with new features

…ew features

- Add agent_as_workflow.ipynb: Demonstrates WorkflowAgent pattern with reflection and retry
- Update azure_responses_client.ipynb: Azure OpenAI Responses Client with function calling
- Update openai_responses_example.ipynb: OpenAI Responses Client direct usage examples
- Update mem0_basic.ipynb: Mem0 provider integration for long-term memory
- Update magentic.ipynb: Complete Magentic orchestration with multi-agent coordination
- Update yaml_workflow.ipynb: YAML-based workflow configuration and execution
- Clear all output cells to keep notebooks clean

Resolves #220 and #221
Copilot AI review requested due to automatic review settings October 19, 2025 17:48
@github-actions
Copy link
Contributor

github-actions bot commented Oct 19, 2025

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@github-actions
Copy link
Contributor

🤖 Hi @Zochory, I've received your request, and I'm working on it now! You can track my progress in the logs for more details.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds comprehensive notebook examples to demonstrate AgenticFleet capabilities and updates existing notebooks with new Microsoft Agent Framework features. The notebooks cover various usage patterns from basic client usage to advanced multi-agent orchestration.

Key changes:

  • Adds agent_as_workflow.ipynb demonstrating the reflection pattern with Worker-Reviewer cycles
  • Adds yaml_workflow.ipynb showing declarative workflow configuration
  • Updates existing notebooks with current API patterns and examples

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.

Show a summary per file
File Description
notebooks/agent_as_workflow.ipynb New comprehensive example showing workflow-as-agent pattern with reflection and retry logic
notebooks/yaml_workflow.ipynb New example demonstrating YAML-based workflow configuration and loading
notebooks/openai_responses_example.ipynb New example for direct OpenAI Responses client usage with function calling
notebooks/mem0_basic.ipynb New example showing Mem0 context provider integration with Azure AI
notebooks/magentic.ipynb New example demonstrating complete Magentic orchestration workflow
notebooks/example.ipynb Updated Azure Responses client example with improved error handling
notebooks/devui_azureai.ipynb New example for Azure AI Foundry integration with debug UI
notebooks/devui.ipynb Simple debug UI example with OpenAI chat client
notebooks/azure_responses_client.ipynb Comprehensive Azure OpenAI Responses client example
Comments suppressed due to low confidence (6)

notebooks/yaml_workflow.ipynb:1

  • The path references '../var/config/workflows/' but AgenticFleet stores configuration files in 'config/workflows/' according to the architecture. This path should be updated to match the actual configuration directory structure.
{

notebooks/yaml_workflow.ipynb:1

  • Inconsistent configuration path - this references '../config/workflows/' while line 55 uses '../var/config/workflows/'. According to AgenticFleet architecture, configuration should be in 'config/workflows/' relative to project root.
{

notebooks/openai_responses_example.ipynb:1

  • Hardcoded Azure OpenAI endpoint should not be used as a fallback. AgenticFleet follows uv-first patterns and declarative configuration via YAML/env vars, not hardcoded URLs in code.
{

notebooks/magentic.ipynb:1

  • Model names should respect per-agent configuration from YAML files rather than being hardcoded. AgenticFleet architecture requires declarative model configuration in agents//config.yaml.
{

notebooks/example.ipynb:1

  • Hardcoded model deployment name should use environment configuration. AgenticFleet pattern requires respecting per-agent model settings from YAML configuration, not hardcoding model names.
{

notebooks/agent_as_workflow.ipynb:1

  • Hardcoded model IDs violate AgenticFleet's declarative configuration principle. Model names should be loaded from YAML configuration files, not hardcoded in factories.
{

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +52 to +55
"from agenticfleet.fleet.workflow_loader import load_workflow_from_yaml\n",
"\n",
"# Load the workflow configuration\n",
"config_path = Path(\"../var/config/workflows/magentic_example.yaml\")\n",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Reference existing YAML config path

The workflow loader uses Path("../var/config/workflows/magentic_example.yaml"), but the repository does not ship a var/config directory or any magentic_example.yaml file. Executing the cell raises FileNotFoundError, preventing users from running the YAML workflow example. Point to an actual configuration file in the repo (e.g., under config/workflows) or include the missing YAML asset.

Useful? React with 👍 / 👎.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot Fix and resolve conversation

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

## 📋 Review Summary

I am unable to perform a code review for this pull request.
I was unable to access the pull request diff.

🔍 General Feedback

I have tried the following steps to get the pull request diff:

  • I tried to use the mcp__github__get_pull_request_diff tool as instructed, but it is not available in my environment.
  • I tried to use git diff command, but it is not allowed.
  • I tried to find the diff in a file by guessing common filenames (diff.txt, changes.diff, pr.diff, pull_request.diff, patch.diff, diff.patch), but none of them exist.
  • I tried to find the diff by searching for the string "diff --git" using grep, but it only returned a match in a sample git hook file.
  • I tried to find the diff by searching for the pull request number "241" using grep, but it did not lead to the diff file.

There is a contradiction in my instructions. I am told to use mcp__github__* tools, but they are not available. The gemini-review.yml workflow file confirms that these tools should be available.

Please check the configuration of the environment.

@Zochory
Copy link
Member Author

Zochory commented Oct 19, 2025

@copilot The job failed because several tests in tests/test_reflection_endpoint.py could not connect to a required endpoint, resulting in httpx.ConnectError: All connection attempts failed.

Root Cause:
These tests are trying to reach an HTTP endpoint (likely a local server or mock service), but the connection fails. This usually means the server isn't running, isn't started before tests, or uses the wrong address/port.


Solution Steps:

  1. Ensure the Reflection API Server Is Running for Tests

    • If these tests require a local HTTP server, make sure it is started before running the tests.
    • You can use fixtures in pytest to spin up a test server before tests, or use tools like pytest-httpserver.
  2. Check and Fix the Endpoint URL in Tests

    • Ensure the tests are using the correct base URL and port for the server.
    • Use environment variables or configuration files to make this dynamic.
  3. Update the CI Workflow to Start the Server

    • In .github/workflows/ci.yml, add a step before running tests to spin up the necessary server (e.g., with python -m <server_module> or docker-compose up).

Example: Pytest Fixture for a Test Server

If you use FastAPI/Flask, add a fixture in your conftest.py:

import pytest
from my_app import app  # import your app

@pytest.fixture(scope="session", autouse=True)
def start_test_server():
    from threading import Thread
    import uvicorn

    server = Thread(target=uvicorn.run, args=(app,), kwargs={"host": "127.0.0.1", "port": 8000})
    server.daemon = True
    server.start()
    yield
    # Optionally add teardown code here

Update your tests to use http://127.0.0.1:8000 as the endpoint.


Example: GitHub Actions Workflow Step

Add this step to .github/workflows/ci.yml before running tests:

- name: Start Reflection API Server
  run: |
    python -m my_app &  # Replace with your actual server start command
    sleep 5  # Wait for the server to be ready

Summary:
The tests are failing because the required HTTP server is not running. Make sure to start the server before running the tests, both locally and in CI, and verify the endpoint URLs used in the tests.

If you share the relevant part of .github/workflows/ci.yml or the test code, I can provide a more targeted fix.

@Zochory Zochory added this to the 0.5.3 milestone Oct 19, 2025
@Zochory Zochory linked an issue Oct 19, 2025 that may be closed by this pull request
7 tasks
@Zochory Zochory merged commit 7125172 into main Oct 19, 2025
19 of 24 checks passed
@Zochory Zochory deleted the notebooks-examples branch October 19, 2025 19:14
@github-project-automation github-project-automation bot moved this from Backlog to Done in AgenticFleet Oct 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[Notebooks] Update Existing Notebooks for New Features

3 participants