feat: base shortcut code

This commit is contained in:
2025-01-18 21:54:26 +01:00
parent a820b29ea9
commit 3abe88c7a2
29 changed files with 5982 additions and 123 deletions

View File

@@ -0,0 +1,32 @@
import { getMessage } from '@utils/anthropicClient';
import { ShortcutsResponse } from '../types';
export async function anthropicCommand(
parameters: Record<string, string> | undefined
): Promise<ShortcutsResponse> {
try {
if (!parameters || !parameters['question']) {
return {
success: false,
message: 'Sorry. Need to provide a question.'
};
}
const response = await getMessage(
'I want to know ' +
parameters['question'] +
'. Structure the response in a manner suitable for spoken communication.'
);
return {
success: true,
message: response
};
} catch (error) {
console.error(error);
return {
success: false,
message: 'Sorry. There was a problem with Anthropic.'
};
}
}