Skip to content

Mued api adopted#32

Merged
neagualexa merged 12 commits intomainfrom
mued_api_adopted
Mar 30, 2026
Merged

Mued api adopted#32
neagualexa merged 12 commits intomainfrom
mued_api_adopted

Conversation

@neagualexa
Copy link
Copy Markdown
Collaborator

@neagualexa neagualexa commented Mar 20, 2026

Modification to the request and response structure of the chat function to adapt to the muEd API standard

simplify the whole repo structure

Copy link
Copy Markdown
Contributor

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 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.py to validate/consume ChatRequest and return ChatResponse (muEd format).
  • Replaced the legacy “question_response_details” prompt parsing with a new src/agent/context.py that formats muEd context + taskProgress into 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.

Comment thread src/module.py
Comment thread src/agent/context.py Outdated
Comment thread README.md
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@neagualexa neagualexa merged commit 6512a6a into main Mar 30, 2026
@neagualexa neagualexa deleted the mued_api_adopted branch March 30, 2026 12:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants