File size: 4,018 Bytes
b8b3fc1
72ea4c3
4fe2630
b8b3fc1
72ea4c3
1763953
4fe2630
b8b3fc1
 
 
 
4fe2630
 
b8b3fc1
72ea4c3
b8b3fc1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4fe2630
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
_id: together_ai
author: Anton Breslavskii | https://github.com/breslavsky
description: AI models with scalable cloud inference
readme: ""
title: Together AI
url: https://huggingface.co/PiperMy/Node-Packages/resolve/main/together.yaml
version: 5
nodes:
  generate_flux_together_ai:
    _id: generate_flux_together_ai
    arrange:
      x: 130
      y: 80
    category:
      _id: generate_images
      title: en=Generate images;ru=Генерация изображений
    environment:
      TOGETHER_API_KEY:
        title: Together API key
        type: string
        scope: global
    inputs:
      prompt:
        order: 1
        title: Prompt
        type: string
        required: true
        multiline: true
        default: cat at a moon
    outputs:
      image:
        title: Image
        type: image
    package: together_ai
    script: |-
      export async function run({ inputs }) {

          const { FatalError, NextNode } = DEFINITIONS;
          const { prompt } = inputs;

          const TOGETHER_API_KEY = env?.variables?.get('TOGETHER_API_KEY');
          if (!TOGETHER_API_KEY) {
              throw new FatalError('Please, set your API key for Together AI');
          }

          const Together = require('together-ai');
          const together = new Together({ apiKey: TOGETHER_API_KEY });

          const { data } = await together.images.create({
              model: "black-forest-labs/FLUX.1-schnell-Free",
              prompt,
              width: 1024,
              height: 1024,
              steps: 4,
              n: 1
          });
          const [{ url }] = data;
          return NextNode.from({ outputs: { image: url } });

      }
    source: catalog
    title: en=Generate Flux Free;ru=Генерация Flux бесплатно
    version: 1
    execution: deferred
  ask_deepseek_r1_together_ai:
    _id: ask_deepseek_r1_together_ai
    arrange:
      x: 460
      y: 80
    category:
      _id: llm_agents
      title: en=Language Agents;ru=Языковые агенты
    environment:
      TOGETHER_API_KEY:
        title: Together API key
        type: string
        scope: global
    execution: deferred
    inputs:
      instructions:
        order: 1
        title: en=Instructions;ru=Инструкции
        type: string
        multiline: true
        placeholder: en=Leave empty if you don't need it;ru=Оставьте пустым если не требуется
      question:
        order: 2
        title: en=Question;ru=Вопрос
        type: string
        required: true
        multiline: true
        default: What is your name?
    outputs:
      answer:
        title: en=Answer;ru=Ответ
        type: string
    package: together_ai
    script: |-
      export async function run({ inputs }) {

          const { FatalError, NextNode } = DEFINITIONS;
          const { instructions, question } = inputs;

          const TOGETHER_API_KEY = env?.variables?.get('TOGETHER_API_KEY');
          if (!TOGETHER_API_KEY) {
              throw new FatalError('Please, set your API key for Together AI');
          }

          const Together = require('together-ai');
          const together = new Together({ apiKey: TOGETHER_API_KEY });

          const { choices } = await together.chat.completions.create({
              model: "deepseek-ai/DeepSeek-R1-Distill-Llama-70B-free",
              messages: [
                  ...(!!instructions ? [{
                      role: 'system',
                      content: instructions
                  }] : []),
                  ...[
                      {
                          role: 'user',
                          content: question || 'Are you AI?'
                      }
                  ]
              ]
          });
          const [{ message: { content: answer } }] = choices;
          return NextNode.from({ outputs: { answer } });

      }
    source: catalog
    title: en=Ask DeepSeek-R1 free;ru=Спросить DeepSeek-R1 беспл.
    version: 1