mirror of
https://github.com/n8n-io/n8n-nodes-starter.git
synced 2025-11-05 00:22:26 -06:00
Add DO Gradient Serverless Inference Node
This commit is contained in:
parent
67ee5b8e80
commit
c3c675ff33
19 changed files with 5765 additions and 628 deletions
55
nodes/ServerlessInferenceNode/ServerlessInference.node.ts
Normal file
55
nodes/ServerlessInferenceNode/ServerlessInference.node.ts
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
import { INodeType, INodeTypeDescription, NodeConnectionType } from 'n8n-workflow';
|
||||
|
||||
import { textFields, textOperations } from './TextDescription';
|
||||
|
||||
const baseURL = 'https://inference.do-ai.run/v1';
|
||||
|
||||
export class ServerlessInference implements INodeType {
|
||||
description: INodeTypeDescription = {
|
||||
displayName: 'DigitalOcean Gradient™ AI Serverless Inference',
|
||||
documentationUrl: 'https://gradientai-sdk.digitalocean.com/api/resources/chat/subresources/completions/methods/create',
|
||||
name: 'digitalOceanGradientServerlessInference',
|
||||
icon: { light: 'file:DO-Gradient-AI-Agentic-Cloud-logo.svg', dark: 'file:DO-gradient-ai-logo-white.svg' },
|
||||
group: ['transform'],
|
||||
version: [1, 1.0],
|
||||
subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
|
||||
description: 'Consume DigitalOcean Gradient™ AI Serverless Inference',
|
||||
defaults: {
|
||||
name: 'DigitalOcean Gradient™ AI Serverless Inference',
|
||||
},
|
||||
inputs: [NodeConnectionType.Main],
|
||||
outputs: [NodeConnectionType.Main],
|
||||
credentials: [
|
||||
{
|
||||
name: 'digitalOceanServerlessInference',
|
||||
required: true,
|
||||
},
|
||||
],
|
||||
requestDefaults: {
|
||||
ignoreHttpStatusErrors: true,
|
||||
baseURL,
|
||||
headers: {
|
||||
Accept: 'application/json',
|
||||
'Content-Type': 'application/json',
|
||||
'User-Agent': 'Gradient/n8n/1.0.0',
|
||||
},
|
||||
},
|
||||
properties: [
|
||||
{
|
||||
displayName: 'Resource',
|
||||
name: 'resource',
|
||||
type: 'options',
|
||||
noDataExpression: true,
|
||||
options: [
|
||||
{
|
||||
name: 'Text',
|
||||
value: 'text',
|
||||
},
|
||||
],
|
||||
default: 'text',
|
||||
},
|
||||
...textOperations,
|
||||
...textFields,
|
||||
],
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue