Files
Giles Odigwe 6f6ee61834 Python: Fix broken samples and add missing READMEs (#5038)
* Python: Fix broken samples and add missing READMEs

- simple_context_provider: move instructions kwarg into options dict
- suspend_resume_session: use OpenAIChatCompletionClient for in-memory demo
- foundry_chat_client_with_hosted_mcp: move store kwarg into options dict
- Add README.md for context_providers and conversations sample folders

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Python: Fix additional sample issues in context_providers

- mem0_basic: send preferences query before sleep so Mem0 can learn them,
  print result from new session recall
- mem0_sessions: add session for multi-turn conversation in agent-scoped
  example, remove user_id from agent-scoped provider (Mem0 API stores
  memories without user_id when agent_id is provided), use single message
  for storing preferences
- redis_basics: print retrieved context messages instead of raw object
- redis_sessions: add missing load_dotenv() call
- redis_basics/redis_sessions: fix docstrings referencing wrong client type
- azure_redis_conversation: replace duplicate copyright with load_dotenv()

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Python: Fix broken link in declarative README

openai_responses_agent.py was renamed to openai_agent.py

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
6f6ee61834 ยท 2026-04-01 21:35:16 +00:00
History
..

Foundry Provider Samples

This folder contains Azure AI Foundry and Foundry Local samples for Agent Framework.

FoundryAgent Samples

File Description
foundry_agent_basic.py Foundry Agent basic example
foundry_agent_custom_client.py Foundry Agent custom client configuration
foundry_agent_hosted.py Foundry Agent for hosted agents
foundry_agent_with_env_vars.py Foundry Agent using environment variables
foundry_agent_with_function_tools.py Foundry Agent with local function tools

FoundryChatClient Samples

File Description
foundry_chat_client.py Foundry Chat Client with project endpoint example
foundry_chat_client_basic.py Foundry Chat Client basic example
foundry_chat_client_code_interpreter_files.py Foundry Chat Client with code interpreter and files
foundry_chat_client_image_analysis.py Foundry Chat Client with image analysis
foundry_chat_client_with_code_interpreter.py Foundry Chat Client with code interpreter
foundry_chat_client_with_explicit_settings.py Foundry Chat Client with explicit settings
foundry_chat_client_with_file_search.py Foundry Chat Client with file search
foundry_chat_client_with_function_tools.py Foundry Chat Client with function tools
foundry_chat_client_with_hosted_mcp.py Foundry Chat Client with hosted MCP
foundry_chat_client_with_local_mcp.py Foundry Chat Client with local MCP
foundry_chat_client_with_session.py Foundry Chat Client with session management

FoundryLocalClient Samples

Prerequisites

  1. Install Foundry Local and required local runtime components.

  2. Install the connector package:

    pip install agent-framework-foundry-local --pre
    
File Description
foundry_local_agent.py Basic Foundry Local agent usage with streaming and non-streaming responses, plus function tool calling.

Environment Variables

  • FOUNDRY_LOCAL_MODEL: Optional model alias/ID to use by default when model is not passed to FoundryLocalClient.