From 4f5babbe239e1e7969a2f34b191b263f5906013a Mon Sep 17 00:00:00 2001 From: Josh Creek <8179928+jcreek@users.noreply.github.com> Date: Mon, 21 Apr 2025 16:54:52 +0100 Subject: [PATCH] feat(*): Improve the display of tool usage --- src/lib/agent/tools/conceptVerifierTool.ts | 8 +- src/lib/agent/tools/essayAnalyzerTool.ts | 8 +- src/lib/agent/tools/feedbackGeneratorTool.ts | 8 +- src/lib/agent/tools/index.ts | 14 +- .../metacognitiveReflectionPromptTool.ts | 8 +- src/lib/agent/tools/rubricMatcherTool.ts | 8 +- src/lib/agent/tools/selfAssessmentTool.ts | 8 +- .../tools/spellingAndGrammarCheckerTool.ts | 8 +- src/lib/components/AgenticProgress.svelte | 145 +++++++ src/routes/upload/+page.svelte | 355 +++++++++--------- 10 files changed, 381 insertions(+), 189 deletions(-) create mode 100644 src/lib/components/AgenticProgress.svelte diff --git a/src/lib/agent/tools/conceptVerifierTool.ts b/src/lib/agent/tools/conceptVerifierTool.ts index 2371d43..d05d3f9 100644 --- a/src/lib/agent/tools/conceptVerifierTool.ts +++ b/src/lib/agent/tools/conceptVerifierTool.ts @@ -1,7 +1,13 @@ import { ToolUtility } from '@azure/ai-projects'; +export const conceptVerifierToolMeta = { + key: 'verifyConceptCoverage', + userDescription: 'Checking for required concepts from the rubric', + icon: '📋', +}; + export const conceptVerifierTool = ToolUtility.createFunctionTool({ - name: 'verifyConceptCoverage', + name: conceptVerifierToolMeta.key, description: 'Checks which rubric‑listed concepts appear (or are missing) in the submission.', parameters: { type: 'object', diff --git a/src/lib/agent/tools/essayAnalyzerTool.ts b/src/lib/agent/tools/essayAnalyzerTool.ts index 2382d38..0ecf705 100644 --- a/src/lib/agent/tools/essayAnalyzerTool.ts +++ b/src/lib/agent/tools/essayAnalyzerTool.ts @@ -1,7 +1,13 @@ import { ToolUtility } from '@azure/ai-projects'; +export const essayAnalyzerToolMeta = { + key: 'analyzeEssay', + userDescription: 'Analyzing essay structure and argument quality', + icon: '📝', +}; + export const essayAnalyzerTool = ToolUtility.createFunctionTool({ - name: 'analyzeEssay', + name: essayAnalyzerToolMeta.key, description: 'Analyzes an essay for structure, argument, and evidence.', parameters: { type: 'object', diff --git a/src/lib/agent/tools/feedbackGeneratorTool.ts b/src/lib/agent/tools/feedbackGeneratorTool.ts index 3a2e4bf..1358db1 100644 --- a/src/lib/agent/tools/feedbackGeneratorTool.ts +++ b/src/lib/agent/tools/feedbackGeneratorTool.ts @@ -1,7 +1,13 @@ import { ToolUtility } from '@azure/ai-projects'; +export const feedbackGeneratorToolMeta = { + key: 'generateFeedback', + userDescription: 'Generating personalized feedback for the student', + icon: '🌟', +}; + export const feedbackGeneratorTool = ToolUtility.createFunctionTool({ - name: 'generateFeedback', + name: feedbackGeneratorToolMeta.key, description: 'Produces two praise points and two actionable “try next time” suggestions based on submission and rubric.', parameters: { type: 'object', diff --git a/src/lib/agent/tools/index.ts b/src/lib/agent/tools/index.ts index b19d8fd..952f9cc 100644 --- a/src/lib/agent/tools/index.ts +++ b/src/lib/agent/tools/index.ts @@ -1,7 +1,7 @@ -export { rubricMatcherTool } from './rubricMatcherTool'; -export { essayAnalyzerTool } from './essayAnalyzerTool'; -export { conceptVerifierTool } from './conceptVerifierTool'; -export { feedbackGeneratorTool } from './feedbackGeneratorTool'; -export { metacognitiveReflectionPromptTool } from './metacognitiveReflectionPromptTool'; -export { selfAssessmentTool } from './selfAssessmentTool'; -export { spellingAndGrammarCheckerTool } from './spellingAndGrammarCheckerTool'; +export { rubricMatcherTool, rubricMatcherToolMeta } from './rubricMatcherTool'; +export { essayAnalyzerTool, essayAnalyzerToolMeta } from './essayAnalyzerTool'; +export { conceptVerifierTool, conceptVerifierToolMeta } from './conceptVerifierTool'; +export { feedbackGeneratorTool, feedbackGeneratorToolMeta } from './feedbackGeneratorTool'; +export { metacognitiveReflectionPromptTool, metacognitiveReflectionPromptToolMeta } from './metacognitiveReflectionPromptTool'; +export { selfAssessmentTool, selfAssessmentToolMeta } from './selfAssessmentTool'; +export { spellingAndGrammarCheckerTool, spellingAndGrammarCheckerToolMeta } from './spellingAndGrammarCheckerTool'; diff --git a/src/lib/agent/tools/metacognitiveReflectionPromptTool.ts b/src/lib/agent/tools/metacognitiveReflectionPromptTool.ts index f98340d..4fcde53 100644 --- a/src/lib/agent/tools/metacognitiveReflectionPromptTool.ts +++ b/src/lib/agent/tools/metacognitiveReflectionPromptTool.ts @@ -1,7 +1,13 @@ import { ToolUtility } from '@azure/ai-projects'; +export const metacognitiveReflectionPromptToolMeta = { + key: 'generateReflectionPrompts', + userDescription: 'Suggesting ways the student can improve next time', + icon: '💭', +}; + export const metacognitiveReflectionPromptTool = ToolUtility.createFunctionTool({ - name: 'generateReflectionPrompts', + name: metacognitiveReflectionPromptToolMeta.key, description: 'Based on rubric shortfalls, generates prompts like “How could you strengthen your evidence in paragraph 2?”', parameters: { type: 'object', diff --git a/src/lib/agent/tools/rubricMatcherTool.ts b/src/lib/agent/tools/rubricMatcherTool.ts index ca79717..3db04fb 100644 --- a/src/lib/agent/tools/rubricMatcherTool.ts +++ b/src/lib/agent/tools/rubricMatcherTool.ts @@ -1,7 +1,13 @@ import { ToolUtility } from '@azure/ai-projects'; +export const rubricMatcherToolMeta = { + key: 'matchRubric', + userDescription: 'Assessing the submission against the provided rubric', + icon: '📊', +}; + export const rubricMatcherTool = ToolUtility.createFunctionTool({ - name: 'matchRubric', + name: rubricMatcherToolMeta.key, description: 'Matches a submission to a rubric and returns a score/criteria breakdown.', parameters: { type: 'object', diff --git a/src/lib/agent/tools/selfAssessmentTool.ts b/src/lib/agent/tools/selfAssessmentTool.ts index b61c95d..eba5dd8 100644 --- a/src/lib/agent/tools/selfAssessmentTool.ts +++ b/src/lib/agent/tools/selfAssessmentTool.ts @@ -1,7 +1,13 @@ import { ToolUtility } from '@azure/ai-projects'; +export const selfAssessmentToolMeta = { + key: 'createSelfAssessment', + userDescription: 'Creating self-reflection questions for the student', + icon: '🔎', +}; + export const selfAssessmentTool = ToolUtility.createFunctionTool({ - name: 'createSelfAssessment', + name: selfAssessmentToolMeta.key, description: 'Generates 3 short questions that prompt the student to reflect on their own work based on rubric gaps.', parameters: { type: 'object', diff --git a/src/lib/agent/tools/spellingAndGrammarCheckerTool.ts b/src/lib/agent/tools/spellingAndGrammarCheckerTool.ts index 49495cd..4dd0abb 100644 --- a/src/lib/agent/tools/spellingAndGrammarCheckerTool.ts +++ b/src/lib/agent/tools/spellingAndGrammarCheckerTool.ts @@ -1,7 +1,13 @@ import { ToolUtility } from '@azure/ai-projects'; +export const spellingAndGrammarCheckerToolMeta = { + key: 'checkSpellingAndGrammar', + userDescription: 'Checking for spelling and grammar mistakes', + icon: '📝', +}; + export const spellingAndGrammarCheckerTool = ToolUtility.createFunctionTool({ - name: 'checkSpellingAndGrammar', + name: spellingAndGrammarCheckerToolMeta.key, description: 'Identifies spelling, punctuation, and syntax issues in the submission and suggests corrections.', parameters: { type: 'object', diff --git a/src/lib/components/AgenticProgress.svelte b/src/lib/components/AgenticProgress.svelte new file mode 100644 index 0000000..cc316d3 --- /dev/null +++ b/src/lib/components/AgenticProgress.svelte @@ -0,0 +1,145 @@ + + + + +
+ +
{statusMessage}
+ +
{liveMessage}
+ +
diff --git a/src/routes/upload/+page.svelte b/src/routes/upload/+page.svelte index c595519..5c2d258 100644 --- a/src/routes/upload/+page.svelte +++ b/src/routes/upload/+page.svelte @@ -1,186 +1,191 @@ -
-

Upload Student Submissions

-

Upload student assignments for instant AI-powered assessment and feedback.

- {#if errorMsg} - - {/if} - {#if submitting} -
- - Loading... - Grading in progress... -
- {#each toolEvents as event, i} -
- 🛠️ {event.tool} - {new Date(event.time).toLocaleTimeString()} -
- {/each} -
-
- {/if} -
-
- - -
-
- - - Or paste the student's submission below. -
-
- - -
- - {#if errorMsg} -
{errorMsg}
- {/if} - {#if successMsg} -
{successMsg}
- {/if} -
+
+

Upload Student Submissions

+

Upload student assignments for instant AI-powered assessment and feedback.

+ {#if errorMsg} + + {/if} + {#if submitting} + + {:else} +
+
+ + +
+
+ + + Or paste the student's submission below. +
+
+ + +
+ + {#if errorMsg} +
{errorMsg}
+ {/if} + {#if successMsg} +
{successMsg}
+ {/if} +
+ {/if}