mirror of
https://github.com/andy-stack/vaultkeeper-ai.git
synced 2026-07-22 06:42:03 +00:00
20 lines
No EOL
575 B
TypeScript
20 lines
No EOL
575 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;
|
|
|
|
constructor(name: string, response: object) {
|
|
this.name = name;
|
|
this.response = response;
|
|
}
|
|
|
|
public toConversationString(): string {
|
|
return JSON.stringify({
|
|
functionResponse: {
|
|
name: this.name,
|
|
response: { result: this.response }
|
|
}
|
|
});
|
|
}
|
|
} |