Files
agent-framework/python/samples
T
Christian Glessner 8bb1266020 Python: Add PDF file support to OpenAI content parser with filename mapping (#1121)
* Add mapping for application media type in OpenAI responses client

* Enhance multimodal input samples: Add PDF testing functionality and fix image sample

* Standardize filename handling and add multimodal samples

- Standardized filename extraction logic between chat and responses clients
- Both clients now omit filename when not provided (no default fallback)
- Added Azure Responses API multimodal sample with PDF support
- Cleaned up Azure Chat sample to focus on supported features only
- Fixed test comment placement for better code documentation
- Updated README with clear API capability differences

* Enhance multimodal input samples with image and PDF handling

- Refactor image and PDF handling in `azure_chat_multimodal.py` and `openai_chat_multimodal.py` to use new utility functions.
- Add `load_sample_pdf` and `create_sample_image` functions for better test asset management.
- Remove redundant code for creating sample images and PDFs.
- Introduce a sample PDF file in `sample_assets` for testing purposes.

* Fix formatting in OpenAI chat client

---------

Co-authored-by: Dmytro Struk <13853051+dmytrostruk@users.noreply.github.com>
8bb1266020 ยท 2025-10-07 17:04:33 +00:00
History
..
2025-07-28 07:33:42 +00:00

Python Samples

This directory contains samples demonstrating the capabilities of Microsoft Agent Framework for Python.

Getting Started

For step-by-step tutorials and examples, see the getting_started directory:

  • Agents - Learn how to create and use agents with various providers (Azure OpenAI, OpenAI, Azure AI, etc.)
  • Workflows - Explore workflow patterns for orchestrating multiple agents
  • Chat Client - Examples of using chat clients directly
  • Threads - Manage conversation threads and chat message stores
  • Context Providers - Integrate with context providers like Mem0 and Redis
  • Middleware - Add middleware for logging, telemetry, and custom processing
  • Multimodal Input - Handle images and other multimodal inputs
  • Observability - Add tracing and monitoring to your agents

Sample Guidelines

For information on creating new samples, see SAMPLE_GUIDELINES.md.

More Information