andy-stack_vaultkeeper-ai/AIClasses/FunctionDefinitions/AIFunctionResponse.ts
Andrew Beal eac7ac13fb Add Claude API provider support with streaming and tool integration
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-19 14:23:24 +01:00

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 }
}
});
}
}