Merge pull request #205 from griptape-ai:update/dev_dependencies

Update/dev_dependencies
This commit is contained in:
Jason Schleifer
2024-12-31 11:34:56 +13:00
committed by GitHub
184 changed files with 704 additions and 1034 deletions
+52
View File
@@ -0,0 +1,52 @@
name: Create Release with Changelog
on:
push:
branches:
- main
jobs:
create-release:
name: Create Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install poetry
- name: Read version from pyproject.toml
id: get_version
run: |
VERSION=$(poetry version -s)
echo "version=$VERSION" >> $GITHUB_ENV
- name: Install Changelog Generator
run: |
sudo apt-get install ruby-full
gem install github_changelog_generator
- name: Generate Changelog
run: |
github_changelog_generator --user <your-username> --project <your-repo-name> --token ${{ secrets.GITHUB_TOKEN }}
- name: Create GitHub Release
uses: actions/create-release@v1
with:
tag_name: "v${{ env.version }}"
release_name: "v${{ env.version }}"
body: |
$(cat CHANGELOG.md)
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+18
View File
@@ -0,0 +1,18 @@
.PHONY: check
check: check/format check/lint check/types check/spell ## Run all checks.
.PHONY: check/format
check/format:
@poetry run ruff format --check
.PHONY: check/lint
check/lint:
@poetry run ruff check
.PHONY: check/types
check/types:
@poetry run pyright
.PHONY: check/spell
check/spell:
@poetry run typos
+8 -6
View File
@@ -106,7 +106,9 @@ You can previous and download more examples [here](examples/README.md).
### Dec 31, 2024
* Removed manual version tracking in versions.js and now pulling the information from the `pyproject.toml`. To see what version you're running, choose RMB -> Griptape and look at the `Version` information.
* Removed `griptape_config.py` as it's no longer being used
* Added testing to catch spelling, type, and other errors. _Note_: This was a massive effort - hopefully it didn't introduce any errors.
### Dec 27, 2024
* Fixed missing classmethod for OllamaPromptDriver
@@ -182,7 +184,7 @@ You can previous and download more examples [here](examples/README.md).
* Upgrade to Griptape Framework v0.34.1
* Fix to `WebScraperTool` provides better results when using `off_prompt`.
* Fixed bug where urls were dropping any text after the `:`. Example: "What is https://griptape.ai" was being converted to "What is https:". This is due to the `dynamicprompt` functionality of ComfyUI, so I've disabled that.
* Added context string to all BOOLEAN parameters to give the user a better idea as to what the particular boolean option does. For example, intead of just `True` or `False`, the tools now explain `off_prompt`.
* Added context string to all BOOLEAN parameters to give the user a better idea as to what the particular boolean option does. For example, instead of just `True` or `False`, the tools now explain `off_prompt`.
![WebsScraper tool with off_prompt](docs/images/off_prompt_parameter.png)
@@ -248,7 +250,7 @@ You can previous and download more examples [here](examples/README.md).
![alt text](docs/images/release_030_2_config_nodes.png)
* Old `Griptape Agent Config` nodes still exist, but have been deprecated. They will be removed in a future release. Old workflows should automatically display the older nodes as deprecated. It's **highly recommended** to replace these old nodes with the new ones. I have tried to minimize breaking nodes, but if some may exist. I appologize for this if it happens.
* Old `Griptape Agent Config` nodes still exist, but have been deprecated. They will be removed in a future release. Old workflows should automatically display the older nodes as deprecated. It's **highly recommended** to replace these old nodes with the new ones. I have tried to minimize breaking nodes, but if some may exist. I apologize for this if it happens.
![alt text](docs/images/config_deprecated.png)
@@ -347,11 +349,11 @@ You can previous and download more examples [here](examples/README.md).
* **Drivers**
* **Prompt Drivers** - Unique chat prompt drivers for `AmazonBedrock`, `Cohere`, `HuggingFace`, `Google`, `Ollama`, `LMStudio`, `Azure OpenAi`, `OpenAi`, `OpenAiCompatible`
* **Image Generation Drivers** - These all existed before, but adding here for visibility: `Amazon Bedrock Stable Diffusion`, `Amazon Bedrock Titan`, `Leonardo AI`, `Azure OpenAi`, `OpenAi`
* **Embedding Drivers** - Agents can use these for generating embeddings, allowing them to extract relevant chunks of data from text. `Azure OpenAi`, `Voyage Ai`, `Cohere`, `Google`, `OpenAi`, `OpenAi compatable`
* **Embedding Drivers** - Agents can use these for generating embeddings, allowing them to extract relevant chunks of data from text. `Azure OpenAi`, `Voyage Ai`, `Cohere`, `Google`, `OpenAi`, `OpenAi compatible`
* **Vector Store Drivers** - Allows agents to access Vector Stores to query data: ``Azure MongoDB`, `PGVector`, `Pinecone`, `Amazon OpenSearch`, `Qdrant`, `MongoDB Atlas`, `Redis`, `Local Vector Store`
* **Text To Speech Drivers** - Gives agents the ability to convert text to speech. `OpenAi`, `ElevenLabs`
* **Audio Transcription Driver** - Gives agents the ability to transcribe audio. `OpenAi`
* re-fixed spelling of Compatable to Compatible, because it's a common mistake. :)
* re-fixed spelling of `Compatible`, because it's a common mistake. :)
* **Vector Store** - New Vector Store nodes - `Vector Store Add Text`, `Vector Store Query`, and `Griptape Tool: VectorStore` to allow you to work with various Vector Stores
@@ -377,7 +379,7 @@ You can previous and download more examples [here](examples/README.md).
### July 12, 2024
* Updated to Griptape v0.28.2
* **New Node** Griptape Config: OpenAI Compatible node. Allows you to connect to services like https://www.ohmygpt.com/ which are compatable with OpenAi's api.
* **New Node** Griptape Config: OpenAI Compatible node. Allows you to connect to services like https://www.ohmygpt.com/ which are compatible with OpenAi's api.
* **New Node** HuggingFace Prompt Driver Config
* Reorganized a few files
* Removed unused DuckDuckGoTool now that Griptape supports drivers.
+20 -36
View File
@@ -5,8 +5,6 @@
@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
@@ -25,31 +23,30 @@ from .nodes.combine.RulesList import RulesList
from .nodes.combine.ToolList import ToolList
# CONFIG
from .nodes.config.depricated.gtUIAmazonBedrockStructureConfig import (
from .nodes.config.deprecated.gtUIAmazonBedrockStructureConfig import (
gtUIAmazonBedrockStructureConfig,
)
# CONFIG - DEPRICATED
from .nodes.config.depricated.gtUIAnthropicStructureConfig import (
# CONFIG - DEPRECATED
from .nodes.config.deprecated.gtUIAnthropicStructureConfig import (
gtUIAnthropicStructureConfig,
)
from .nodes.config.depricated.gtUIAzureOpenAiStructureConfig import (
from .nodes.config.deprecated.gtUIAzureOpenAiStructureConfig import (
gtUIAzureOpenAiStructureConfig,
)
from .nodes.config.depricated.gtUIGoogleStructureConfig import gtUIGoogleStructureConfig
from .nodes.config.depricated.gtUIHuggingFaceStructureConfig import (
from .nodes.config.deprecated.gtUIGoogleStructureConfig import gtUIGoogleStructureConfig
from .nodes.config.deprecated.gtUIHuggingFaceStructureConfig import (
gtUIHuggingFaceStructureConfig,
)
from .nodes.config.depricated.gtUILMStudioStructureConfig import (
from .nodes.config.deprecated.gtUILMStudioStructureConfig import (
gtUILMStudioStructureConfig,
)
from .nodes.config.depricated.gtUIOllamaStructureConfig import gtUIOllamaStructureConfig
from .nodes.config.depricated.gtUIOpenAiCompatibleConfig import (
from .nodes.config.deprecated.gtUIOllamaStructureConfig import gtUIOllamaStructureConfig
from .nodes.config.deprecated.gtUIOpenAiCompatibleConfig import (
gtUIOpenAiCompatibleConfig,
)
from .nodes.config.depricated.gtUIOpenAiStructureConfig import gtUIOpenAiStructureConfig
from .nodes.config.deprecated.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
@@ -253,7 +250,6 @@ from .nodes.tasks.gtUIInpaintingImageGenerationTask import (
from .nodes.tasks.gtUIParallelImageQueryTask import gtUIParallelImageQueryTask
from .nodes.tasks.gtUIPromptImageGenerationTask import gtUIPromptImageGenerationTask
from .nodes.tasks.gtUIPromptImageVariationTask import gtUIPromptImageVariationTask
from .nodes.tasks.gtUIPromptTask import gtUIPromptTask
# TASKS
# - Agent
@@ -263,10 +259,6 @@ from .nodes.tasks.gtUITask import gtUITask
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
@@ -296,7 +288,6 @@ from .nodes.tools.gtUIWebSearch import gtUIWebSearch
from .nodes.utils.gtUICreateAgentModelfile import gtUICreateAgentModelfile
from .nodes.utils.gtUICreateModelFromModelfile import gtUICreateModelFromModelfile
from .nodes.utils.gtUIRemoveOllamaModel import gtUIRemoveOllamaModel
from .py.griptape_settings import GriptapeSettings
# Load existing environment variables
load_dotenv()
@@ -319,7 +310,6 @@ NODE_CLASS_MAPPINGS = {
# "Griptape Run: Prompt Task": gtUIPromptTask,
# "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
@@ -336,16 +326,16 @@ NODE_CLASS_MAPPINGS = {
"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,
# DEPRECATED
"Griptape Agent Config: Amazon Bedrock [DEPRECATED]": gtUIAmazonBedrockStructureConfig,
"Griptape Agent Config: Anthropic [DEPRECATED]": gtUIAnthropicStructureConfig,
"Griptape Agent Config: Azure OpenAI [DEPRECATED]": gtUIAzureOpenAiStructureConfig,
"Griptape Agent Config: Google [DEPRECATED]": gtUIGoogleStructureConfig,
"Griptape Agent Config: HuggingFace [DEPRECATED]": gtUIHuggingFaceStructureConfig,
"Griptape Agent Config: LM Studio [DEPRECATED]": gtUILMStudioStructureConfig,
"Griptape Agent Config: Ollama [DEPRECATED]": gtUIOllamaStructureConfig,
"Griptape Agent Config: OpenAI [DEPRECATED]": gtUIOpenAiStructureConfig,
"Griptape Agent Config: OpenAI Compatible [DEPRECATED]": gtUIOpenAiCompatibleConfig,
# PROMPT DRIVER
"Griptape Prompt Driver: Amazon Bedrock": gtUIAmazonBedrockPromptDriver,
"Griptape Prompt Driver: Amazon SageMaker Jumpstart": gtUIAmazonSageMakerJumpstartPromptDriver,
@@ -405,12 +395,6 @@ NODE_CLASS_MAPPINGS = {
"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,
+1 -1
View File
@@ -57,7 +57,7 @@ This example demonstrates how to use a local model (`llama3.1` in this case) to
Download: [OffPrompt.json](OffPromopt.json)
## RAG (Retrieval Augmented Generation)
Use Retrieval Augmented Generation to have more control over the data your agents can query. Check out this example which demonstrates multiple data sources, reranking results, and controling the responses.
Use Retrieval Augmented Generation to have more control over the data your agents can query. Check out this example which demonstrates multiple data sources, reranking results, and controlling the responses.
![RAG](retrieval_augmented_generation.png)
Download: [retrieval_augmented_generation.json](retrieval_augmented_generation.json)
+1 -1
View File
@@ -63,7 +63,7 @@ export function setupNodeColors(nodeType, nodeData) {
applyColor(this, nodeColors.red);
}
if (nodeData.name.includes("[DEPRICATED]")){
if (nodeData.name.includes("[DEPRECATED]")){
applyColor(this, nodeColors.yellow)
}
+1 -1
View File
@@ -67,7 +67,7 @@ export function formatPythonLikeObject(text) {
export function chainCallback(object, property, callback) {
if (object == undefined) {
console.error("Tried to add callback to non-existant object")
console.error("Tried to add callback to non-existent object")
return;
}
if (property in object) {
+36 -18
View File
@@ -62,24 +62,42 @@ export const nodeFixes = {
"Griptape Driver: Qdrant Vector Store": "Griptape Vector Store Driver: Qdrant",
"Griptape Driver: DuckDuckGo WebSearch": "Griptape WebSearch Driver: DuckDuckGo",
"Griptape Driver: Google WebSearch": "Griptape WebSearch Driver: Google",
"Griptape Agent Config: Amazon Bedrock [DEPRECIATED]": "Griptape Agent Config: Amazon Bedrock [DEPRICATED]",
"Griptape Agent Config: Anthropic [DEPRECIATED]": "Griptape Agent Config: Anthropic [DEPRICATED]",
"Griptape Agent Config: Azure OpenAI [DEPRECIATED]": "Griptape Agent Config: Azure OpenAI [DEPRICATED]",
"Griptape Agent Config: Google [DEPRECIATED]": "Griptape Agent Config: Google [DEPRICATED]",
"Griptape Agent Config: HuggingFace [DEPRECIATED]": "Griptape Agent Config: HuggingFace [DEPRICATED]",
"Griptape Agent Config: LM Studio [DEPRECIATED]": "Griptape Agent Config: LM Studio [DEPRICATED]",
"Griptape Agent Config: Ollama [DEPRECIATED]": "Griptape Agent Config: Ollama [DEPRICATED]",
"Griptape Agent Config: OpenAI Compatible [DEPRECIATED]": "Griptape Agent Config: OpenAI Compatible [DEPRICATED]",
"Griptape Agent Config: OpenAI [DEPRECIATED]": "Griptape Agent Config: OpenAI [DEPRICATED]",
"Griptape Agent Config: Amazon Bedrock": "Griptape Agent Config: Amazon Bedrock [DEPRICATED]",
"Griptape Agent Config: Anthropic": "Griptape Agent Config: Anthropic [DEPRICATED]",
"Griptape Agent Config: Azure OpenAI": "Griptape Agent Config: Azure OpenAI [DEPRICATED]",
"Griptape Agent Config: Google": "Griptape Agent Config: Google [DEPRICATED]",
"Griptape Agent Config: HuggingFace": "Griptape Agent Config: HuggingFace [DEPRICATED]",
"Griptape Agent Config: LM Studio": "Griptape Agent Config: LM Studio [DEPRICATED]",
"Griptape Agent Config: Ollama": "Griptape Agent Config: Ollama [DEPRICATED]",
"Griptape Agent Config: OpenAI Compatible": "Griptape Agent Config: OpenAI Compatible [DEPRICATED]",
"Griptape Agent Config: OpenAI": "Griptape Agent Config: OpenAI [DEPRICATED]",
"Griptape Agent Config: Amazon Bedrock [DEPRECIATED]": "Griptape Agent Config: Amazon Bedrock [DEPRECATED]",
"Griptape Agent Config: Anthropic [DEPRECIATED]": "Griptape Agent Config: Anthropic [DEPRECATED]",
"Griptape Agent Config: Azure OpenAI [DEPRECIATED]": "Griptape Agent Config: Azure OpenAI [DEPRECATED]",
"Griptape Agent Config: Google [DEPRECIATED]": "Griptape Agent Config: Google [DEPRECATED]",
"Griptape Agent Config: HuggingFace [DEPRECIATED]": "Griptape Agent Config: HuggingFace [DEPRECATED]",
"Griptape Agent Config: LM Studio [DEPRECIATED]": "Griptape Agent Config: LM Studio [DEPRECATED]",
"Griptape Agent Config: Ollama [DEPRECIATED]": "Griptape Agent Config: Ollama [DEPRECATED]",
"Griptape Agent Config: OpenAI Compatible [DEPRECIATED]": "Griptape Agent Config: OpenAI Compatible [DEPRECATED]",
"Griptape Agent Config: OpenAI [DEPRECIATED]": "Griptape Agent Config: OpenAI [DEPRECATED]",
"Griptape Agent Config: Amazon Bedrock": "Griptape Agent Config: Amazon Bedrock [DEPRECATED]",
"Griptape Agent Config: Anthropic": "Griptape Agent Config: Anthropic [DEPRECATED]",
"Griptape Agent Config: Azure OpenAI": "Griptape Agent Config: Azure OpenAI [DEPRECATED]",
"Griptape Agent Config: Google": "Griptape Agent Config: Google [DEPRECATED]",
"Griptape Agent Config: HuggingFace": "Griptape Agent Config: HuggingFace [DEPRECATED]",
"Griptape Agent Config: LM Studio": "Griptape Agent Config: LM Studio [DEPRECATED]",
"Griptape Agent Config: Ollama": "Griptape Agent Config: Ollama [DEPRECATED]",
"Griptape Agent Config: OpenAI Compatible": "Griptape Agent Config: OpenAI Compatible [DEPRECATED]",
"Griptape Agent Config: OpenAI": "Griptape Agent Config: OpenAI [DEPRECATED]",
"Griptape Agent Config: Amazon Bedrock [DEPRICATED]": "Griptape Agent Config: Amazon Bedrock [DEPRECATED]",
"Griptape Agent Config: Anthropic [DEPRICATED]": "Griptape Agent Config: Anthropic [DEPRECATED]",
"Griptape Agent Config: Azure OpenAI [DEPRICATED]": "Griptape Agent Config: Azure OpenAI [DEPRECATED]",
"Griptape Agent Config: Google [DEPRICATED]": "Griptape Agent Config: Google [DEPRECATED]",
"Griptape Agent Config: HuggingFace [DEPRICATED]": "Griptape Agent Config: HuggingFace [DEPRECATED]",
"Griptape Agent Config: LM Studio [DEPRICATED]": "Griptape Agent Config: LM Studio [DEPRECATED]",
"Griptape Agent Config: Ollama [DEPRICATED]": "Griptape Agent Config: Ollama [DEPRECATED]",
"Griptape Agent Config: OpenAI Compatible [DEPRICATED]": "Griptape Agent Config: OpenAI Compatible [DEPRECATED]",
"Griptape Agent Config: OpenAI [DEPRICATED]": "Griptape Agent Config: OpenAI [DEPRECATED]",
"Griptape Agent Config: Amazon Bedrock [DEPRICATED]": "Griptape Agent Config: Amazon Bedrock [DEPRECATED]",
"Griptape Agent Config: Anthropic [DEPRICATED]" : "Griptape Agent Config: Anthropic [DEPRECATED]",
"Griptape Agent Config: Azure OpenAI [DEPRICATED]" : "Griptape Agent Config: Azure OpenAI [DEPRECATED]",
"Griptape Agent Config: Google [DEPRICATED]" : "Griptape Agent Config: Google [DEPRECATED]",
"Griptape Agent Config: HuggingFace [DEPRICATED]" : "Griptape Agent Config: HuggingFace [DEPRECATED]",
"Griptape Agent Config: LM Studio [DEPRICATED]" : "Griptape Agent Config: LM Studio [DEPRECATED]",
"Griptape Agent Config: Ollama [DEPRICATED]" : "Griptape Agent Config: Ollama [DEPRECATED]",
"Griptape Agent Config: OpenAI Compatible [DEPRICATED]" : "Griptape Agent Config: OpenAI Compatible [DEPRECATED]",
"Griptape Agent Config: OpenAI [DEPRICATED]" : "Griptape Agent Config: OpenAI [DEPRECATED]",
"Griptape Vector Store Driver: Griptape Cloud KnowledgeBase": "Griptape Vector Store Driver: Griptape Cloud"
}
}
+1 -1
View File
@@ -1,6 +1,6 @@
class Separator:
@classmethod
def INPUT_TYPES(s):
def INPUT_TYPES(cls):
return {"required": {}}
RETURN_TYPES = ()
+6 -3
View File
@@ -1,3 +1,5 @@
# pyright: reportMissingImports=false
import logging
from comfy_execution.graph import ExecutionBlocker
@@ -29,7 +31,7 @@ class BaseAgent:
self.agent = None
@classmethod
def INPUT_TYPES(s):
def INPUT_TYPES(cls):
return {
"required": {},
"optional": {
@@ -106,8 +108,9 @@ class BaseAgent:
# See if there's an additional attribute on the RagTool
if hasattr(tool, "use_rules"):
# if it's true, get the ruleset
if tool.use_rules:
return tool.ruleset
if getattr(tool, "use_rules", False):
ruleset = getattr(tool, "ruleset", None)
return ruleset
return None
def tool_check(self, config, tools):
+1 -2
View File
@@ -6,7 +6,7 @@ class RunAgent(BaseAgent):
DESCRIPTION = "Run a simple Griptape Agent"
@classmethod
def INPUT_TYPES(s):
def INPUT_TYPES(cls):
inputs = super().INPUT_TYPES()
del inputs["optional"]["config"]
del inputs["optional"]["tools"]
@@ -34,7 +34,6 @@ class RunAgent(BaseAgent):
prompt_text = STRING
else:
prompt_text = STRING + "\n\n" + input_string
tools = self.agent.tools
# if len(tools) > 0:
# self.agent.add_task(ToolkitTask(prompt_text, tools=tools))
# else:
+1 -1
View File
@@ -11,7 +11,7 @@ class gtUICreateAgentFromConfig(BaseAgent):
self.agent = None
@classmethod
def INPUT_TYPES(s):
def INPUT_TYPES(cls):
inputs = super().INPUT_TYPES()
del inputs["optional"]["tools"]
del inputs["optional"]["rulesets"]
+1 -1
View File
@@ -19,7 +19,7 @@ class gtUIReplaceRulesetsOnAgent(BaseAgent):
self.agent = None
@classmethod
def INPUT_TYPES(s):
def INPUT_TYPES(cls):
return {
"required": {},
"optional": {
+1 -1
View File
@@ -19,7 +19,7 @@ class gtUIReplaceToolsOnAgent(BaseAgent):
self.agent = None
@classmethod
def INPUT_TYPES(s):
def INPUT_TYPES(cls):
return {
"required": {},
"optional": {
-142
View File
@@ -1,142 +0,0 @@
from griptape.tasks import PromptTask, TextSummaryTask, ToolkitTask, ToolTask
from openai import OpenAIError
# from server import PromptServer
from .gtComfyAgent import gtComfyAgent
default_prompt = "{{ input_string }}"
max_attempts_default = 10
class AnyType(str):
def __ne__(self, __value: object) -> bool:
return False
any = AnyType("*")
run_types = ["Default", "Prompt", "Tool(s)", "Summarize"]
class gtUIRunAgent:
"""
Run a Griptape Agent
"""
def __init__(self):
self.default_prompt = default_prompt
self.agent = None
@classmethod
def INPUT_TYPES(s):
return {
"required": {},
"optional": {
"agent": (
"AGENT",
{
"forceInput": True,
"tooltip": "An existing agent to use.\nIf not provided, a new agent will be created.",
},
),
"run_type": (run_types, {"default": run_types[0]}),
"tools": ("TOOL_LIST", {"forceInput": True, "INPUT_IS_LIST": True}),
"inputs": ("*",),
"text": (
"STRING",
{"multiline": True, "dynamicPrompts": False},
),
},
}
@classmethod
def VALIDATE_INPUTS(s, input_types):
return True
RETURN_TYPES = (
any,
"AGENT",
)
RETURN_NAMES = (
"OUTPUT",
"AGENT",
)
FUNCTION = "run"
OUTPUT_NODE = True
CATEGORY = "Griptape/Agent"
def run(self, **kwargs):
run_type = kwargs.get("run_type", run_types[0])
inputs = kwargs.get("inputs", [])
agent = kwargs.get("agent", None)
tools = kwargs.get("tools", [])
text = kwargs.get("text", None)
create_dict = {}
# Configuration
if agent:
config = agent.drivers_config
create_dict["config"] = agent.drivers_config.prompt_driver
# Tools
create_dict["tools"] = self.tool_check(config, tools)
if agent:
create_dict["rulesets"] = agent.rulesets
# Memory
if agent:
create_dict["conversation_memory"] = agent.conversation_memory
create_dict["meta_memory"] = agent.meta_memory
create_dict["task_memory"] = agent.task_memory
prompt = []
try:
# Now create the agent
self.agent = gtComfyAgent(**create_dict)
# Check for inputs. If none, then just create the agent
if len(inputs) == 0 and text.strip() == "":
output = "Agent created."
else:
# Get the prompt text
if len(inputs) == 0:
prompt = [text]
else:
prompt = [text] + inputs
if run_type == "Default":
result = self.agent.run(prompt)
else:
if run_type == "Prompt" or (
run_type == "Tool(s)" and len(tools) == 0
):
self.agent.add_task(PromptTask(prompt))
elif run_type == "Tool(s)":
if len(tools) == 1:
self.agent.add_task(ToolTask(prompt, tool=tools[0]))
else:
self.agent.add_task(ToolkitTask(prompt, tools=tools))
elif run_type == "Summarize":
self.agent.add_task(TextSummaryTask(prompt))
result = self.agent.run()
output = result.output_task.output
return (
output,
self.agent,
)
except OpenAIError as e:
if "api_key" in str(e).lower():
return (
"Error: OpenAI API key is missing. Please provide a valid API key.",
None,
)
else:
return (f"OpenAI Error: {str(e)}", None)
except Exception as e:
return (f"Error creating agent: {str(e)}", None)
+3 -2
View File
@@ -6,7 +6,7 @@ class gtUISetDefaultAgent(BaseAgent):
DESCRIPTION = "Set the default agent."
@classmethod
def INPUT_TYPES(s):
def INPUT_TYPES(cls):
inputs = super().INPUT_TYPES()
del inputs["optional"]["tools"]
del inputs["optional"]["rulesets"]
@@ -18,8 +18,9 @@ class gtUISetDefaultAgent(BaseAgent):
RETURN_TYPES = ("CONFIG",)
OUTPUT_NODE = True
def run(self, config=None):
def run(self, **kwargs):
settings = GriptapeSettings()
config = kwargs.get("config", None)
if config:
config_dict = config.to_dict()
settings.overwrite_settings_key("Griptape.default_config", config_dict)
+1 -1
View File
@@ -9,7 +9,7 @@ class MergeTexts:
pass
@classmethod
def INPUT_TYPES(s):
def INPUT_TYPES(cls):
return {
"required": {},
"optional": {
+1 -1
View File
@@ -9,7 +9,7 @@ class RulesList:
pass
@classmethod
def INPUT_TYPES(s):
def INPUT_TYPES(cls):
return {
"optional": {
"rules_1": (
+1 -1
View File
@@ -9,7 +9,7 @@ class ToolList:
pass
@classmethod
def INPUT_TYPES(s):
def INPUT_TYPES(cls):
return {
"optional": {
"tool_1": (
+1 -1
View File
@@ -9,7 +9,7 @@ class gtUIMergeInputs:
pass
@classmethod
def INPUT_TYPES(s):
def INPUT_TYPES(cls):
return {
"required": {},
"optional": {
+1 -1
View File
@@ -9,7 +9,7 @@ class gtUIModuleList:
pass
@classmethod
def INPUT_TYPES(s):
def INPUT_TYPES(cls):
return {
"optional": {
"module_1": (
@@ -1,3 +1,5 @@
from typing import Optional, Tuple
from griptape.configs.drivers import (
AmazonBedrockDriversConfig,
)
@@ -33,7 +35,7 @@ class gtUIAmazonBedrockStructureConfig(gtUIBaseConfig):
DESCRIPTION = "Amazon Bedrock Prompt Driver."
@classmethod
def INPUT_TYPES(s):
def INPUT_TYPES(cls):
inputs = super().INPUT_TYPES()
inputs["required"].update(
{
@@ -64,7 +66,7 @@ class gtUIAmazonBedrockStructureConfig(gtUIBaseConfig):
def create(
self,
**kwargs,
):
) -> Tuple[Optional[AmazonBedrockDriversConfig]]:
params = {}
prompt_model = kwargs.get("prompt_model", amazonBedrockPromptModels[0])
@@ -29,7 +29,7 @@ class gtUIAnthropicStructureConfig(gtUIBaseConfig):
)
@classmethod
def INPUT_TYPES(s):
def INPUT_TYPES(cls):
inputs = super().INPUT_TYPES()
inputs["required"].update(
{
@@ -21,7 +21,7 @@ class gtUIAzureOpenAiStructureConfig(gtUIBaseConfig):
DESCRIPTION = "Azure OpenAI Structure Config. Requires AZURE_OPENAI_ENDPOINT_3 and AZURE_OPENAI_API_KEY_3"
@classmethod
def INPUT_TYPES(s):
def INPUT_TYPES(cls):
inputs = super().INPUT_TYPES()
inputs["required"].update(
{
@@ -75,13 +75,26 @@ class gtUIAzureOpenAiStructureConfig(gtUIBaseConfig):
kwargs.get("azure_endpoint_env_var", DEFAULT_AZURE_OPENAI_ENDPOINT)
)
params["api_key"] = self.getenv("AZURE_OPENAI_API_KEY")
params["azure_endpoint"] = self.getenv("AZURE_OPENAI_ENDPOINT")
prompt_api_key = self.getenv(AZURE_OPENAI_API_KEY)
prompt_azure_endpoint = self.getenv(AZURE_OPENAI_ENDPOINT)
if not prompt_api_key:
raise ValueError("Azure OpenAI API Key is not set")
if not prompt_azure_endpoint:
raise ValueError("Azure OpenAI Endpoint is not set")
params["api_key"] = prompt_api_key
params["azure_endpoint"] = prompt_azure_endpoint
prompt_driver = AzureOpenAiChatPromptDriver(**params)
embedding_api_key = self.getenv(AZURE_OPENAI_API_KEY)
embedding_azure_endpoint = self.getenv(AZURE_OPENAI_ENDPOINT)
if not embedding_api_key:
raise ValueError("Azure OpenAI API Key is not set")
if not embedding_azure_endpoint:
raise ValueError("Azure OpenAI Endpoint is not set")
embedding_driver = AzureOpenAiEmbeddingDriver(
api_key=self.getenv(AZURE_OPENAI_API_KEY),
azure_endpoint=self.getenv(AZURE_OPENAI_ENDPOINT),
api_key=embedding_api_key,
azure_endpoint=embedding_azure_endpoint,
)
if not image_generation_driver:
@@ -24,7 +24,7 @@ class gtUIGoogleStructureConfig(gtUIBaseConfig):
"""
@classmethod
def INPUT_TYPES(s):
def INPUT_TYPES(cls):
inputs = super().INPUT_TYPES()
inputs["required"].update(
@@ -23,7 +23,7 @@ class gtUIHuggingFaceStructureConfig(gtUIBaseConfig):
DESCRIPTION = "HuggingFace Structure Config."
@classmethod
def INPUT_TYPES(s):
def INPUT_TYPES(cls):
inputs = super().INPUT_TYPES()
inputs["optional"].update(
{
@@ -23,7 +23,7 @@ class gtUILMStudioStructureConfig(gtUIBaseConfig):
)
@classmethod
def INPUT_TYPES(s):
def INPUT_TYPES(cls):
inputs = super().INPUT_TYPES()
inputs["required"].update(
{
@@ -21,7 +21,7 @@ class gtUIOllamaStructureConfig(gtUIBaseConfig):
DESCRIPTION = "Ollama Prompt Driver. Use local models with Ollama. Available at https://ollama.com"
@classmethod
def INPUT_TYPES(s):
def INPUT_TYPES(cls):
inputs = super().INPUT_TYPES()
inputs["required"].update(
{
@@ -25,7 +25,7 @@ class gtUIOpenAiCompatibleConfig(gtUIBaseConfig):
DESCRIPTION = "OpenAI Compatible Structure Config."
@classmethod
def INPUT_TYPES(s):
def INPUT_TYPES(cls):
inputs = super().INPUT_TYPES()
inputs["optional"].update(
{
@@ -23,7 +23,7 @@ class gtUIOpenAiStructureConfig(gtUIBaseConfig):
DESCRIPTION = "OpenAI Structure Config. Use OpenAI's models for prompt, embedding, image generation, and image query."
@classmethod
def INPUT_TYPES(s):
def INPUT_TYPES(cls):
inputs = super().INPUT_TYPES()
inputs["required"].update(
{
@@ -1,3 +1,5 @@
from typing import Tuple
from griptape.configs import Defaults
from griptape.configs.drivers import (
AmazonBedrockDriversConfig,
@@ -56,7 +58,7 @@ class gtUIAmazonBedrockDriversConfig(gtUIBaseDriversConfig):
DESCRIPTION = "Amazon Bedrock Prompt Driver."
@classmethod
def INPUT_TYPES(s):
def INPUT_TYPES(cls):
inputs = super().INPUT_TYPES()
inputs["optional"] = {}
@@ -68,7 +70,7 @@ class gtUIAmazonBedrockDriversConfig(gtUIBaseDriversConfig):
def create(
self,
**kwargs,
):
) -> Tuple[AmazonBedrockDriversConfig]:
self.run_envs(kwargs)
drivers_config_params = {}
+48 -48
View File
@@ -1,7 +1,6 @@
import boto3
from ...py.griptape_settings import GriptapeSettings
from ..drivers.gtUIBaseDriver import gtUIBaseDriver
DEFAULT_AWS_ACCESS_KEY_ID = "AWS_ACCESS_KEY_ID"
DEFAULT_AWS_SECRET_ACCESS_KEY = "AWS_SECRET_ACCESS_KEY"
@@ -32,58 +31,59 @@ def start_session(aws_access_key_id=None, aws_secret_access_key=None, region_nam
return None
class gtUIAmazonBedrockSession(gtUIBaseDriver):
DESCRIPTION = "Starts a session with Amazon"
#
# class gtUIAmazonBedrockSession(gtUIBaseDriver):
# DESCRIPTION = "Starts a session with Amazon"
@classmethod
def INPUT_TYPES(s):
return {
"optional": {
"aws_access_key_id_env_var": (
"STRING",
{"default": DEFAULT_AWS_ACCESS_KEY_ID},
),
"aws_secret_access_key_env_var": (
"STRING",
{"default": DEFAULT_AWS_SECRET_ACCESS_KEY},
),
"aws_default_region_env_var": (
"STRING",
{"default": DEFAULT_AWS_DEFAULT_REGION},
),
}
}
# @classmethod
# def INPUT_TYPES(cls):
# return {
# "optional": {
# "aws_access_key_id_env_var": (
# "STRING",
# {"default": DEFAULT_AWS_ACCESS_KEY_ID},
# ),
# "aws_secret_access_key_env_var": (
# "STRING",
# {"default": DEFAULT_AWS_SECRET_ACCESS_KEY},
# ),
# "aws_default_region_env_var": (
# "STRING",
# {"default": DEFAULT_AWS_DEFAULT_REGION},
# ),
# }
# }
RETURN_TYPES = ("SESSION",)
RETURN_NAMES = ("SESSION",)
# RETURN_TYPES = ("SESSION",)
# RETURN_NAMES = ("SESSION",)
FUNCTION = "create"
# FUNCTION = "create"
CATEGORY = "Griptape/Agent Configs"
# CATEGORY = "Griptape/Agent Configs"
def build_params(self, **kwargs):
params = {}
aws_access_key_id = self.getenv(
kwargs.get("aws_access_key_id_env_var", DEFAULT_AWS_ACCESS_KEY_ID)
)
aws_secret_access_key = self.getenv(
kwargs.get("aws_secret_access_key_env_var", DEFAULT_AWS_SECRET_ACCESS_KEY)
)
region_name = self.getenv(
kwargs.get("aws_default_region_env_var", DEFAULT_AWS_DEFAULT_REGION)
)
# def build_params(self, **kwargs):
# params = {}
# aws_access_key_id = self.getenv(
# kwargs.get("aws_access_key_id_env_var", DEFAULT_AWS_ACCESS_KEY_ID)
# )
# aws_secret_access_key = self.getenv(
# kwargs.get("aws_secret_access_key_env_var", DEFAULT_AWS_SECRET_ACCESS_KEY)
# )
# region_name = self.getenv(
# kwargs.get("aws_default_region_env_var", DEFAULT_AWS_DEFAULT_REGION)
# )
params["aws_access_key_id"] = aws_access_key_id
params["aws_secret_access_key"] = aws_secret_access_key
params["region_name"] = region_name
# params["aws_access_key_id"] = aws_access_key_id
# params["aws_secret_access_key"] = aws_secret_access_key
# params["region_name"] = region_name
return params
# return params
def create(self, **kwargs):
params = self.build_params(**kwargs)
session = start_session(
aws_access_key_id=params.get("aws_access_key_id"),
aws_secret_access_key=params.get("aws_secret_access_key"),
region_name=params.get("region_name"),
)
return (session,)
# def create(self, **kwargs):
# params = self.build_params(**kwargs)
# session = start_session(
# aws_access_key_id=params.get("aws_access_key_id"),
# aws_secret_access_key=params.get("aws_secret_access_key"),
# region_name=params.get("region_name"),
# )
# return (session,)
+1 -1
View File
@@ -40,7 +40,7 @@ class gtUIAnthropicDriversConfig(gtUIBaseDriversConfig):
)
@classmethod
def INPUT_TYPES(s):
def INPUT_TYPES(cls):
inputs = super().INPUT_TYPES()
inputs["optional"] = {}
+1 -1
View File
@@ -38,7 +38,7 @@ class gtUIAzureOpenAiDriversConfig(gtUIBaseDriversConfig):
DESCRIPTION = "Azure OpenAI Structure Config. Requires AZURE_OPENAI_ENDPOINT_3 and AZURE_OPENAI_API_KEY_3"
@classmethod
def INPUT_TYPES(s):
def INPUT_TYPES(cls):
inputs = super().INPUT_TYPES()
inputs["optional"] = {}
+5 -3
View File
@@ -1,3 +1,5 @@
from typing import Any, Tuple
from griptape.configs import Defaults
from griptape.configs.drivers import OpenAiDriversConfig
@@ -34,7 +36,7 @@ class gtUIBaseConfig:
pass
@classmethod
def INPUT_TYPES(s):
def INPUT_TYPES(cls):
return {
"required": {},
"optional": {
@@ -73,13 +75,13 @@ class gtUIBaseConfig:
# OUTPUT_NODE = False
CATEGORY = "Griptape/Agent Configs [DEPRICATED]"
CATEGORY = "Griptape/Agent Configs [DEPRECATED]"
def getenv(self, env):
settings = GriptapeSettings()
api_key = settings.get_settings_key_or_use_env(env)
return api_key
def create(self, **kwargs):
def create(self, **kwargs) -> Tuple[Any, ...]:
Defaults.drivers_config = OpenAiDriversConfig()
return (OpenAiDriversConfig(),)
+4 -2
View File
@@ -1,3 +1,5 @@
from typing import Any, Tuple
from griptape.configs import Defaults
from griptape.configs.drivers import OpenAiDriversConfig
@@ -35,7 +37,7 @@ class gtUIBaseDriversConfig(gtUIBase):
pass
@classmethod
def INPUT_TYPES(s):
def INPUT_TYPES(cls):
inputs = super().INPUT_TYPES()
return inputs
@@ -53,6 +55,6 @@ class gtUIBaseDriversConfig(gtUIBase):
api_key = settings.get_settings_key_or_use_env(env)
return api_key
def create(self, **kwargs):
def create(self, **kwargs) -> Tuple[Any, ...]:
Defaults.drivers_config = OpenAiDriversConfig()
return (OpenAiDriversConfig(),)
+1 -1
View File
@@ -33,7 +33,7 @@ class gtUICohereDriversConfig(gtUIBaseDriversConfig):
DESCRIPTION = "OpenAI Structure Config. Use OpenAI's models for prompt, embedding, image generation, and image query."
@classmethod
def INPUT_TYPES(s):
def INPUT_TYPES(cls):
inputs = super().INPUT_TYPES()
inputs["optional"] = {}
+1 -1
View File
@@ -12,7 +12,7 @@ class gtUIEnvConfig:
"""
@classmethod
def INPUT_TYPES(s):
def INPUT_TYPES(cls):
return {
"required": {},
"optional": {
+8 -2
View File
@@ -1,3 +1,5 @@
from typing import Optional, Tuple
from griptape.configs import Defaults
from griptape.configs.drivers import (
GoogleDriversConfig,
@@ -38,7 +40,7 @@ class gtUIGoogleDriversConfig(gtUIBaseDriversConfig):
"""
@classmethod
def INPUT_TYPES(s):
def INPUT_TYPES(cls):
inputs = super().INPUT_TYPES()
inputs["optional"] = {}
@@ -52,9 +54,11 @@ class gtUIGoogleDriversConfig(gtUIBaseDriversConfig):
"Google Structure Config. Use Google's models for prompt and image query."
)
def create(self, **kwargs):
def create(self, **kwargs) -> Tuple[Optional[GoogleDriversConfig]]:
self.run_envs(kwargs)
custom_config = None
drivers_config_params = {}
# Create instances of the driver classes
prompt_driver_builder = gtUIGooglePromptDriver()
@@ -77,6 +81,8 @@ class gtUIGoogleDriversConfig(gtUIBaseDriversConfig):
try:
Defaults.drivers_config = GoogleDriversConfig(**drivers_config_params)
custom_config = Defaults.drivers_config
if custom_config is None:
raise Exception("Failed to create GoogleDriversConfig")
except Exception as e:
print(e)
+2 -1
View File
@@ -40,7 +40,7 @@ class gtUIHuggingFaceDriversConfig(gtUIBaseDriversConfig):
DESCRIPTION = "HuggingFace Structure Config."
@classmethod
def INPUT_TYPES(s):
def INPUT_TYPES(cls):
inputs = super().INPUT_TYPES()
inputs["optional"] = {}
@@ -50,6 +50,7 @@ class gtUIHuggingFaceDriversConfig(gtUIBaseDriversConfig):
def create(self, **kwargs):
self.run_envs(kwargs)
custom_config = None
drivers_config_params = {}
+2 -1
View File
@@ -1,3 +1,4 @@
# pyright: reportMissingImports=false
import logging
from comfy_execution.graph import ExecutionBlocker
@@ -38,7 +39,7 @@ class gtUILMStudioDriversConfig(gtUIBaseDriversConfig):
)
@classmethod
def INPUT_TYPES(s):
def INPUT_TYPES(cls):
inputs = super().INPUT_TYPES()
inputs["optional"] = {}
+2 -1
View File
@@ -33,7 +33,7 @@ class gtUIOllamaDriversConfig(gtUIBaseDriversConfig):
DESCRIPTION = "Ollama Prompt Driver. Use local models with Ollama. Available at https://ollama.com"
@classmethod
def INPUT_TYPES(s):
def INPUT_TYPES(cls):
inputs = super().INPUT_TYPES()
inputs["optional"] = {}
@@ -45,6 +45,7 @@ class gtUIOllamaDriversConfig(gtUIBaseDriversConfig):
def create(self, **kwargs):
self.run_envs(kwargs)
custom_config = None
drivers_config_params = {}
@@ -56,7 +56,7 @@ class gtUIOpenAiCompatibleDriversConfig(gtUIBaseDriversConfig):
DESCRIPTION = "OpenAI Compatible Structure Config."
@classmethod
def INPUT_TYPES(s):
def INPUT_TYPES(cls):
inputs = super().INPUT_TYPES()
inputs["optional"] = {}
+1 -1
View File
@@ -49,7 +49,7 @@ class gtUIOpenAiDriversConfig(gtUIBaseDriversConfig):
DESCRIPTION = "OpenAI Drivers Config. Use OpenAI's models for prompt, embedding, image generation, and image query."
@classmethod
def INPUT_TYPES(s):
def INPUT_TYPES(cls):
inputs = super().INPUT_TYPES()
inputs["optional"] = {}
+1 -1
View File
@@ -25,7 +25,7 @@ class gtUIStructureConfig(gtUIBase):
self.default_audio_transcription_driver = DummyAudioTranscriptionDriver()
@classmethod
def INPUT_TYPES(s):
def INPUT_TYPES(cls):
inputs = super().INPUT_TYPES()
inputs["optional"].update(
{
+1 -1
View File
@@ -13,7 +13,7 @@ class gtUITextToClipEncode(gtUIBaseTask):
DESCRIPTION = "Convert text to a CLIP conditioning"
@classmethod
def INPUT_TYPES(s):
def INPUT_TYPES(cls):
return {
"required": {
"STRING": ("STRING", {"forceInput": True}),
+1 -1
View File
@@ -10,7 +10,7 @@ class gtUITextToCombo:
DESCRIPTION = "Convert text to a Combo conditioning"
@classmethod
def INPUT_TYPES(s):
def INPUT_TYPES(cls):
return {
"required": {
"STRING": ("STRING", {"forceInput": True}),
+1
View File
@@ -1,3 +1,4 @@
# pyright: reportMissingImports=false
from aiohttp import web
from server import PromptServer
+1 -1
View File
@@ -5,7 +5,7 @@ class gtUIOutputArtifactNode:
CATEGORY = "Griptape/Display"
@classmethod
def INPUT_TYPES(s):
def INPUT_TYPES(cls):
return {
"required": {},
"optional": {"INPUT": ("ARTIFACT", {"forceInput": True})},
+2 -2
View File
@@ -4,11 +4,11 @@ class gtUIOutputDataNode:
CATEGORY = "Griptape/Display"
@classmethod
def INPUT_TYPES(s):
def INPUT_TYPES(cls):
return {"required": {}, "optional": {"INPUT": ("*", {"forceInput": True})}}
@classmethod
def VALIDATE_INPUTS(s, input_types):
def VALIDATE_INPUTS(cls, input_types):
return True
RETURN_TYPES = ("STRING",)
+2 -1
View File
@@ -1,3 +1,4 @@
# pyright: reportMissingImports=false
import random
import folder_paths
@@ -20,7 +21,7 @@ class gtUIOutputImageNode(gtUISaveImageNode):
CATEGORY = "Griptape/Display"
@classmethod
def INPUT_TYPES(s):
def INPUT_TYPES(cls):
return {
"required": {},
"optional": {"images": ("IMAGE", {"forceInput": True})},
+1 -1
View File
@@ -4,7 +4,7 @@ class gtUIOutputStringNode:
CATEGORY = "Griptape/Display"
@classmethod
def INPUT_TYPES(s):
def INPUT_TYPES(cls):
return {
"required": {},
"optional": {
+2 -1
View File
@@ -1,3 +1,4 @@
# pyright: reportMissingImports=false
import json
import os
@@ -7,7 +8,7 @@ from comfy.cli_args import args
from PIL import Image
from PIL.PngImagePlugin import PngInfo
from nodes import SaveImage
from nodes import SaveImage # type: ignore[reportAttributeAccessIssue]
# From SaveImage
@@ -20,7 +20,7 @@ DEFAULT_AWS_DEFAULT_REGION = "AWS_DEFAULT_REGION"
class gtUIAmazonBedrockPromptDriver(gtUIBasePromptDriver):
@classmethod
def INPUT_TYPES(s):
def INPUT_TYPES(cls):
inputs = super().INPUT_TYPES()
# Get the base required and optional inputs
@@ -17,7 +17,7 @@ class gtUIAmazonBedrockStableDiffusionImageGenerationDriver(
DESCRIPTION = "Amazon Bedrock Stable Diffusion Image Generation Driver"
@classmethod
def INPUT_TYPES(s):
def INPUT_TYPES(cls):
style_presets = [
"<None>",
"3d-model",
@@ -1,3 +1,5 @@
from typing import Any, Tuple
from griptape.drivers import AmazonBedrockTitanEmbeddingDriver
from ..config.gtUIAmazonBedrockSession import start_session
@@ -18,7 +20,7 @@ class gtUIAmazonBedrockTitanEmbeddingDriver(gtUIBaseEmbeddingDriver):
DESCRIPTION = "Amazon Bedrock Titan Embedding Driver"
@classmethod
def INPUT_TYPES(s):
def INPUT_TYPES(cls):
inputs = super().INPUT_TYPES()
# Get the base required and optional inputs
@@ -39,6 +41,14 @@ class gtUIAmazonBedrockTitanEmbeddingDriver(gtUIBaseEmbeddingDriver):
"tooltip": "Select the embedding model to use.",
},
),
"min_retry_delay": (
"FLOAT",
{"default": 2, "tooltip": "Minimum retry delay"},
),
"max_retry_delay": (
"FLOAT",
{"default": 10, "tooltip": "Minimum retry delay"},
),
"aws_access_key_id_env_var": (
"STRING",
{
@@ -67,6 +77,8 @@ class gtUIAmazonBedrockTitanEmbeddingDriver(gtUIBaseEmbeddingDriver):
def build_params(self, **kwargs):
model = kwargs.get("embedding_model", None)
min_retry_delay = kwargs.get("min_retry_delay", 2)
max_retry_delay = kwargs.get("max_retry_delay", 10)
api_key = self.getenv(
kwargs.get("aws_access_key_id_env_var", DEFAULT_AWS_ACCESS_KEY_ID)
)
@@ -81,13 +93,15 @@ class gtUIAmazonBedrockTitanEmbeddingDriver(gtUIBaseEmbeddingDriver):
"aws_access_key_id": api_key,
"aws_secret_access_key": secret_access_key,
"region_name": region_name,
"min_retry_delay": min_retry_delay,
"max_retry_delay": max_retry_delay,
}
if model:
params["model"] = model
return params
def create(self, **kwargs):
def create(self, **kwargs) -> Tuple[Any, ...]:
params = self.build_params(**kwargs)
start_session(
aws_access_key_id=params.get("aws_access_key_id", None),
@@ -17,7 +17,7 @@ class gtUIAmazonBedrockTitanImageGenerationDriver(gtUIBaseImageGenerationDriver)
DESCRIPTION = "Amazon Bedrock Titan Image Generation Driver"
@classmethod
def INPUT_TYPES(s):
def INPUT_TYPES(cls):
sizes = ["512x512", "1024x1024"]
inputs = super().INPUT_TYPES()
@@ -16,7 +16,7 @@ class gtUIAmazonOpenSearchVectorStoreDriver(gtUIBaseVectorStoreDriver):
DESCRIPTION = "Griptape Open Search Vector Store Driver: https://aws.amazon.com/opensearch-service/"
@classmethod
def INPUT_TYPES(s):
def INPUT_TYPES(cls):
inputs = super().INPUT_TYPES()
# Get the base required and optional inputs
@@ -107,5 +107,5 @@ class gtUIAmazonOpenSearchVectorStoreDriver(gtUIBaseVectorStoreDriver):
params.pop("aws_access_key_id")
params.pop("aws_secret_access_key")
params.pop("region_name")
driver = AmazonOpenSearchVectorStoreDriver(**params)
driver = AmazonOpenSearchVectorStoreDriver(**params) # type: ignore[reportArgumentType]
return (driver,)
@@ -14,7 +14,7 @@ class gtUIAmazonSageMakerJumpstartEmbeddingDriver(gtUIBaseEmbeddingDriver):
DESCRIPTION = "OpenAI Compatible Embedding Driver"
@classmethod
def INPUT_TYPES(s):
def INPUT_TYPES(cls):
inputs = super().INPUT_TYPES()
# Get the base required and optional inputs
base_required_inputs = inputs["required"]
@@ -12,7 +12,7 @@ DEFAULT_AWS_DEFAULT_REGION = "AWS_DEFAULT_REGION"
class gtUIAmazonSageMakerJumpstartPromptDriver(gtUIBasePromptDriver):
@classmethod
def INPUT_TYPES(s):
def INPUT_TYPES(cls):
inputs = super().INPUT_TYPES()
inputs["required"].update()
+2 -2
View File
@@ -11,7 +11,7 @@ DEFAULT_API_KEY = "ANTHROPIC_API_KEY"
class gtUIAnthropicPromptDriver(gtUIBasePromptDriver):
@classmethod
def INPUT_TYPES(s):
def INPUT_TYPES(cls):
inputs = super().INPUT_TYPES()
# Get the base required and optional inputs
@@ -58,7 +58,7 @@ class gtUIAnthropicPromptDriver(gtUIBasePromptDriver):
"min": 0,
"max": 500,
"step": 1,
"tooltip": "Limits the number of tokens considered for each step of the generation. Pevents the model from focusing too narrowly on the top choices.",
"tooltip": "Limits the number of tokens considered for each step of the generation. Prevents the model from focusing too narrowly on the top choices.",
},
),
}
@@ -17,7 +17,7 @@ class gtUIAzureMongoDbVectorStoreDriver(gtUIBaseVectorStoreDriver):
DESCRIPTION = "Griptape Azure Mongodb Atlas Vector Store Driver: https://www.mongodb.com/products/platform/atlas-database"
@classmethod
def INPUT_TYPES(s):
def INPUT_TYPES(cls):
inputs = super().INPUT_TYPES()
inputs["required"].update()
inputs["optional"].update(
@@ -10,7 +10,7 @@ DEFAULT_API_KEY_ENV_VAR = "AZURE_OPENAI_API_KEY"
class gtUIAzureOpenAiChatPromptDriver(gtUIBasePromptDriver):
@classmethod
def INPUT_TYPES(s):
def INPUT_TYPES(cls):
inputs = super().INPUT_TYPES()
# Get the base required and optional inputs
base_required_inputs = inputs["required"]
@@ -11,7 +11,7 @@ class gtUIAzureOpenAiEmbeddingDriver(gtUIBaseEmbeddingDriver):
DESCRIPTION = "Azure OpenAI Embedding Driver"
@classmethod
def INPUT_TYPES(s):
def INPUT_TYPES(cls):
inputs = super().INPUT_TYPES()
inputs["required"].update()
@@ -14,7 +14,7 @@ class gtUIAzureOpenAiImageGenerationDriver(gtUIBaseImageGenerationDriver):
DESCRIPTION = "Azire OpenAI Image Generation Driver"
@classmethod
def INPUT_TYPES(s):
def INPUT_TYPES(cls):
inputs = super().INPUT_TYPES()
inputs["optional"].update(
{
@@ -58,7 +58,7 @@ class gtUIAzureOpenAiImageGenerationDriver(gtUIBaseImageGenerationDriver):
return inputs
def adjust_size_based_on_model(self, model, size):
# pick the approprite size based on the model
# pick the appropriate size based on the model
if model == "dall-e-2":
if size in ["1024x1792", "1792x1024"]:
size = "1024x1024"
@@ -8,7 +8,7 @@ DEFAULT_MODEL = "whisper-1"
class gtUIBaseAudioTranscriptionDriver(gtUIBaseDriver):
@classmethod
def INPUT_TYPES(s):
def INPUT_TYPES(cls):
return {
"required": {},
"optional": {},
@@ -21,9 +21,7 @@ class gtUIBaseAudioTranscriptionDriver(gtUIBaseDriver):
CATEGORY = "Griptape/Agent Drivers/Audio Transcription"
def create(
self,
):
def create(self, **kwargs):
api_key = self.getenv(DEFAULT_API_KEY)
params = {}
+4 -2
View File
@@ -1,3 +1,5 @@
from typing import Any, Tuple
from griptape.drivers import DummyPromptDriver
from ...py.griptape_settings import GriptapeSettings
@@ -7,7 +9,7 @@ class gtUIBaseDriver:
DESCRIPTION = "Griptape Driver"
@classmethod
def INPUT_TYPES(s):
def INPUT_TYPES(cls):
return {
"required": {},
"optional": {},
@@ -25,6 +27,6 @@ class gtUIBaseDriver:
api_key = settings.get_settings_key_or_use_env(env)
return api_key
def create(self, **kwargs):
def create(self, **kwargs) -> Tuple[Any, ...]:
driver = DummyPromptDriver()
return (driver,)
+6 -4
View File
@@ -1,4 +1,6 @@
from griptape.drivers import BaseEmbeddingDriver
from typing import Any, Tuple
from griptape.drivers import DummyEmbeddingDriver
from .gtUIBaseDriver import gtUIBaseDriver
@@ -7,7 +9,7 @@ class gtUIBaseEmbeddingDriver(gtUIBaseDriver):
DESCRIPTION = "Griptape Embedding Driver"
@classmethod
def INPUT_TYPES(s):
def INPUT_TYPES(cls):
inputs = super().INPUT_TYPES()
inputs["required"].update()
inputs["optional"].update()
@@ -18,6 +20,6 @@ class gtUIBaseEmbeddingDriver(gtUIBaseDriver):
RETURN_TYPES = ("EMBEDDING_DRIVER",)
def create(self, **kwargs):
driver = BaseEmbeddingDriver()
def create(self, **kwargs) -> Tuple[Any, ...]:
driver = DummyEmbeddingDriver()
return (driver,)
+4 -2
View File
@@ -1,3 +1,5 @@
from typing import Any, Tuple
from griptape.drivers import OpenAiImageGenerationDriver
from .gtUIBaseDriver import gtUIBaseDriver
@@ -14,7 +16,7 @@ class gtUIBaseImageGenerationDriver(gtUIBaseDriver):
"""
@classmethod
def INPUT_TYPES(s):
def INPUT_TYPES(cls):
return {
"required": {},
"optional": {},
@@ -28,7 +30,7 @@ class gtUIBaseImageGenerationDriver(gtUIBaseDriver):
CATEGORY = "Griptape/Agent Drivers/Image Generation"
def create(self, prompt):
def create(self, **kwargs) -> Tuple[Any, ...]:
api_key = self.getenv(DEFAULT_API_KEY)
params = {}
if api_key:
+6 -4
View File
@@ -1,11 +1,13 @@
from griptape.drivers import BasePromptDriver
from typing import Any, Tuple
from griptape.drivers import DummyPromptDriver
from .gtUIBaseDriver import gtUIBaseDriver
class gtUIBasePromptDriver(gtUIBaseDriver):
@classmethod
def INPUT_TYPES(s):
def INPUT_TYPES(cls):
inputs = super().INPUT_TYPES()
inputs["optional"].update(
@@ -64,6 +66,6 @@ class gtUIBasePromptDriver(gtUIBaseDriver):
CATEGORY = "Griptape/Agent Drivers/Prompt"
def create(self, **kwargs):
driver = BasePromptDriver()
def create(self, **kwargs) -> Tuple[Any, ...]:
driver = DummyPromptDriver()
return (driver,)
+6 -4
View File
@@ -1,4 +1,6 @@
from griptape.drivers import BaseRerankDriver
from typing import Any, Tuple
from griptape.drivers import DummyPromptDriver
from .gtUIBaseDriver import gtUIBaseDriver
@@ -7,7 +9,7 @@ class gtUIBaseRerankDriver(gtUIBaseDriver):
DESCRIPTION = "Griptape Rerank Driver"
@classmethod
def INPUT_TYPES(s):
def INPUT_TYPES(cls):
inputs = super().INPUT_TYPES()
inputs["required"].update()
inputs["optional"].update()
@@ -18,6 +20,6 @@ class gtUIBaseRerankDriver(gtUIBaseDriver):
RETURN_TYPES = ("RERANK_DRIVER",)
def create(self, **kwargs):
driver = BaseRerankDriver()
def create(self, **kwargs) -> Tuple[Any, ...]:
driver = DummyPromptDriver()
return (driver,)
+6 -6
View File
@@ -1,4 +1,6 @@
from griptape.drivers import BaseTextToSpeechDriver
from typing import Any, Tuple
from griptape.drivers import DummyTextToSpeechDriver
from .gtUIBaseDriver import gtUIBaseDriver
@@ -7,7 +9,7 @@ class gtUIBaseTextToSpeechDriver(gtUIBaseDriver):
DESCRIPTION = "Griptape Text to Speech Driver"
@classmethod
def INPUT_TYPES(s):
def INPUT_TYPES(cls):
return {
"required": {},
"optional": {
@@ -35,8 +37,6 @@ class gtUIBaseTextToSpeechDriver(gtUIBaseDriver):
CATEGORY = "Griptape/Agent Drivers/Text to Speech"
def create(self, **kwargs):
model = kwargs.get("text_to_speech_model", "eleven_multilingual_v2")
voice = kwargs.get("voice", "Matilda")
driver = BaseTextToSpeechDriver(model=model, voice=voice)
def create(self, **kwargs) -> Tuple[Any, ...]:
driver = DummyTextToSpeechDriver()
return (driver,)
+6 -4
View File
@@ -1,6 +1,8 @@
from typing import Any, Tuple
from griptape.drivers import (
BaseVectorStoreDriver,
DummyEmbeddingDriver,
DummyVectorStoreDriver,
OpenAiEmbeddingDriver,
)
@@ -14,7 +16,7 @@ class gtUIBaseVectorStoreDriver(gtUIBaseDriver):
DESCRIPTION = "Griptape Embedding Driver"
@classmethod
def INPUT_TYPES(s):
def INPUT_TYPES(cls):
inputs = super().INPUT_TYPES()
inputs["required"].update()
inputs["optional"].update(
@@ -41,7 +43,7 @@ class gtUIBaseVectorStoreDriver(gtUIBaseDriver):
else:
return DummyEmbeddingDriver()
def create(self, **kwargs):
def create(self, **kwargs) -> Tuple[Any, ...]:
embedding_driver = kwargs.get("embedding_driver", None)
params = {}
@@ -50,5 +52,5 @@ class gtUIBaseVectorStoreDriver(gtUIBaseDriver):
else:
params["embedding_driver"] = self.get_default_embedding_driver()
driver = BaseVectorStoreDriver(**params)
driver = DummyVectorStoreDriver()
return (driver,)
+4 -6
View File
@@ -1,11 +1,11 @@
from griptape.drivers import BaseWebSearchDriver
from typing import Any, Tuple
from .gtUIBaseDriver import gtUIBaseDriver
class gtUIBaseWebSearchDriver(gtUIBaseDriver):
@classmethod
def INPUT_TYPES(s):
def INPUT_TYPES(cls):
return {
"required": {},
"optional": {},
@@ -18,8 +18,6 @@ class gtUIBaseWebSearchDriver(gtUIBaseDriver):
CATEGORY = "Griptape/Agent Drivers/Web Search"
def create(
self,
):
driver = BaseWebSearchDriver()
def create(self, **kwargs) -> Tuple[Any, ...]:
driver = None
return (driver,)
@@ -28,7 +28,7 @@ class gtUIBlackForestImageGenerationDriver(gtUIBaseImageGenerationDriver):
DESCRIPTION = "Black Forest Image Generation Driver to use Flux models."
@classmethod
def INPUT_TYPES(s):
def INPUT_TYPES(cls):
inputs = super().INPUT_TYPES()
inputs["optional"].update(
{
@@ -183,7 +183,7 @@ class gtUIBlackForestImageGenerationDriver(gtUIBaseImageGenerationDriver):
if model == "flux-pro-1.0-fill":
if guidance is not None and guidance > 0:
if guidance < 1.5:
guidance == 1.5
guidance = 1.5
if guidance > 100:
raise ValueError(
f"When using {model}, guidance must be between 1.5 and 100."
@@ -193,14 +193,14 @@ class gtUIBlackForestImageGenerationDriver(gtUIBaseImageGenerationDriver):
if model in ["flux-pro-1.0-canny", "flux-pro-1.0-depth"]:
if guidance is not None and guidance > 0:
if guidance < 1:
guidance == 1
guidance = 1
params["guidance"] = float(guidance)
# Dev/Pro specific settings
if model in ["flux-dev", "flux-pro"]:
if guidance is not None and guidance > 0:
if guidance < 1.5:
guidance == 1.5
guidance = 1.5
if guidance > 5:
raise ValueError(
f"When using {model}, guidance must be between 1.5 and 5."
@@ -237,8 +237,9 @@ class gtUIBlackForestImageGenerationDriver(gtUIBaseImageGenerationDriver):
def create(self, **kwargs):
params = self.build_params(**kwargs)
params["max_attempts"] = 1
driver = None
try:
driver = BlackForestImageGenerationDriver(**params)
driver = BlackForestImageGenerationDriver(**params) # type: ignore[reportPossiblyUnboundVariable]
except Exception as e:
print(f"Error creating BlackForestImageGenerationDriver: {e}")
return (None,)
+1 -1
View File
@@ -11,7 +11,7 @@ class gtUICohereEmbeddingDriver(gtUIBaseEmbeddingDriver):
DESCRIPTION = "Cohere Embedding Driver"
@classmethod
def INPUT_TYPES(s):
def INPUT_TYPES(cls):
inputs = super().INPUT_TYPES()
inputs["required"].update()
+1 -1
View File
@@ -16,7 +16,7 @@ DEFAULT_API_KEY_ENV_VAR = "COHERE_API_KEY"
class gtUICoherePromptDriver(gtUIBasePromptDriver):
@classmethod
def INPUT_TYPES(s):
def INPUT_TYPES(cls):
inputs = super().INPUT_TYPES()
inputs["optional"].update(
+1 -1
View File
@@ -10,7 +10,7 @@ class gtUICohereRerankDriver(gtUIBaseRerankDriver):
DESCRIPTION = "Cohere Rerank Driver"
@classmethod
def INPUT_TYPES(s):
def INPUT_TYPES(cls):
inputs = super().INPUT_TYPES()
inputs["required"].update()
inputs["optional"].update(
@@ -6,8 +6,6 @@ from .gtUIBaseWebSearchDriver import gtUIBaseWebSearchDriver
class gtUIDuckDuckGoWebSearchDriver(gtUIBaseWebSearchDriver):
DESCRIPTION = "DuckDuckGo Web Search Driver"
def create(
self,
):
def create(self, **kwargs):
driver = DuckDuckGoWebSearchDriver()
return (driver,)
@@ -11,7 +11,7 @@ class gtUIElevenLabsTextToSpeechDriver(gtUIBaseTextToSpeechDriver):
DESCRIPTION = "Griptape ElevenLabs to Speech Driver: https://elevenlabs.io/apps/"
@classmethod
def INPUT_TYPES(s):
def INPUT_TYPES(cls):
inputs = super().INPUT_TYPES()
inputs["optional"].update(
+1 -1
View File
@@ -11,7 +11,7 @@ class gtUIExaWebSearchDriver(gtUIBaseWebSearchDriver):
DESCRIPTION = "Exa Web Search Driver. Requires environment variables EXA_API_KEY."
@classmethod
def INPUT_TYPES(s):
def INPUT_TYPES(cls):
inputs = super().INPUT_TYPES()
inputs["required"].update(
{
+1 -1
View File
@@ -19,7 +19,7 @@ class gtUIGoogleEmbeddingDriver(gtUIBaseEmbeddingDriver):
DESCRIPTION = "Google Embedding Driver"
@classmethod
def INPUT_TYPES(s):
def INPUT_TYPES(cls):
inputs = super().INPUT_TYPES()
inputs["required"].update()
inputs["optional"].update(
+1 -1
View File
@@ -9,7 +9,7 @@ DEFAULT_API_KEY_ENV_VAR = "GOOGLE_API_KEY"
class gtUIGooglePromptDriver(gtUIBasePromptDriver):
@classmethod
def INPUT_TYPES(s):
def INPUT_TYPES(cls):
inputs = super().INPUT_TYPES()
inputs["optional"].update(
+1 -1
View File
@@ -10,7 +10,7 @@ class gtUIGoogleWebSearchDriver(gtUIBaseWebSearchDriver):
DESCRIPTION = "Google Web Search Driver. Requires environment variables GOOGLE_API_KEY and GOOGLE_API_SEARCH_ID."
@classmethod
def INPUT_TYPES(s):
def INPUT_TYPES(cls):
inputs = super().INPUT_TYPES()
inputs["required"].update(
{
@@ -12,7 +12,7 @@ class gtUIGriptapeCloudVectorStoreDriver(gtUIBaseVectorStoreDriver):
DESCRIPTION = "Griptape Cloud Vector Store Driver: https://cloud.griptape.ai"
@classmethod
def INPUT_TYPES(s):
def INPUT_TYPES(cls):
inputs = super().INPUT_TYPES()
del inputs["optional"]["embedding_driver"]
inputs["required"].update()
@@ -48,7 +48,7 @@ class gtUIGriptapeCloudVectorStoreDriver(gtUIBaseVectorStoreDriver):
api_key_env_var = kwargs.get("api_key_env_var", API_KEY_ENV)
base_url = kwargs.get("base_url", BASE_URL)
knowledge_base_id = kwargs.get("knowledge_base_id", "12345-abcde-1434")
api_key = None
if api_key_env_var:
api_key = self.getenv(api_key_env_var)
@@ -12,7 +12,7 @@ class gtUIHuggingFaceHubEmbeddingDriver(gtUIBaseEmbeddingDriver):
DESCRIPTION = "Hugging Face Hub Embedding Driver"
@classmethod
def INPUT_TYPES(s):
def INPUT_TYPES(cls):
inputs = super().INPUT_TYPES()
inputs["required"].update()
inputs["optional"].update(
@@ -68,6 +68,7 @@ class gtUIHuggingFaceHubEmbeddingDriver(gtUIBaseEmbeddingDriver):
def create(self, **kwargs):
params = self.build_params(**kwargs)
driver = None
try:
driver = HuggingFaceHubEmbeddingDriver(**params)
except Exception as e:
@@ -11,7 +11,7 @@ class gtUIHuggingFaceHubPromptDriver(gtUIBasePromptDriver):
DESCRIPTION = "Hugging Face Hub Prompt Driver"
@classmethod
def INPUT_TYPES(s):
def INPUT_TYPES(cls):
inputs = super().INPUT_TYPES()
inputs["required"].update({})
@@ -1,3 +1,4 @@
# pyright: reportMissingImports=false
from comfy_execution.graph import ExecutionBlocker
from griptape.drivers import OpenAiChatPromptDriver
@@ -10,7 +11,7 @@ DEFAULT_API_KEY = "lm_studio"
class gtUILMStudioChatPromptDriver(gtUIOpenAiCompatibleChatPromptDriver):
@classmethod
def INPUT_TYPES(s):
def INPUT_TYPES(cls):
inputs = super().INPUT_TYPES()
del inputs["optional"]["api_key_env_var"]
+1 -1
View File
@@ -9,7 +9,7 @@ DEFAULT_API_KEY = "lm_studio"
class gtUILMStudioEmbeddingDriver(gtUIOpenAiCompatibleEmbeddingDriver):
@classmethod
def INPUT_TYPES(s):
def INPUT_TYPES(cls):
inputs = super().INPUT_TYPES()
del inputs["optional"]["api_key_env_var"]
@@ -70,7 +70,7 @@ class gtUILeonardoImageGenerationDriver(gtUIBaseImageGenerationDriver):
)
@classmethod
def INPUT_TYPES(s):
def INPUT_TYPES(cls):
models = []
for model in leonardo_models:
models.append(model["name"])
+2 -2
View File
@@ -8,7 +8,7 @@ class gtUILocalStructureRunDriver:
DESCRIPTION = "Local Structure Run Driver"
@classmethod
def INPUT_TYPES(s):
def INPUT_TYPES(cls):
return {
"required": {},
"optional": {"agent": ("AGENT", {"forceInput": True, "default": None})},
@@ -28,7 +28,7 @@ class gtUILocalStructureRunDriver:
):
if agent:
# Create a local structure function
driver = LocalStructureRunDriver(structure_factory_fn=lambda: agent)
driver = LocalStructureRunDriver(create_structure=lambda: agent)
return (driver,)
else:
return None
+1 -1
View File
@@ -11,7 +11,7 @@ class gtUILocalVectorStoreDriver(gtUIBaseVectorStoreDriver):
DESCRIPTION = "Griptape Local Vector Store Driver"
@classmethod
def INPUT_TYPES(s):
def INPUT_TYPES(cls):
inputs = super().INPUT_TYPES()
inputs["required"].update()
inputs["optional"].update(
+2 -2
View File
@@ -13,7 +13,7 @@ class gtUIMarqoVectorStoreDriver(gtUIBaseVectorStoreDriver):
DESCRIPTION = "Griptape Marqo Vector Store Driver: https://www.marqo.ai/"
@classmethod
def INPUT_TYPES(s):
def INPUT_TYPES(cls):
inputs = super().INPUT_TYPES()
inputs["required"].update()
inputs["optional"].update(
@@ -65,5 +65,5 @@ class gtUIMarqoVectorStoreDriver(gtUIBaseVectorStoreDriver):
def create(self, **kwargs):
params = self.build_params(**kwargs)
driver = MarqoVectorStoreDriver(**params)
driver = MarqoVectorStoreDriver(**params) # type: ignore[reportArgumentType]
return (driver,)
@@ -17,7 +17,7 @@ class gtUIMongoDbAtlasVectorStoreDriver(gtUIBaseVectorStoreDriver):
DESCRIPTION = "Griptape Mongodb Atlas Vector Store Driver: https://www.mongodb.com/products/platform/atlas-database"
@classmethod
def INPUT_TYPES(s):
def INPUT_TYPES(cls):
inputs = super().INPUT_TYPES()
inputs["required"].update()
inputs["optional"].update(
@@ -112,5 +112,5 @@ class gtUIMongoDbAtlasVectorStoreDriver(gtUIBaseVectorStoreDriver):
def create(self, **kwargs):
params = self.build_params(**kwargs)
driver = MongoDbAtlasVectorStoreDriver(**params)
driver = MongoDbAtlasVectorStoreDriver(**params) # type: ignore[reportArgumentType]
return (driver,)
+2 -2
View File
@@ -15,7 +15,7 @@ default_base_url = "http://127.0.0.1"
class gtUIOllamaEmbeddingDriver(gtUIBaseEmbeddingDriver):
@classmethod
def INPUT_TYPES(s):
def INPUT_TYPES(cls):
inputs = super().INPUT_TYPES()
inputs["required"].update(
@@ -48,7 +48,7 @@ class gtUIOllamaEmbeddingDriver(gtUIBaseEmbeddingDriver):
return inputs
@classmethod
def VALIDATE_INPUTS(s, embedding_model):
def VALIDATE_INPUTS(cls, embedding_model):
if not embedding_model:
return """
+1 -1
View File
@@ -13,7 +13,7 @@ default_base_url = "http://127.0.0.1"
class gtUIOllamaPromptDriver(gtUIBasePromptDriver):
@classmethod
def INPUT_TYPES(s):
def INPUT_TYPES(cls):
inputs = super().INPUT_TYPES()
# Get the base required and optional inputs
base_required_inputs = inputs["required"]
@@ -15,7 +15,7 @@ class gtUIOpenAiAudioTranscriptionDriver(gtUIBaseAudioTranscriptionDriver):
DESCRIPTION = "OpenAI Audio Transcription Driver"
@classmethod
def INPUT_TYPES(s):
def INPUT_TYPES(cls):
inputs = super().INPUT_TYPES()
inputs["optional"].update(
+1 -1
View File
@@ -11,7 +11,7 @@ DEFAULT_API_KEY = "OPENAI_API_KEY"
class gtUIOpenAiChatPromptDriver(gtUIBasePromptDriver):
@classmethod
def INPUT_TYPES(s):
def INPUT_TYPES(cls):
inputs = super().INPUT_TYPES()
# Get the base required and optional inputs
@@ -9,7 +9,7 @@ DEFAULT_API_KEY_ENV = "OPENAI_API_KEY"
class gtUIOpenAiCompatibleChatPromptDriver(gtUIOpenAiChatPromptDriver):
@classmethod
def INPUT_TYPES(s):
def INPUT_TYPES(cls):
inputs = super().INPUT_TYPES()
inputs["optional"].update(

Some files were not shown because too many files have changed in this diff Show More