n8n-nodes-base
Version:
Base nodes of n8n
59 lines (53 loc) • 1.89 kB
text/typescript
/**
* Google Perspective Node - Version 1
* Consume Google Perspective API
*/
export interface GooglePerspectiveV1Params {
operation?: 'analyzeComment';
/**
* Text
* @displayOptions.show { operation: ["analyzeComment"] }
*/
text?: string | Expression<string> | PlaceholderValue;
/**
* Attributes to Analyze
* @displayOptions.show { operation: ["analyzeComment"] }
* @default {}
*/
requestedAttributesUi?: {
/** Properties
*/
requestedAttributesValues?: Array<{
/** Attribute to analyze in the text. Details <a href="https://developers.perspectiveapi.com/s/about-the-api-attributes-and-languages">here</a>.
* @default flirtation
*/
attributeName?: 'flirtation' | 'identity_attack' | 'insult' | 'profanity' | 'severe_toxicity' | 'sexually_explicit' | 'threat' | 'toxicity' | Expression<string>;
/** Score above which to return results. At zero, all scores are returned.
* @default 0
*/
scoreThreshold?: number | Expression<number>;
}>;
};
/**
* Options
* @displayOptions.show { operation: ["analyzeComment"] }
* @default {}
*/
options?: {
/** Languages of the text input. If unspecified, the API will auto-detect the comment language. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.
*/
languages?: string | Expression<string>;
};
}
export interface GooglePerspectiveV1Credentials {
googlePerspectiveOAuth2Api: CredentialReference;
}
interface GooglePerspectiveV1NodeBase {
type: 'n8n-nodes-base.googlePerspective';
version: 1;
credentials?: GooglePerspectiveV1Credentials;
}
export type GooglePerspectiveV1ParamsNode = GooglePerspectiveV1NodeBase & {
config: NodeConfig<GooglePerspectiveV1Params>;
};
export type GooglePerspectiveV1Node = GooglePerspectiveV1ParamsNode;