Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the chatbot Lambda to accept/return the muEd API ChatRequest/ChatResponse schema, including message history, user preferences, and educational context.
Changes:
- Switched
index.py+src/module.pyto validate/consumeChatRequestand returnChatResponse(muEd format). - Replaced the legacy “question_response_details” prompt parsing with a new
src/agent/context.pythat formats muEdcontext+taskProgressinto an LLM prompt. - Refactored/expanded tests to validate muEd request/response structure and added real muEd example payloads for end-to-end coverage.
Reviewed changes
Copilot reviewed 25 out of 25 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
index.py |
Validates incoming payloads as ChatRequest and returns serialized ChatResponse in the Lambda response body. |
src/module.py |
Adapts the main chat entrypoint to muEd request/response models and feeds LangChain/LangGraph with converted messages + context prompt. |
src/agent/agent.py |
Updates the agent invocation contract to accept message objects + context prompt and returns updated metadata fields. |
src/agent/context.py |
New muEd context/task progress → prompt formatter used by the agent system message. |
src/agent/prompts.py |
Adds a dedicated response-format prompt section (KaTeX + British English). |
tests/utils.py |
Adds shared schema validation helpers for muEd request/response. |
tests/test_module.py |
Updates module-level test to validate muEd response structure. |
tests/test_index.py |
Updates handler tests for muEd schema + invalid JSON / missing messages cases. |
tests/test_example_inputs.py |
Adds end-to-end tests for each tests/example_inputs/*.json payload. |
tests/example_inputs/*.json |
Adds representative muEd payload fixtures used by end-to-end tests. |
tests/manual_agent_run.py |
Updates the manual script to load muEd example inputs and validate via ChatRequest. |
README.md, docs/dev.md |
Updates documentation examples to the muEd schema and repository structure. |
AGENTS.md, CLAUDE.md |
Adds repository guidance docs reflecting the muEd flow and key files. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Modification to the request and response structure of the chat function to adapt to the muEd API standard
simplify the whole repo structure