Update openai.yaml
Browse files- openai.yaml +8 -11
openai.yaml
CHANGED
|
@@ -1,17 +1,18 @@
|
|
| 1 |
_id: openai
|
| 2 |
-
|
| 3 |
description: Includes Chat GPT
|
| 4 |
-
version: 1
|
| 5 |
readme: The first base version
|
|
|
|
| 6 |
url: https://huggingface.co/PiperMy/Node-Packages/resolve/main/openai.yaml
|
| 7 |
-
|
| 8 |
nodes:
|
| 9 |
ask_chat_gpt:
|
| 10 |
_id: ask_chat_gpt
|
| 11 |
arrange:
|
| 12 |
-
x:
|
| 13 |
-
y:
|
| 14 |
category:
|
|
|
|
| 15 |
id: llm_agents
|
| 16 |
title: en=Language Agents;ru=Языковые агенты
|
| 17 |
environment:
|
|
@@ -26,6 +27,7 @@ nodes:
|
|
| 26 |
type: string
|
| 27 |
required: true
|
| 28 |
multiline: true
|
|
|
|
| 29 |
model:
|
| 30 |
order: 2
|
| 31 |
title: en=Model;ru=Модель
|
|
@@ -57,7 +59,6 @@ nodes:
|
|
| 57 |
export async function run({ inputs }) {
|
| 58 |
|
| 59 |
const { FatalError, NextNode } = DEFINITIONS;
|
| 60 |
-
|
| 61 |
const OpenAI = require('openai');
|
| 62 |
|
| 63 |
const OPEN_API_KEY = env?.variables?.get('OPEN_API_KEY');
|
|
@@ -83,7 +84,7 @@ nodes:
|
|
| 83 |
|
| 84 |
switch (answerFormat) {
|
| 85 |
case 'text':
|
| 86 |
-
return
|
| 87 |
case 'json':
|
| 88 |
try {
|
| 89 |
const json = answer.replace(/^\`\`\`json\s*/ig, '').replace(/\`\`\`\s*$/ig, '');
|
|
@@ -100,7 +101,3 @@ nodes:
|
|
| 100 |
source: catalog
|
| 101 |
title: en=Ask Chat GPT;ru=Спросить Chat GPT
|
| 102 |
version: 1
|
| 103 |
-
costs: |-
|
| 104 |
-
(() => {
|
| 105 |
-
return 0.001;
|
| 106 |
-
})();
|
|
|
|
| 1 |
_id: openai
|
| 2 |
+
author: Anton Breslavskii | https://github.com/breslavsky
|
| 3 |
description: Includes Chat GPT
|
|
|
|
| 4 |
readme: The first base version
|
| 5 |
+
title: Open AI
|
| 6 |
url: https://huggingface.co/PiperMy/Node-Packages/resolve/main/openai.yaml
|
| 7 |
+
version: 1
|
| 8 |
nodes:
|
| 9 |
ask_chat_gpt:
|
| 10 |
_id: ask_chat_gpt
|
| 11 |
arrange:
|
| 12 |
+
x: 120
|
| 13 |
+
y: 110
|
| 14 |
category:
|
| 15 |
+
_id: llm_agents
|
| 16 |
id: llm_agents
|
| 17 |
title: en=Language Agents;ru=Языковые агенты
|
| 18 |
environment:
|
|
|
|
| 27 |
type: string
|
| 28 |
required: true
|
| 29 |
multiline: true
|
| 30 |
+
default: What time is it now? Only JSON ready to parse.
|
| 31 |
model:
|
| 32 |
order: 2
|
| 33 |
title: en=Model;ru=Модель
|
|
|
|
| 59 |
export async function run({ inputs }) {
|
| 60 |
|
| 61 |
const { FatalError, NextNode } = DEFINITIONS;
|
|
|
|
| 62 |
const OpenAI = require('openai');
|
| 63 |
|
| 64 |
const OPEN_API_KEY = env?.variables?.get('OPEN_API_KEY');
|
|
|
|
| 84 |
|
| 85 |
switch (answerFormat) {
|
| 86 |
case 'text':
|
| 87 |
+
return NextNode.from({ outputs: { answer } });
|
| 88 |
case 'json':
|
| 89 |
try {
|
| 90 |
const json = answer.replace(/^\`\`\`json\s*/ig, '').replace(/\`\`\`\s*$/ig, '');
|
|
|
|
| 101 |
source: catalog
|
| 102 |
title: en=Ask Chat GPT;ru=Спросить Chat GPT
|
| 103 |
version: 1
|
|
|
|
|
|
|
|
|
|
|
|