From 5d471ded6e4ffdc169f12a2f8109328ab05557be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E0=AE=AE=E0=AE=A9=E0=AF=8B=E0=AE=9C=E0=AF=8D=E0=AE=95?= =?UTF-8?q?=E0=AF=81=E0=AE=AE=E0=AE=BE=E0=AE=B0=E0=AF=8D=20=E0=AE=AA?= =?UTF-8?q?=E0=AE=B4=E0=AE=A9=E0=AE=BF=E0=AE=9A=E0=AF=8D=E0=AE=9A=E0=AE=BE?= =?UTF-8?q?=E0=AE=AE=E0=AE=BF?= Date: Thu, 1 Aug 2024 10:57:20 +0530 Subject: [PATCH 1/2] Add new OpenDTutorAgent and its prompt template * **agent.yaml** - Define the new agent with the name `OpenDTutorAgent` - Add a description for the agent focusing on educational explanations and interactive tutoring - Specify inputs for the codebase and questions - Specify outputs for explanations * **prompt.md** - Create a prompt template for the agent - Focus on educational explanations and interactive tutoring - Include instructions for parsing the source code and generating human-readable explanations - Provide a format for user interaction through a chat interface --- agenthub/micro/open_d_tutor/agent.yaml | 7 +++++++ agenthub/micro/open_d_tutor/prompt.md | 28 ++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 agenthub/micro/open_d_tutor/agent.yaml create mode 100644 agenthub/micro/open_d_tutor/prompt.md diff --git a/agenthub/micro/open_d_tutor/agent.yaml b/agenthub/micro/open_d_tutor/agent.yaml new file mode 100644 index 000000000000..f77aef468fdc --- /dev/null +++ b/agenthub/micro/open_d_tutor/agent.yaml @@ -0,0 +1,7 @@ +name: OpenDTutorAgent +description: Provides educational explanations and interactive tutoring for codebases +inputs: + codebase: string + questions: string +outputs: + explanations: string diff --git a/agenthub/micro/open_d_tutor/prompt.md b/agenthub/micro/open_d_tutor/prompt.md new file mode 100644 index 000000000000..5dc703559084 --- /dev/null +++ b/agenthub/micro/open_d_tutor/prompt.md @@ -0,0 +1,28 @@ +# Task +You are a software tutor. Your primary goal is to provide educational explanations and interactive tutoring for the following codebase: + +{{ state.inputs.codebase }} + +## User Questions +The user has the following questions about the codebase: +{{ state.inputs.questions }} + +## Instructions +1. Parse the source code provided in the codebase. +2. Generate human-readable explanations for the functions, algorithms, and overall project architecture. +3. Provide detailed explanations and clarifications for any specific questions the user has about the code or concepts. +4. Interact with the user through a chat interface to answer their questions and provide further explanations as needed. + +## Available Actions +{{ instructions.actions.message }} +{{ instructions.actions.read }} +{{ instructions.actions.finish }} + +Do NOT finish until you have provided detailed explanations and answered all user questions. + +## History +{{ instructions.history_truncated }} +{{ history_to_json(state.history, max_events=20) }} + +## Format +{{ instructions.format.action }} From e25d118fb30dc9840f5cb223e9536e7dd80dec58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E0=AE=AE=E0=AE=A9=E0=AF=8B=E0=AE=9C=E0=AF=8D=E0=AE=95?= =?UTF-8?q?=E0=AF=81=E0=AE=AE=E0=AE=BE=E0=AE=B0=E0=AF=8D=20=E0=AE=AA?= =?UTF-8?q?=E0=AE=B4=E0=AE=A9=E0=AE=BF=E0=AE=9A=E0=AF=8D=E0=AE=9A=E0=AE=BE?= =?UTF-8?q?=E0=AE=AE=E0=AE=BF?= Date: Thu, 1 Aug 2024 13:08:14 +0530 Subject: [PATCH 2/2] update tests --- agenthub/micro/{open_d_tutor => tutor_agent}/agent.yaml | 2 +- agenthub/micro/{open_d_tutor => tutor_agent}/prompt.md | 0 .../integration/mock/ManagerAgent/test_edits/prompt_001.log | 5 +++++ .../integration/mock/ManagerAgent/test_edits/prompt_006.log | 5 +++++ .../ManagerAgent/test_simple_task_rejection/prompt_001.log | 5 +++++ .../ManagerAgent/test_simple_task_rejection/prompt_006.log | 5 +++++ .../ManagerAgent/test_write_simple_script/prompt_001.log | 5 +++++ .../ManagerAgent/test_write_simple_script/prompt_006.log | 5 +++++ .../ManagerAgent/test_write_simple_script/prompt_010.log | 5 +++++ 9 files changed, 36 insertions(+), 1 deletion(-) rename agenthub/micro/{open_d_tutor => tutor_agent}/agent.yaml (88%) rename agenthub/micro/{open_d_tutor => tutor_agent}/prompt.md (100%) diff --git a/agenthub/micro/open_d_tutor/agent.yaml b/agenthub/micro/tutor_agent/agent.yaml similarity index 88% rename from agenthub/micro/open_d_tutor/agent.yaml rename to agenthub/micro/tutor_agent/agent.yaml index f77aef468fdc..0bcb776df5f4 100644 --- a/agenthub/micro/open_d_tutor/agent.yaml +++ b/agenthub/micro/tutor_agent/agent.yaml @@ -1,4 +1,4 @@ -name: OpenDTutorAgent +name: TutorAgent description: Provides educational explanations and interactive tutoring for codebases inputs: codebase: string diff --git a/agenthub/micro/open_d_tutor/prompt.md b/agenthub/micro/tutor_agent/prompt.md similarity index 100% rename from agenthub/micro/open_d_tutor/prompt.md rename to agenthub/micro/tutor_agent/prompt.md diff --git a/tests/integration/mock/ManagerAgent/test_edits/prompt_001.log b/tests/integration/mock/ManagerAgent/test_edits/prompt_001.log index 2839256104a5..9d268f85036f 100644 --- a/tests/integration/mock/ManagerAgent/test_edits/prompt_001.log +++ b/tests/integration/mock/ManagerAgent/test_edits/prompt_001.log @@ -53,6 +53,11 @@ Given a particular task, finds and describes all relevant parts of the codebase #### Inputs {"task": "string"} +### TutorAgent +Provides educational explanations and interactive tutoring for codebases +#### Inputs +{"codebase": "string", "questions": "string"} + ### TypoFixerAgent Fixes typos in files in the current working directory #### Inputs diff --git a/tests/integration/mock/ManagerAgent/test_edits/prompt_006.log b/tests/integration/mock/ManagerAgent/test_edits/prompt_006.log index 9fb0e100dbb4..056260480582 100644 --- a/tests/integration/mock/ManagerAgent/test_edits/prompt_006.log +++ b/tests/integration/mock/ManagerAgent/test_edits/prompt_006.log @@ -53,6 +53,11 @@ Given a particular task, finds and describes all relevant parts of the codebase #### Inputs {"task": "string"} +### TutorAgent +Provides educational explanations and interactive tutoring for codebases +#### Inputs +{"codebase": "string", "questions": "string"} + ### TypoFixerAgent Fixes typos in files in the current working directory #### Inputs diff --git a/tests/integration/mock/ManagerAgent/test_simple_task_rejection/prompt_001.log b/tests/integration/mock/ManagerAgent/test_simple_task_rejection/prompt_001.log index 8ad7e8de7c1c..027fa1b341ab 100644 --- a/tests/integration/mock/ManagerAgent/test_simple_task_rejection/prompt_001.log +++ b/tests/integration/mock/ManagerAgent/test_simple_task_rejection/prompt_001.log @@ -53,6 +53,11 @@ Given a particular task, finds and describes all relevant parts of the codebase #### Inputs {"task": "string"} +### TutorAgent +Provides educational explanations and interactive tutoring for codebases +#### Inputs +{"codebase": "string", "questions": "string"} + ### TypoFixerAgent Fixes typos in files in the current working directory #### Inputs diff --git a/tests/integration/mock/ManagerAgent/test_simple_task_rejection/prompt_006.log b/tests/integration/mock/ManagerAgent/test_simple_task_rejection/prompt_006.log index 0356a4b906ae..d67626e98e87 100644 --- a/tests/integration/mock/ManagerAgent/test_simple_task_rejection/prompt_006.log +++ b/tests/integration/mock/ManagerAgent/test_simple_task_rejection/prompt_006.log @@ -53,6 +53,11 @@ Given a particular task, finds and describes all relevant parts of the codebase #### Inputs {"task": "string"} +### TutorAgent +Provides educational explanations and interactive tutoring for codebases +#### Inputs +{"codebase": "string", "questions": "string"} + ### TypoFixerAgent Fixes typos in files in the current working directory #### Inputs diff --git a/tests/integration/mock/ManagerAgent/test_write_simple_script/prompt_001.log b/tests/integration/mock/ManagerAgent/test_write_simple_script/prompt_001.log index 9b0b4df49abc..7d208250959c 100644 --- a/tests/integration/mock/ManagerAgent/test_write_simple_script/prompt_001.log +++ b/tests/integration/mock/ManagerAgent/test_write_simple_script/prompt_001.log @@ -43,6 +43,11 @@ Given a particular task, finds and describes all relevant parts of the codebase #### Inputs {"task": "string"} +### TutorAgent +Provides educational explanations and interactive tutoring for codebases +#### Inputs +{"codebase": "string", "questions": "string"} + ### TypoFixerAgent Fixes typos in files in the current working directory #### Inputs diff --git a/tests/integration/mock/ManagerAgent/test_write_simple_script/prompt_006.log b/tests/integration/mock/ManagerAgent/test_write_simple_script/prompt_006.log index 5c732af1da22..1377b634c222 100644 --- a/tests/integration/mock/ManagerAgent/test_write_simple_script/prompt_006.log +++ b/tests/integration/mock/ManagerAgent/test_write_simple_script/prompt_006.log @@ -43,6 +43,11 @@ Given a particular task, finds and describes all relevant parts of the codebase #### Inputs {"task": "string"} +### TutorAgent +Provides educational explanations and interactive tutoring for codebases +#### Inputs +{"codebase": "string", "questions": "string"} + ### TypoFixerAgent Fixes typos in files in the current working directory #### Inputs diff --git a/tests/integration/mock/ManagerAgent/test_write_simple_script/prompt_010.log b/tests/integration/mock/ManagerAgent/test_write_simple_script/prompt_010.log index a8d42cbf75ea..96f851068148 100644 --- a/tests/integration/mock/ManagerAgent/test_write_simple_script/prompt_010.log +++ b/tests/integration/mock/ManagerAgent/test_write_simple_script/prompt_010.log @@ -43,6 +43,11 @@ Given a particular task, finds and describes all relevant parts of the codebase #### Inputs {"task": "string"} +### TutorAgent +Provides educational explanations and interactive tutoring for codebases +#### Inputs +{"codebase": "string", "questions": "string"} + ### TypoFixerAgent Fixes typos in files in the current working directory #### Inputs