-
Notifications
You must be signed in to change notification settings - Fork 12
/
__init__.py
488 lines (431 loc) · 21.6 KB
/
__init__.py
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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
"""
@author: Jason Schleifer
@title: ComfyUI Griptape Nodes
@nickname: ComfyUI-Griptape
@description: This extension offers various nodes that allow you to work with LLMs using the Griptape Python Framework (https://griptape.ai)
"""
import os
from dotenv import load_dotenv
# AGENT
from .nodes.agent.CreateAgent import CreateAgent
from .nodes.agent.gtUICreateAgentFromConfig import gtUICreateAgentFromConfig
from .nodes.agent.gtUIReplaceRulesetsOnAgent import gtUIReplaceRulesetsOnAgent
from .nodes.agent.gtUIReplaceToolsOnAgent import gtUIReplaceToolsOnAgent
from .nodes.agent.gtUISetDefaultAgent import gtUISetDefaultAgent
from .nodes.agent.RunAgent import RunAgent
# COMBINE
from .nodes.combine.gtUIMergeInputs import gtUIMergeInputs
from .nodes.combine.gtUIModuleList import gtUIModuleList
from .nodes.combine.MergeTexts import MergeTexts
from .nodes.combine.RulesList import RulesList
from .nodes.combine.ToolList import ToolList
# CONFIG
from .nodes.config.depricated.gtUIAmazonBedrockStructureConfig import (
gtUIAmazonBedrockStructureConfig,
)
# CONFIG - DEPRICATED
from .nodes.config.depricated.gtUIAnthropicStructureConfig import (
gtUIAnthropicStructureConfig,
)
from .nodes.config.depricated.gtUIAzureOpenAiStructureConfig import (
gtUIAzureOpenAiStructureConfig,
)
from .nodes.config.depricated.gtUIGoogleStructureConfig import gtUIGoogleStructureConfig
from .nodes.config.depricated.gtUIHuggingFaceStructureConfig import (
gtUIHuggingFaceStructureConfig,
)
from .nodes.config.depricated.gtUILMStudioStructureConfig import (
gtUILMStudioStructureConfig,
)
from .nodes.config.depricated.gtUIOllamaStructureConfig import gtUIOllamaStructureConfig
from .nodes.config.depricated.gtUIOpenAiCompatibleConfig import (
gtUIOpenAiCompatibleConfig,
)
from .nodes.config.depricated.gtUIOpenAiStructureConfig import gtUIOpenAiStructureConfig
from .nodes.config.gtUIAmazonBedrockDriversConfig import gtUIAmazonBedrockDriversConfig
from .nodes.config.gtUIAmazonBedrockSession import gtUIAmazonBedrockSession
from .nodes.config.gtUIAnthropicDriversConfig import gtUIAnthropicDriversConfig
from .nodes.config.gtUIAzureOpenAiDriversConfig import gtUIAzureOpenAiDriversConfig
from .nodes.config.gtUICohereDriversConfig import gtUICohereDriversConfig
from .nodes.config.gtUIEnvConfig import gtUIEnvConfig
from .nodes.config.gtUIGoogleDriversConfig import gtUIGoogleDriversConfig
from .nodes.config.gtUIHuggingFaceDriversConfig import gtUIHuggingFaceDriversConfig
from .nodes.config.gtUILMStudioDriversConfig import gtUILMStudioDriversConfig
from .nodes.config.gtUIOllamaDriversConfig import gtUIOllamaDriversConfig
from .nodes.config.gtUIOpenAiCompatibleDriversConfig import (
gtUIOpenAiCompatibleDriversConfig,
)
from .nodes.config.gtUIOpenAiDriversConfig import gtUIOpenAiDriversConfig
from .nodes.config.gtUIStructureConfig import gtUIStructureConfig
# CONVERT
from .nodes.convert.gtUITextToClipEncode import gtUITextToClipEncode
from .nodes.convert.gtUITextToCombo import gtUITextToCombo
# Load the routes
from .nodes.custom_routes import init_routes
# DISPLAY
from .nodes.display.gtUIOutputDataNode import gtUIOutputDataNode
from .nodes.display.gtUIOutputImageNode import gtUIOutputImageNode
from .nodes.display.gtUIOutputStringNode import gtUIOutputStringNode
# DRIVERS
# - Amazon Bedrock
from .nodes.drivers.gtUIAmazonBedrockPromptDriver import gtUIAmazonBedrockPromptDriver
from .nodes.drivers.gtUIAmazonBedrockStableDiffusionImageGenerationDriver import (
gtUIAmazonBedrockStableDiffusionImageGenerationDriver,
)
from .nodes.drivers.gtUIAmazonBedrockTitanEmbeddingDriver import (
gtUIAmazonBedrockTitanEmbeddingDriver,
)
from .nodes.drivers.gtUIAmazonBedrockTitanImageGenerationDriver import (
gtUIAmazonBedrockTitanImageGenerationDriver,
)
# - Amazon OpenSearch
from .nodes.drivers.gtUIAmazonOpenSearchVectorStoreDriver import (
gtUIAmazonOpenSearchVectorStoreDriver,
)
# - Amazon SageMaker Jumpstart
from .nodes.drivers.gtUIAmazonSageMakerJumpstartEmbeddingDriver import (
gtUIAmazonSageMakerJumpstartEmbeddingDriver,
)
from .nodes.drivers.gtUIAmazonSageMakerJumpstartPromptDriver import (
gtUIAmazonSageMakerJumpstartPromptDriver,
)
# - Anthropic
# from .nodes.drivers.gtUIAnthropicImageQueryDriver import gtUIAnthropicImageQueryDriver
from .nodes.drivers.gtUIAnthropicPromptDriver import gtUIAnthropicPromptDriver
from .nodes.drivers.gtUIAzureMongoDbVectorStoreDriver import (
gtUIAzureMongoDbVectorStoreDriver,
)
# - Azure
from .nodes.drivers.gtUIAzureOpenAiChatPromptDriver import (
gtUIAzureOpenAiChatPromptDriver,
)
from .nodes.drivers.gtUIAzureOpenAiEmbeddingDriver import gtUIAzureOpenAiEmbeddingDriver
from .nodes.drivers.gtUIAzureOpenAiImageGenerationDriver import (
gtUIAzureOpenAiImageGenerationDriver,
)
# - Cohere
from .nodes.drivers.gtUICohereEmbeddingDriver import gtUICohereEmbeddingDriver
from .nodes.drivers.gtUICoherePromptDriver import gtUICoherePromptDriver
from .nodes.drivers.gtUICohereRerankDriver import gtUICohereRerankDriver
# - DuckDuckGo
from .nodes.drivers.gtUIDuckDuckGoWebSearchDriver import gtUIDuckDuckGoWebSearchDriver
# - ElevenLabs
from .nodes.drivers.gtUIElevenLabsTextToSpeechDriver import (
gtUIElevenLabsTextToSpeechDriver,
)
# - Exa
from .nodes.drivers.gtUIExaWebSearchDriver import gtUIExaWebSearchDriver
# - Google
from .nodes.drivers.gtUIGoogleEmbeddingDriver import gtUIGoogleEmbeddingDriver
from .nodes.drivers.gtUIGooglePromptDriver import gtUIGooglePromptDriver
from .nodes.drivers.gtUIGoogleWebSearchDriver import gtUIGoogleWebSearchDriver
# - Griptape
from .nodes.drivers.gtUIGriptapeCloudVectorStoreDriver import (
gtUIGriptapeCloudVectorStoreDriver,
)
# - HuggingFace
from .nodes.drivers.gtUIHuggingFaceHubEmbeddingDriver import (
gtUIHuggingFaceHubEmbeddingDriver,
)
from .nodes.drivers.gtUIHuggingFaceHubPromptDriver import gtUIHuggingFaceHubPromptDriver
# - Leonardo.AI
from .nodes.drivers.gtUILeonardoImageGenerationDriver import (
gtUILeonardoImageGenerationDriver,
)
# - LM Studio
from .nodes.drivers.gtUILMStudioChatPromptDriver import gtUILMStudioChatPromptDriver
from .nodes.drivers.gtUILMStudioEmbeddingDriver import gtUILMStudioEmbeddingDriver
# - Local
from .nodes.drivers.gtUILocalVectorStoreDriver import gtUILocalVectorStoreDriver
# - Marqo
from .nodes.drivers.gtUIMarqoVectorStoreDriver import gtUIMarqoVectorStoreDriver
# - Mongodb
from .nodes.drivers.gtUIMongoDbAtlasVectorStoreDriver import (
gtUIMongoDbAtlasVectorStoreDriver,
)
# - Ollama
from .nodes.drivers.gtUIOllamaEmbeddingDriver import gtUIOllamaEmbeddingDriver
from .nodes.drivers.gtUIOllamaPromptDriver import gtUIOllamaPromptDriver
# - OpenAI
from .nodes.drivers.gtUIOpenAiAudioTranscriptionDriver import (
gtUIOpenAiAudioTranscriptionDriver,
)
from .nodes.drivers.gtUIOpenAiChatPromptDriver import gtUIOpenAiChatPromptDriver
from .nodes.drivers.gtUIOpenAiCompatibleChatPromptDriver import (
gtUIOpenAiCompatibleChatPromptDriver,
)
from .nodes.drivers.gtUIOpenAiCompatibleEmbeddingDriver import (
gtUIOpenAiCompatibleEmbeddingDriver,
)
from .nodes.drivers.gtUIOpenAiCompatibleImageGenerationDriver import (
gtUIOpenAiCompatibleImageGenerationDriver,
)
from .nodes.drivers.gtUIOpenAiEmbeddingDriver import gtUIOpenAiEmbeddingDriver
from .nodes.drivers.gtUIOpenAiImageGenerationDriver import (
gtUIOpenAiImageGenerationDriver,
)
from .nodes.drivers.gtUIOpenAiTextToSpeechDriver import gtUIOpenAiTextToSpeechDriver
# - PGVector
from .nodes.drivers.gtUIPgVectorVectorStoreDriver import gtUIPgVectorVectorStoreDriver
# - Pinecone
from .nodes.drivers.gtUIPineconeVectorStoreDriver import gtUIPineconeVectorStoreDriver
# - Qdrant
from .nodes.drivers.gtUIQdrantVectorStoreDriver import gtUIQdrantVectorStoreDriver
# - Redis
from .nodes.drivers.gtUIRedisVectorStoreDriver import gtUIRedisVectorStoreDriver
# - Tavily
from .nodes.drivers.gtUITavilyWebSearchDriver import gtUITavilyWebSearchDriver
# - Voyage AI
from .nodes.drivers.gtUIVoyageAiEmbeddingDriver import gtUIVoyageAiEmbeddingDriver
from .nodes.expand.ExpandAgent import ExpandAgent
from .nodes.expand.gtUIExpandConfig import gtUIExpandConfig
# LOADERS
from .nodes.loaders.gtUIFetchImage import gtUIFetchImage
from .nodes.loaders.gtUILoadAudio import gtUILoadAudio
from .nodes.loaders.gtUILoadText import gtUILoadText
from .nodes.rag.gtUIFootnotePromptResponseRagModule import (
gtUIFootnotePromptResponseRagModule,
)
from .nodes.rag.gtUIPromptResponseRagModule import gtUIPromptResponseRagModule
# RAG
from .nodes.rag.gtUIRagEngine import gtUIRagEngine
from .nodes.rag.gtUITextChunksRerankRagModule import gtUITextChunksRerankRagModule
from .nodes.rag.gtUITextChunksResponseRagModule import gtUITextChunksResponseRagModule
from .nodes.rag.gtUITextLoaderRetrievalRagModule import gtUITextLoaderRetrievalRagModule
from .nodes.rag.gtUITranslateQueryRagModule import gtUITranslateQueryRagModule
from .nodes.rag.gtUIVectorStoreRetrievalRagModule import (
gtUIVectorStoreRetrievalRagModule,
)
# RULES
from .nodes.rules.gtUIRule import gtUIRule
# TASKS
# - Audio
from .nodes.tasks.gtUIAudioTranscriptionTask import gtUIAudioTranscriptionTask
# - Image
from .nodes.tasks.gtUIImageQueryTask import gtUIImageQueryTask
from .nodes.tasks.gtUIParallelImageQueryTask import gtUIParallelImageQueryTask
from .nodes.tasks.gtUIPromptImageGenerationTask import gtUIPromptImageGenerationTask
from .nodes.tasks.gtUIPromptImageVariationTask import gtUIPromptImageVariationTask
from .nodes.tasks.gtUIPromptTask import gtUIPromptTask
# - Text
from .nodes.tasks.gtUITextSummaryTask import gtUITextSummaryTask
from .nodes.tasks.gtUITextToSpeechTask import gtUITextToSpeechTask
# - Tool
from .nodes.tasks.gtUIToolkitTask import gtUIToolkitTask
from .nodes.tasks.gtUIToolTask import gtUIToolTask
# - Vector Store
from .nodes.tasks.gtUIVectorStoreQueryTask import gtUIVectorStoreQueryTask
from .nodes.tasks.gtUIVectorStoreUpsertTextTask import gtUIVectorStoreUpsertTextTask
# TEXT
from .nodes.text.gtUICLIPTextEncode import gtUICLIPTextEncode
from .nodes.text.gtUIInputStringNode import gtUIInputStringNode
from .nodes.text.gtUISaveText import gtUISaveText
# TOOLS
from .nodes.tools.gtUIAudioTranscriptionClient import gtUIAudioTranscriptionClient
from .nodes.tools.gtUICalculator import gtUICalculator
from .nodes.tools.gtUIConvertAgentToTool import gtUIConvertAgentToTool
from .nodes.tools.gtUIDateTime import gtUIDateTime
from .nodes.tools.gtUIExtractionTool import gtUIExtractionTool
from .nodes.tools.gtUIFileManager import gtUIFileManager
from .nodes.tools.gtUIKnowledgeBaseTool import gtUIKnowledgeBaseTool
from .nodes.tools.gtUIPromptSummaryTool import gtUIPromptSummaryTool
from .nodes.tools.gtUIQueryTool import gtUIQueryTool
from .nodes.tools.gtUIRagTool import gtUIRagTool
from .nodes.tools.gtUITextToSpeechClient import gtUITextToSpeechClient
from .nodes.tools.gtUIVectorStoreClient import gtUIVectorStoreClient
from .nodes.tools.gtUIWebScraper import gtUIWebScraper
from .nodes.tools.gtUIWebSearch import gtUIWebSearch
# UTILS
from .nodes.utils.gtUICreateAgentModelfile import gtUICreateAgentModelfile
from .nodes.utils.gtUICreateModelFromModelfile import gtUICreateModelFromModelfile
from .nodes.utils.gtUIRemoveOllamaModel import gtUIRemoveOllamaModel
# CONFIG
from .py.griptape_config import (
load_and_prepare_config,
)
from .py.griptape_settings import GriptapeSettings
# Setup to compute file paths relative to the directory containing this script
THIS_DIR = os.path.dirname(os.path.abspath(__file__))
DEFAULT_CONFIG_FILE = os.path.join(THIS_DIR, "griptape_config.json.default")
USER_CONFIG_FILE = os.path.join(THIS_DIR, "griptape_config.json")
# Load existing environment variables
load_dotenv()
print("\n\033[34m[Griptape Custom Nodes]:\033[0m")
# Initialize the routes
init_routes()
# Now load and prepare the configuration
config = load_and_prepare_config(DEFAULT_CONFIG_FILE, USER_CONFIG_FILE)
NODE_CLASS_MAPPINGS = {}
NODE_DISPLAY_NAME_MAPPINGS = {}
WEB_DIRECTORY = "./js"
NODE_CLASS_MAPPINGS = {
# AGENT
"Griptape Create: Agent": CreateAgent,
"Griptape Create: Agent from Config": gtUICreateAgentFromConfig,
"Griptape Run: Agent": RunAgent,
"Griptape Run: Prompt Task": gtUIPromptTask,
"Griptape Run: Text Summary": gtUITextSummaryTask,
"Griptape Run: Tool Task": gtUIToolTask,
"Griptape Run: Toolkit Task": gtUIToolkitTask,
# "Gt Run Agent": gtUIRunAgent,
"Griptape Expand: Agent Nodes": ExpandAgent,
"Griptape Set: Default Agent": gtUISetDefaultAgent,
# AGENT CONFIG
"Griptape Agent Config: Custom Structure": gtUIStructureConfig,
"Griptape Agent Config: Environment Variables": gtUIEnvConfig,
"Griptape Agent Config: Expand": gtUIExpandConfig,
"Griptape Agent Config: Amazon Bedrock Drivers": gtUIAmazonBedrockDriversConfig,
"Griptape Agent Config: Anthropic Drivers": gtUIAnthropicDriversConfig,
"Griptape Agent Config: Azure OpenAI Drivers": gtUIAzureOpenAiDriversConfig,
"Griptape Agent Config: Cohere Drivers": gtUICohereDriversConfig,
"Griptape Agent Config: Google Drivers": gtUIGoogleDriversConfig,
"Griptape Agent Config: HuggingFace Drivers": gtUIHuggingFaceDriversConfig,
"Griptape Agent Config: LM Studio Drivers": gtUILMStudioDriversConfig,
"Griptape Agent Config: Ollama Drivers": gtUIOllamaDriversConfig,
"Griptape Agent Config: OpenAI Drivers": gtUIOpenAiDriversConfig,
"Griptape Agent Config: OpenAI Compatible Drivers": gtUIOpenAiCompatibleDriversConfig,
# DEPRICATED
"Griptape Agent Config: Amazon Bedrock [DEPRICATED]": gtUIAmazonBedrockStructureConfig,
"Griptape Agent Config: Anthropic [DEPRICATED]": gtUIAnthropicStructureConfig,
"Griptape Agent Config: Azure OpenAI [DEPRICATED]": gtUIAzureOpenAiStructureConfig,
"Griptape Agent Config: Google [DEPRICATED]": gtUIGoogleStructureConfig,
"Griptape Agent Config: HuggingFace [DEPRICATED]": gtUIHuggingFaceStructureConfig,
"Griptape Agent Config: LM Studio [DEPRICATED]": gtUILMStudioStructureConfig,
"Griptape Agent Config: Ollama [DEPRICATED]": gtUIOllamaStructureConfig,
"Griptape Agent Config: OpenAI [DEPRICATED]": gtUIOpenAiStructureConfig,
"Griptape Agent Config: OpenAI Compatible [DEPRICATED]": gtUIOpenAiCompatibleConfig,
# PROMPT DRIVER
"Griptape Prompt Driver: Amazon Bedrock": gtUIAmazonBedrockPromptDriver,
"Griptape Prompt Driver: Amazon SageMaker Jumpstart": gtUIAmazonSageMakerJumpstartPromptDriver,
"Griptape Prompt Driver: Anthropic": gtUIAnthropicPromptDriver,
"Griptape Prompt Driver: Azure OpenAI": gtUIAzureOpenAiChatPromptDriver,
"Griptape Prompt Driver: Cohere": gtUICoherePromptDriver,
"Griptape Prompt Driver: Google": gtUIGooglePromptDriver,
"Griptape Prompt Driver: HuggingFace": gtUIHuggingFaceHubPromptDriver,
"Griptape Prompt Driver: LM Studio": gtUILMStudioChatPromptDriver,
"Griptape Prompt Driver: Ollama": gtUIOllamaPromptDriver,
"Griptape Prompt Driver: OpenAI": gtUIOpenAiChatPromptDriver,
"Griptape Prompt Driver: OpenAI Compatible": gtUIOpenAiCompatibleChatPromptDriver,
# IMAGE GENERATION DRIVERS
"Griptape Driver: Amazon Bedrock Stable Diffusion": gtUIAmazonBedrockStableDiffusionImageGenerationDriver,
"Griptape Driver: Amazon Bedrock Titan": gtUIAmazonBedrockTitanImageGenerationDriver,
"Griptape Driver: Azure OpenAI Image Generation": gtUIAzureOpenAiImageGenerationDriver,
"Griptape Driver: Leonardo.AI": gtUILeonardoImageGenerationDriver,
"Griptape Driver: OpenAI Image Generation": gtUIOpenAiImageGenerationDriver,
"Griptape Driver: OpenAI Compatible Image Generation": gtUIOpenAiCompatibleImageGenerationDriver,
# EMBEDDING DRIVER
"Griptape Embedding Driver: Amazon Bedrock Titan": gtUIAmazonBedrockTitanEmbeddingDriver,
"Griptape Embedding Driver: Amazon SageMaker Jumpstart": gtUIAmazonSageMakerJumpstartEmbeddingDriver,
"Griptape Embedding Driver: Azure OpenAI": gtUIAzureOpenAiEmbeddingDriver,
"Griptape Embedding Driver: Cohere": gtUICohereEmbeddingDriver,
"Griptape Embedding Driver: Google": gtUIGoogleEmbeddingDriver,
"Griptape Embedding Driver: HuggingFace": gtUIHuggingFaceHubEmbeddingDriver,
"Griptape Embedding Driver: LM Studio": gtUILMStudioEmbeddingDriver,
"Griptape Embedding Driver: Ollama": gtUIOllamaEmbeddingDriver,
"Griptape Embedding Driver: OpenAI": gtUIOpenAiEmbeddingDriver,
"Griptape Embedding Driver: OpenAI Compatible": gtUIOpenAiCompatibleEmbeddingDriver,
"Griptape Embedding Driver: Voyage AI": gtUIVoyageAiEmbeddingDriver,
# RERANK DRIVER
"Griptape Rerank Driver: Cohere": gtUICohereRerankDriver,
# VECTOR STORE DRIVERS
"Griptape Vector Store Driver: Amazon OpenSearch": gtUIAmazonOpenSearchVectorStoreDriver,
"Griptape Vector Store Driver: Azure MongoDB": gtUIAzureMongoDbVectorStoreDriver,
"Griptape Vector Store Driver: Griptape Cloud": gtUIGriptapeCloudVectorStoreDriver,
"Griptape Vector Store Driver: Marqo": gtUIMarqoVectorStoreDriver,
"Griptape Vector Store Driver: MongoDB Atlas": gtUIMongoDbAtlasVectorStoreDriver,
"Griptape Vector Store Driver: Local": gtUILocalVectorStoreDriver,
"Griptape Vector Store Driver: PGVector": gtUIPgVectorVectorStoreDriver,
"Griptape Vector Store Driver: Pinecone": gtUIPineconeVectorStoreDriver,
"Griptape Vector Store Driver: Redis": gtUIRedisVectorStoreDriver,
"Griptape Vector Store Driver: Qdrant": gtUIQdrantVectorStoreDriver,
# TEXT TO SPEECH DRIVERS
"Griptape Text To Speech Driver: ElevenLabs": gtUIElevenLabsTextToSpeechDriver,
"Griptape Text To Speech Driver: OpenAI": gtUIOpenAiTextToSpeechDriver,
# AUDIO DRIVERS
"Griptape Audio Transcription Driver: OpenAI": gtUIOpenAiAudioTranscriptionDriver,
# WEBSEARCH DRIVERS
"Griptape WebSearch Driver: DuckDuckGo": gtUIDuckDuckGoWebSearchDriver,
"Griptape WebSearch Driver: Exa": gtUIExaWebSearchDriver,
"Griptape WebSearch Driver: Google": gtUIGoogleWebSearchDriver,
"Griptape WebSearch Driver: Tavily": gtUITavilyWebSearchDriver,
# AGENT RULES
"Griptape Create: Rules": gtUIRule,
"Griptape Combine: Rules List": RulesList,
"Griptape Replace: Rulesets on Agent": gtUIReplaceRulesetsOnAgent,
# TASKS
# # STRUCTURES
# "Griptape Create: Pipeline": gtUICreatePipeline,
# "Griptape Run: Structure": gtUIRunStructure,
# "Griptape Pipeline: Add Task": gtUIPipelineAddTask,
# "Griptape Pipeline: Insert Task": gtUIPipelineInsertTask,
# AGENT TOOLS
"Griptape Convert: Agent to Tool": gtUIConvertAgentToTool,
"Griptape Combine: Tool List": ToolList,
"Griptape Replace: Tools on Agent": gtUIReplaceToolsOnAgent,
"Griptape Tool: Audio Transcription": gtUIAudioTranscriptionClient,
"Griptape Tool: Calculator": gtUICalculator,
"Griptape Tool: DateTime": gtUIDateTime,
"Griptape Tool: FileManager": gtUIFileManager,
"Griptape Tool: Griptape Cloud KnowledgeBase": gtUIKnowledgeBaseTool,
"Griptape Tool: Text to Speech": gtUITextToSpeechClient,
"Griptape Tool: VectorStore": gtUIVectorStoreClient,
"Griptape Tool: RAG": gtUIRagTool,
"Griptape Tool: WebScraper": gtUIWebScraper,
"Griptape Tool: WebSearch": gtUIWebSearch,
"Griptape Tool: Extraction": gtUIExtractionTool,
"Griptape Tool: Prompt Summary": gtUIPromptSummaryTool,
"Griptape Tool: Query": gtUIQueryTool,
# AGENT UTILS
"Griptape Util: Create Agent Modelfile": gtUICreateAgentModelfile,
"Griptape Util: Create Model from Modelfile": gtUICreateModelFromModelfile,
"Griptape Util: Remove Ollama Model": gtUIRemoveOllamaModel,
# DISPLAY
"Griptape Display: Image": gtUIOutputImageNode,
"Griptape Display: Text": gtUIOutputStringNode,
"Griptape Display: Data as Text": gtUIOutputDataNode,
# AUDIO
"Griptape Run: Audio Transcription": gtUIAudioTranscriptionTask,
"Griptape Run: Text to Speech": gtUITextToSpeechTask,
"Griptape Load: Audio": gtUILoadAudio,
# Image
"Griptape Create: Image from Text": gtUIPromptImageGenerationTask,
"Griptape Create: Image Variation": gtUIPromptImageVariationTask,
"Griptape Run: Image Description": gtUIImageQueryTask,
"Griptape Run: Parallel Image Description": gtUIParallelImageQueryTask,
"Griptape Load: Image From URL": gtUIFetchImage,
# TEXT
"Griptape Create: Text": gtUIInputStringNode,
"Griptape Create: CLIP Text Encode": gtUICLIPTextEncode,
"Griptape Convert: Text to CLIP Encode": gtUITextToClipEncode,
"Griptape Convert: Text to Combo": gtUITextToCombo,
"Griptape Combine: Merge Texts": MergeTexts,
"Griptape Combine: Merge Inputs": gtUIMergeInputs,
"Griptape Load: Text": gtUILoadText,
"Griptape Save: Text": gtUISaveText,
"Griptape Vector Store: Add Text": gtUIVectorStoreUpsertTextTask,
"Griptape Vector Store: Query": gtUIVectorStoreQueryTask,
# "Griptape Display: Artifact": gtUIOutputArtifactNode,
# "Griptape Config: Environment Variables": gtUIEnv,
# RAG
"Griptape RAG: Engine": gtUIRagEngine,
"Griptape Combine: RAG Module List": gtUIModuleList,
"Griptape RAG Query: Translate Module": gtUITranslateQueryRagModule,
"Griptape RAG Retrieve: Text Loader Module": gtUITextLoaderRetrievalRagModule,
"Griptape RAG Retrieve: Vector Store Module": gtUIVectorStoreRetrievalRagModule,
"Griptape RAG Rerank: Text Chunks Module": gtUITextChunksRerankRagModule,
"Griptape RAG Response: Prompt Module": gtUIPromptResponseRagModule,
"Griptape RAG Response: Text Chunks Module": gtUITextChunksResponseRagModule,
"Griptape RAG Response: Footnote Prompt Module": gtUIFootnotePromptResponseRagModule,
}
# Let's do the settings
root = "Griptape"
settings = GriptapeSettings()
settings.get_key_config()
settings.get_all_services()
for service in settings.all_services:
keys = settings.get_keys_for_service(service)
for key in keys:
settings.set_settings_key(f"{root}.{key}", os.getenv(key))
settings.save_settings()
__all__ = ["NODE_CLASS_MAPPINGS", "WEB_DIRECTORY"]
print(" \033[34m- \033[92mDone!\033[0m\n")