mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 10:31:15 +00:00
feat: Add AI Error Debugging using OpenAI (#8805)
This commit is contained in:
@@ -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,
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user