feat: Add AI Error Debugging using OpenAI (#8805)

This commit is contained in:
Alex Grozav
2024-03-13 16:48:00 +02:00
committed by GitHub
parent e3dd353ea7
commit 948c383999
26 changed files with 1838 additions and 362 deletions

View File

@@ -2,6 +2,10 @@ import type { IRestApiContext, Schema } from '@/Interface';
import { makeRestApiRequest } from '@/utils/apiUtils';
import type { IDataObject } from 'n8n-workflow';
export interface DebugErrorPayload {
error: Error;
}
export async function generateCodeForPrompt(
ctx: IRestApiContext,
{
@@ -28,3 +32,15 @@ export async function generateCodeForPrompt(
n8nVersion,
} as IDataObject);
}
export const debugError = async (
context: IRestApiContext,
payload: DebugErrorPayload,
): Promise<{ message: string }> => {
return await makeRestApiRequest(
context,
'POST',
'/ai/debug-error',
payload as unknown as IDataObject,
);
};