-
Notifications
You must be signed in to change notification settings - Fork 10
feat: Implement chat history API for Azure AI Foundry #142
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Added `send_chat_history_messages` and `send_chat_history` methods to handle chat history messaging. - Introduced message conversion logic to transform ThreadMessage objects into ChatHistoryMessage format. - Implemented input validation for method parameters. - Created unit tests for input validation, message conversion, success paths, error handling, and edge cases. - Added mock classes for testing Azure AI Foundry message structures. - Established shared pytest fixtures for consistent testing setup.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Implements an Azure AI Foundry–specific chat history API on top of the existing MCP tooling, including message conversion, validation, and comprehensive tests/documentation.
Changes:
- Added
send_chat_history_messagesandsend_chat_historytoMcpToolRegistrationServiceto convert Azure AI FoundryThreadMessageinstances intoChatHistoryMessageobjects and delegate to the core MCP tool server configuration service, with input validation and error handling. - Introduced Azure AI Foundry test fixtures and a rich test suite covering validation, message conversion, success paths, error handling, edge cases, concurrency, and tool option propagation.
- Added PRD and task documents describing the design, behavior, and implementation tasks for the Azure AI Foundry chat history API.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
libraries/microsoft-agents-a365-tooling-extensions-azureaifoundry/microsoft_agents_a365/tooling/extensions/azureaifoundry/services/mcp_tool_registration_service.py |
Adds Azure AI Foundry–specific chat history methods, including conversion from ThreadMessage to ChatHistoryMessage, orchestration of default ToolOptions, and delegation to the shared McpToolServerConfigurationService, with logging and error handling. |
tests/tooling/extensions/azureaifoundry/services/conftest.py |
Provides shared pytest fixtures for Azure AI Foundry tests (mock ThreadMessage/roles, AgentsClient, TurnContext, async iterator, and service instances with both successful and failing core services). |
tests/tooling/extensions/azureaifoundry/services/test_send_chat_history.py |
Defines unit tests for input validation, content extraction, message conversion/filtering, success paths, error propagation, edge cases (including concurrent calls and role without .value), and option propagation; one test contains an unnecessary isinstance patch now that content extraction uses duck-typing. |
tests/tooling/extensions/azureaifoundry/services/__init__.py |
Initializes the Azure AI Foundry services test package (header only). |
tests/tooling/extensions/azureaifoundry/__init__.py |
Initializes the Azure AI Foundry tests package (header only). |
docs/prd/azure-ai-foundry-chat-history-api.md |
Introduces a detailed PRD for the Azure AI Foundry chat history API (objectives, requirements, design, logging, testing, and acceptance criteria); one default-behavior row currently overstates what happens for empty histories compared to the existing core service implementation. |
docs/prd/azure-ai-foundry-chat-history-api-tasks.md |
Adds an implementation task breakdown for the feature; a few acceptance-criteria bullets (empty list handling and UUID generation for missing IDs) no longer match the agreed PRD or the implemented code. |
tests/tooling/extensions/azureaifoundry/services/test_send_chat_history.py
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <[email protected]>
…t_history.py Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
tests/tooling/extensions/azureaifoundry/services/test_send_chat_history.py
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.
send_chat_history_messagesandsend_chat_historymethods to handle chat history messaging.