mirror of
https://github.com/andy-stack/vaultkeeper-ai.git
synced 2026-07-22 16:30:27 +00:00
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
23 lines
No EOL
688 B
TypeScript
23 lines
No EOL
688 B
TypeScript
// Platform agnostic class for function responses
|
|
// Used by AI providers to format function execution results for API calls
|
|
export class AIFunctionResponse {
|
|
public readonly name: string;
|
|
public readonly response: object;
|
|
public readonly toolId?: string;
|
|
|
|
constructor(name: string, response: object, toolId?: string) {
|
|
this.name = name;
|
|
this.response = response;
|
|
this.toolId = toolId;
|
|
}
|
|
|
|
public toConversationString(): string {
|
|
return JSON.stringify({
|
|
id: this.toolId,
|
|
functionResponse: {
|
|
name: this.name,
|
|
response: { result: this.response }
|
|
}
|
|
});
|
|
}
|
|
} |