mirror of
https://gitee.com/ByteDance/flowgram.ai.git
synced 2025-07-07 17:43:29 +08:00
55 lines
1.1 KiB
TypeScript
55 lines
1.1 KiB
TypeScript
import { nanoid } from 'nanoid';
|
|
|
|
import { FlowNodeRegistry } from '../../typings';
|
|
import iconLLM from '../../assets/icon-llm.jpg';
|
|
|
|
let index = 0;
|
|
export const LLMNodeRegistry: FlowNodeRegistry = {
|
|
type: 'llm',
|
|
info: {
|
|
icon: iconLLM,
|
|
description:
|
|
'Call the large language model and use variables and prompt words to generate responses.',
|
|
},
|
|
meta: {
|
|
size: {
|
|
width: 360,
|
|
height: 94,
|
|
},
|
|
},
|
|
onAdd() {
|
|
return {
|
|
id: `llm_${nanoid(5)}`,
|
|
type: 'llm',
|
|
data: {
|
|
title: `LLM_${++index}`,
|
|
inputsValues: {},
|
|
inputs: {
|
|
type: 'object',
|
|
required: ['modelType', 'temperature', 'prompt'],
|
|
properties: {
|
|
modelType: {
|
|
type: 'string',
|
|
},
|
|
temperature: {
|
|
type: 'number',
|
|
},
|
|
systemPrompt: {
|
|
type: 'string',
|
|
},
|
|
prompt: {
|
|
type: 'string',
|
|
},
|
|
},
|
|
},
|
|
outputs: {
|
|
type: 'object',
|
|
properties: {
|
|
result: { type: 'string' },
|
|
},
|
|
},
|
|
},
|
|
};
|
|
},
|
|
};
|