andy-stack_vaultkeeper-ai/AIClasses/AIToolCall.ts

27 lines
No EOL
857 B
TypeScript

import { AITool } from "Enums/AITool";
// platform agnostic function call class used to execute the requested function
export class AIToolCall {
public readonly name: AITool;
public readonly arguments: Record<string, unknown>;
public readonly toolId?: string;
public readonly thoughtSignature?: string;
constructor(name: AITool, args: Record<string, unknown>, toolId?: string, thoughtSignature?: string) {
this.name = name;
this.arguments = args;
this.toolId = toolId;
this.thoughtSignature = thoughtSignature;
}
public toConversationString() {
return JSON.stringify({
toolCall: {
name: this.name,
args: this.arguments,
id: this.toolId,
thoughtSignature: this.thoughtSignature
}
});
}
}