mirror of
https://github.com/jcreek/AutomatedAssessmentFeedbackAgent.git
synced 2026-07-12 18:43:49 +00:00
fix(*): Handle tools correctly
This commit is contained in:
@@ -23,10 +23,10 @@ export const client = AIProjectsClient.fromConnectionString(
|
|||||||
new DefaultAzureCredential()
|
new DefaultAzureCredential()
|
||||||
);
|
);
|
||||||
|
|
||||||
const codeInterpreterTool = ToolUtility.createCodeInterpreterTool([]);
|
// const codeInterpreterTool = ToolUtility.createCodeInterpreterTool([]);
|
||||||
|
|
||||||
const allTools = [
|
const allTools = [
|
||||||
codeInterpreterTool,
|
// codeInterpreterTool,
|
||||||
rubricMatcherTool,
|
rubricMatcherTool,
|
||||||
essayAnalyzerTool,
|
essayAnalyzerTool,
|
||||||
conceptVerifierTool,
|
conceptVerifierTool,
|
||||||
@@ -51,12 +51,18 @@ Whenever you need to:
|
|||||||
• check spelling & grammar → call "${spellingAndGrammarCheckerTool.definition.name}"
|
• check spelling & grammar → call "${spellingAndGrammarCheckerTool.definition.name}"
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const toolResources = allTools.reduce<Record<string, any>>((map, t) => {
|
export const toolResources = allTools.reduce<Record<string, any>>((map, t) => {
|
||||||
if (typeof t === 'function') {
|
// Try all plausible locations for the tool name
|
||||||
map[t.definition.name] = t;
|
const name =
|
||||||
} else {
|
t.definition.name ||
|
||||||
map[t.definition.name] = t.resources;
|
t.definition.function?.name ||
|
||||||
|
Object.keys(t.resources ?? {})[0];
|
||||||
|
|
||||||
|
if (!name) {
|
||||||
|
console.warn('Tool missing name:', t);
|
||||||
|
return map;
|
||||||
}
|
}
|
||||||
|
map[name] = t;
|
||||||
return map;
|
return map;
|
||||||
}, {});
|
}, {});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user