mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-16 17:46:45 +00:00
feat(Google Vertex Chat Model Node): Add support for Google Vertex AI Chat models (#9970)
Co-authored-by: oleg <oleg@n8n.io>
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
export interface ErrorLike {
|
||||
message?: string;
|
||||
description?: string;
|
||||
}
|
||||
|
||||
export interface ErrorContext {
|
||||
modelName?: string;
|
||||
}
|
||||
|
||||
export function makeErrorFromStatus(statusCode: number, context?: ErrorContext): ErrorLike {
|
||||
const errorMessages: Record<number, ErrorLike> = {
|
||||
403: {
|
||||
message: 'Unauthorized for this project',
|
||||
description:
|
||||
'Check your Google Cloud project ID, and that your credential has access to that project',
|
||||
},
|
||||
404: {
|
||||
message: context?.modelName
|
||||
? `No model found called '${context.modelName}'`
|
||||
: 'No model found',
|
||||
},
|
||||
};
|
||||
|
||||
return errorMessages[statusCode];
|
||||
}
|
||||
Reference in New Issue
Block a user