mypiper commited on
Commit
324571d
·
verified ·
1 Parent(s): 01c2222

Update gpt4free.yaml

Browse files
Files changed (1) hide show
  1. gpt4free.yaml +87 -14
gpt4free.yaml CHANGED
@@ -1,28 +1,101 @@
1
  _id: gpt4free
2
  author: Anton Breslavskii | https://github.com/breslavsky
3
  description: Free generative AI service providers
4
- readme: Testing release v5
5
  title: GPT for free
6
  url: https://huggingface.co/PiperMy/Node-Packages/resolve/main/gpt4free.yaml
7
- version: 9
8
  nodes:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
  generate_image_gpt4free:
10
  _id: generate_image_gpt4free
11
  arrange:
12
- x: 240
13
- y: 160
14
  category:
15
  _id: generate_images
16
  title: en=Generate images;ru=Генерация изображений
17
  environment: {}
 
18
  inputs:
19
  prompt:
20
- title: Prompt
 
21
  type: string
22
  required: true
23
  multiline: true
24
- default: cat at a moon
25
  model:
 
26
  title: Model
27
  type: string
28
  default: flux
@@ -32,24 +105,24 @@ nodes:
32
  - flux-dev|Flux Dev
33
  outputs:
34
  image:
35
- title: Image
36
  type: image
37
  provider:
38
- title: Provider
39
  type: string
40
  package: gpt4free
41
  script: |
42
  export async function run({ inputs }) {
43
-
44
  const { NextNode } = DEFINITIONS;
45
  const { prompt, model } = inputs;
46
 
47
  const { data: { provider, data: [{ b64_json }] } } = await httpClient({
48
  method: 'post',
49
- url: `http://${NODE_ENV === 'test' ? '0.0.0.0' : 'gpt4free'}:1337/v1/images/generate`,
50
- timeout: 20000,
51
  data: {
52
- prompt,
53
  model: model || 'flux',
54
  response_format: 'b64_json'
55
  },
@@ -57,8 +130,8 @@ nodes:
57
  'Content-Type': 'application/json',
58
  }
59
  });
60
- return NextNode.from({ outputs: { image: Buffer.from(b64_json, 'base64'), provider } });
61
  }
62
  source: catalog
63
- title: en=Generate image for free;ru=Генерация изображения бесплатно
64
  version: 5
 
1
  _id: gpt4free
2
  author: Anton Breslavskii | https://github.com/breslavsky
3
  description: Free generative AI service providers
4
+ readme: Added ask LLM agent
5
  title: GPT for free
6
  url: https://huggingface.co/PiperMy/Node-Packages/resolve/main/gpt4free.yaml
7
+ version: 10
8
  nodes:
9
+ ask_llm_agent_gpt4free:
10
+ _id: ask_llm_agent_gpt4free
11
+ arrange:
12
+ x: 530
13
+ y: 140
14
+ category:
15
+ _id: llm_agents
16
+ title: en=Language Agents;ru=Языковые агенты
17
+ execution: deferred
18
+ inputs:
19
+ instructions:
20
+ order: 1
21
+ title: en=Instructions;ru=Инструкции
22
+ type: string
23
+ multiline: true
24
+ placeholder: en=Leave empty if you don't need it;ru=Оставьте пустым если не требуется
25
+ question:
26
+ order: 2
27
+ title: en=Question;ru=Вопрос
28
+ type: string
29
+ required: true
30
+ multiline: true
31
+ default: Are you AI?
32
+ outputs:
33
+ answer:
34
+ title: en=Answer;ru=Ответ
35
+ type: string
36
+ model:
37
+ title: en=Model;ru=Модель
38
+ type: string
39
+ provider:
40
+ title: en=Provider;ru=Провайдер
41
+ type: string
42
+ package: gpt4free
43
+ script: |
44
+ export async function run({ inputs }) {
45
+
46
+ const { NextNode } = DEFINITIONS;
47
+ const { instructions, question } = inputs;
48
+
49
+ const { data } = await httpClient({
50
+ method: 'post',
51
+ url: `http://${NODE_ENV === 'test' ? '0.0.0.0:8080' : 'gpt4free:1337'}/v1/chat/completions`,
52
+ timeout: 60000,
53
+ data: {
54
+ stream: false,
55
+ messages: [
56
+ ...(!!instructions ? [{
57
+ role: 'system',
58
+ content: instructions
59
+ }] : []),
60
+ ...[
61
+ {
62
+ role: 'user',
63
+ content: question || 'Are you AI?'
64
+ }
65
+ ]
66
+ ]
67
+ },
68
+ headers: {
69
+ 'Content-Type': 'application/json',
70
+ }
71
+ });
72
+
73
+ const { model, provider, choices: [{ message: { content: answer } }] } = data;
74
+ return NextNode.from({ outputs: { answer, model, provider } });
75
+ }
76
+ source: catalog
77
+ title: en=Ask LLM agent for free;ru=Спросить LLM агента бесп.
78
+ version: 1
79
  generate_image_gpt4free:
80
  _id: generate_image_gpt4free
81
  arrange:
82
+ x: 130
83
+ y: 80
84
  category:
85
  _id: generate_images
86
  title: en=Generate images;ru=Генерация изображений
87
  environment: {}
88
+ execution: deferred
89
  inputs:
90
  prompt:
91
+ order: 1
92
+ title: en=Prompt;ru=Подсказка
93
  type: string
94
  required: true
95
  multiline: true
96
+ default: superhero game card
97
  model:
98
+ order: 2
99
  title: Model
100
  type: string
101
  default: flux
 
105
  - flux-dev|Flux Dev
106
  outputs:
107
  image:
108
+ title: en=Image;ru=Изображение
109
  type: image
110
  provider:
111
+ title: en=Provider;ru=Провайдер
112
  type: string
113
  package: gpt4free
114
  script: |
115
  export async function run({ inputs }) {
116
+
117
  const { NextNode } = DEFINITIONS;
118
  const { prompt, model } = inputs;
119
 
120
  const { data: { provider, data: [{ b64_json }] } } = await httpClient({
121
  method: 'post',
122
+ url: `http://${NODE_ENV === 'test' ? '0.0.0.0:8080' : 'gpt4free:1337'}/v1/images/generate`,
123
+ timeout: 60000,
124
  data: {
125
+ prompt: prompt || 'superhero game card',
126
  model: model || 'flux',
127
  response_format: 'b64_json'
128
  },
 
130
  'Content-Type': 'application/json',
131
  }
132
  });
133
+ return NextNode.from({ outputs: { provider, image: Buffer.from(b64_json, 'base64') } });
134
  }
135
  source: catalog
136
+ title: en=Generate image for free;ru=Генерация изобр. бесп.
137
  version: 5