feat(smartagent): add JsonValidatorTool and support passing base64-encoded images with task runs (vision-capable models); bump @push.rocks/smartai to ^0.12.0

This commit is contained in:
2026-01-20 01:12:03 +00:00
parent 05e4f03061
commit e7968a31b1
9 changed files with 241 additions and 30 deletions

View File

@@ -67,8 +67,10 @@ export class DriverAgent {
/**
* Initialize a new conversation for a task
* @param task The task description
* @param images Optional base64-encoded images for vision tasks
*/
public async startTask(task: string): Promise<interfaces.IAgentMessage> {
public async startTask(task: string, images?: string[]): Promise<interfaces.IAgentMessage> {
// Reset message history
this.messageHistory = [];
@@ -106,6 +108,7 @@ export class DriverAgent {
systemMessage: fullSystemMessage,
userMessage: userMessage,
messageHistory: [],
images: images,
onToken: this.onToken,
});
} else {
@@ -114,14 +117,16 @@ export class DriverAgent {
systemMessage: fullSystemMessage,
userMessage: userMessage,
messageHistory: [],
images: images,
});
}
// Add assistant response to history
this.messageHistory.push({
// Add assistant response to history (store images if provided)
const historyMessage: plugins.smartai.ChatMessage = {
role: 'assistant',
content: response.message,
});
};
this.messageHistory.push(historyMessage);
return {
role: 'assistant',