Skip to content

Conversation

nmoeller
Copy link

@nmoeller nmoeller commented Oct 2, 2025

Motivation and Context

This pull request introduces a new Olama integration package for the Microsoft Agent Framework, allowing users to leverage Ollama-based chat models within the framework. The changes include the implementation of the agent-framework-olama package, its integration as an optional dependency, and the addition of a sample demonstrating its usage.

Screenshot of Working Samples

  • Chat Completion
image
  • Reasoning
image
  • Multimodality
image

Screenshot of test coverage

image

Description

  • Add Chat Completion
  • Add Tool Calling
  • Add Reasoning
  • Multi Modality
  • Add Unit & Integration Tests

Contribution Checklist

  • The code builds clean without any errors or warnings
  • The PR follows the Contribution Guidelines
  • All unit tests pass, and I have added new tests where possible
  • Is this a breaking change? If yes, add "[BREAKING]" prefix to the title of the PR.

nmoeller and others added 29 commits September 12, 2025 13:48
- Divided Streaming and Non-Streaming into independent Methods
- Catch Ollama Validation Error
- Add OTEL Provider Name
- Checked Ollama Messages
- Add Usage Statistics
@markwallace-microsoft markwallace-microsoft added the documentation Improvements or additions to documentation label Oct 2, 2025
@markwallace-microsoft
Copy link
Member

markwallace-microsoft commented Oct 3, 2025

Python Test Coverage

Python Test Coverage Report •
FileStmtsMissCoverMissing
packages/core/agent_framework
   _types.py8969589%126–127, 145–146, 281, 283, 290, 309, 349, 395–396, 438, 588, 700–701, 703, 728, 735, 752–754, 825, 830–831, 833, 840–841, 843, 865, 872, 875–877, 882–883, 889–891, 1008, 1125, 1293, 1297, 1299, 1525–1527, 1533–1534, 1751, 1756, 1806, 1811, 1815, 1819, 2029–2033, 2043, 2048, 2291, 2461, 2466, 2560–2562, 2585, 2590, 2610, 2626, 2634–2638, 2742, 2747, 2814, 2818, 2826, 2830–2832, 2932, 2936, 2940, 2944, 2947, 3001–3003, 3071, 3098, 3105
TOTAL10188167783% 

Python Unit Test Overview

Tests Skipped Failures Errors Time
1237 102 💤 0 ❌ 0 🔥 28.458s ⏱️

@nmoeller nmoeller marked this pull request as ready for review October 3, 2025 18:27
@Copilot Copilot AI review requested due to automatic review settings October 3, 2025 18:27
Copy link
Contributor

@Copilot 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 introduces Ollama integration for the Microsoft Agent Framework, enabling developers to use Ollama-based chat models within the framework. The implementation includes comprehensive support for chat completion, tool calling, reasoning capabilities, and multimodal input handling.

  • Adds agent-framework-ollama package with full Ollama integration
  • Implements OllamaChatClient supporting streaming/non-streaming responses, tool calls, reasoning, and multimodal inputs
  • Extends core framework with reasoning property support across chat response types

Reviewed Changes

Copilot reviewed 16 out of 18 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
python/packages/ollama/agent_framework_ollama/_chat_client.py Core Ollama chat client implementation with message conversion and response handling
python/packages/core/agent_framework/_types.py Adds reasoning property to ChatMessage, ChatResponse, and ChatResponseUpdate classes
python/packages/ollama/pyproject.toml Package configuration for agent-framework-ollama with dependencies and build settings
python/packages/ollama/tests/test_ollama_chat_client.py Comprehensive unit and integration tests for the Ollama chat client
python/samples/getting_started/agents/ollama/ollama_agent_basic.py Sample demonstrating basic agent usage with tool calling
python/samples/getting_started/agents/ollama/ollama_agent_reasoning.py Sample demonstrating reasoning capabilities
python/samples/getting_started/multimodal_input/ollama_chat_multimodal.py Sample demonstrating multimodal image analysis
python/samples/getting_started/chat_client/ollama_chat_client.py Sample demonstrating direct chat client usage

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation python
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants