From 4d6e2a47ff01fefa5d10d10afd122aa32f3a911f Mon Sep 17 00:00:00 2001 From: neagualexa Date: Tue, 28 Apr 2026 10:07:34 +0100 Subject: [PATCH 1/6] descriptions of the chatbots for teacher and students (todo: example chats) --- docs/advanced/chat_functions/info.md | 12 +- docs/advanced/chat_functions/local.md | 129 ++++++++++++++++++--- docs/advanced/chat_functions/quickstart.md | 115 +++++++++++++----- docs/student/chatbots.md | 63 ++++++++++ docs/student/images/chat_interface.png | Bin 631988 -> 567869 bytes docs/teacher/guides/chatbots.md | 93 +++++++++++++++ mkdocs.yml | 2 + 7 files changed, 362 insertions(+), 52 deletions(-) create mode 100644 docs/student/chatbots.md create mode 100644 docs/teacher/guides/chatbots.md diff --git a/docs/advanced/chat_functions/info.md b/docs/advanced/chat_functions/info.md index a46f839b0..e1fe19c9d 100644 --- a/docs/advanced/chat_functions/info.md +++ b/docs/advanced/chat_functions/info.md @@ -22,15 +22,13 @@ The chatbots have at their basis a [Large Language Model (LLM)](https://en.wikip Currently the students have access to the following chat functions that host their own specific chatbot. Many others are in development. -Click on the links below for information on each chatbot: +For a comparison of each chatbot's philosophy, behaviour, and when to pick it, see the [Chatbots guide for teachers](../../teacher/guides/chatbots.md) (or the [student-facing version](../../student/chatbots.md)). -[1. Informational Chatbot](https://github.com/lambda-feedback/informationalChatFunction/blob/main/docs/user.md) +Per-chatbot source and technical details: - -[2. Concise Chatbot](https://github.com/lambda-feedback/conciseChatFunction/blob/main/docs/user.md) - - -[3. Reflective Chatbot](https://github.com/lambda-feedback/reflectiveChatFunction/blob/main/docs/user.md) +- [Informational Chatbot](https://github.com/lambda-feedback/informationalChatFunction/blob/main/docs/user.md) +- [Concise Chatbot](https://github.com/lambda-feedback/conciseChatFunction/blob/main/docs/user.md) +- [Reflective Chatbot](https://github.com/lambda-feedback/reflectiveChatFunction/blob/main/docs/user.md) ## Chat Function Development diff --git a/docs/advanced/chat_functions/local.md b/docs/advanced/chat_functions/local.md index 04644ac37..62c598646 100644 --- a/docs/advanced/chat_functions/local.md +++ b/docs/advanced/chat_functions/local.md @@ -1,14 +1,19 @@ # Running and Testing Chat function Locally -You can run the Python function for your chat function itself by writing a `main()` function, or you can call the [`testbench_prompts.py`](https://github.com/lambda-feedback/lambda-chat/blob/main/src/agents/utils/testbench_prompts.py) script that runs a similar pipeline to the `module.py`. +## Run Unit Tests + +You can run the unit tests using `pytest`: ```bash -python src/agents/utils/testbench_prompts.py +pytest ``` -You can also use the `test_prompts.py` script to test the chat function with example inputs from Lambda Feedback questions and synthetic conversations. +## Run the Chat Script + +You can use the `manual_agent_run.py` script to test the agents with example inputs from Lambda Feedback questions and synthetic conversations: + ```bash -python src/agents/utils/test_prompts.py +python tests/manual_agent_run.py ``` ## Testing using the Docker Image [:material-docker:](https://www.docker.com/) @@ -44,10 +49,20 @@ This will start the evaluation function and expose it on port `8080` and it will ```bash curl --location 'http://localhost:8080/2015-03-31/functions/function/invocations' \ --header 'Content-Type: application/json' \ ---data '{"body":"{\"message\": \"hi\", \"params\": {\"conversation_id\": \"12345Test\", \"conversation_history\": [{\"type\": \"user\", \"content\": \"hi\"}]}}"}' +--data '{"body":"{\"conversationId\": \"12345Test\", \"messages\": [{\"role\": \"USER\", \"content\": \"hi\"}], \"user\": {\"type\": \"LEARNER\"}}"}' +``` + +### Call Docker Container + +#### A. Call Docker with Python Requests + +In the `tests/` folder you can find the `manual_agent_requests.py` script that calls the POST URL of the running Docker container. It reads input files matching the expected schema, so you can use it to validate your chatbot end-to-end. + +```bash +python tests/manual_agent_requests.py ``` -### Call Docker Container From Postman +#### B. Call Docker Container From Postman POST URL: @@ -55,24 +70,100 @@ POST URL: http://localhost:8080/2015-03-31/functions/function/invocations ``` -Body: +Body (stringified within `body` for the API request): ```JSON -{"body":"{\"message\": \"hi\", \"params\": {\"conversation_id\": \"12345Test\", \"conversation_history\": [{\"type\": \"user\", \"content\": \"hi\"}]}}"} +{"body":"{\"conversationId\": \"12345Test\", \"messages\": [{\"role\": \"USER\", \"content\": \"hi\"}], \"user\": {\"type\": \"LEARNER\"}}"} ``` -Body with optional Params: -```JSON +Input Body with optional fields: +```json { - "message":"hi", - "params":{ - "conversation_id":"12345Test", - "conversation_history":[{"type":"user","content":"hi"}], - "summary":" ", - "conversational_style":" ", - "question_response_details": "", - "include_test_data": true, - "agent_type": {agent_name} + "conversationId": "", + "messages": [ + { "role": "USER", "content": "" }, + { "role": "ASSISTANT", "content": "" }, + { "role": "USER", "content": "" } + ], + "user": { + "type": "LEARNER", + "preference": { + "conversationalStyle": "" + }, + "taskProgress": { + "timeSpentOnQuestion": "30 minutes", + "accessStatus": "a good amount of time spent on this question today.", + "markedDone": "This question is still being worked on.", + "currentPart": { + "position": 0, + "timeSpentOnPart": "10 minutes", + "markedDone": "This part is not marked done.", + "responseAreas": [ + { + "responseType": "EXPRESSION", + "totalSubmissions": 3, + "wrongSubmissions": 2, + "latestSubmission": { + "submission": "", + "feedback": "", + "answer": "" + } + } + ] + } } + }, + "context": { + "summary": "", + "set": { + "title": "Fundamentals", + "number": 2, + "description": "" + }, + "question": { + "title": "Understanding Polymorphism", + "number": 3, + "guidance": "", + "content": "", + "estimatedTime": "15-25 minutes", + "parts": [ + { + "position": 0, + "content": "", + "answerContent": "", + "workedSolutionSections": [ + { "position": 0, "title": "Step 1", "content": "..." } + ], + "structuredTutorialSections": [ + { "position": 0, "title": "Hint", "content": "..." } + ], + "responseAreas": [ + { + "position": 0, + "responseType": "EXPRESSION", + "answer": "", + "preResponseText": "