diff --git a/README.md b/README.md index 5141a0e..7bf44b2 100644 --- a/README.md +++ b/README.md @@ -106,6 +106,7 @@ You can previous and download more examples [here](examples/README.md). ### Nov 28, 2024 * ⚠️ **Temporarily removed BlackForestLabs Driver nodes while resolving install issues**. There appears to be an installation issue for these nodes, so I'm _temporarily_ removing them until it's resolved. +* Removed old configuration settings - now relying completely on ComfyUI's official settings ### Nov 27, 2024 @@ -116,19 +117,9 @@ You can previous and download more examples [here](examples/README.md). ### Nov 26, 2024 * Upgrade to Griptape Framework v0.34.3 * New Nodes: - * `Griptape Driver: Black Forest Labs Image Generation` - Now generate images with the incredible Flux models - `flux-pro-1.1`, `flux-pro`, `flux-dev`, and `flux-pro-1.1-ultra`. - - Requires an API_KEY from Black Forest Labs (https://docs.bfl.ml/) - - Utilizes new Griptape Extension: https://github.com/griptape-ai/griptape-black-forest - - ![Black Forest Labs - Create Image](examples/griptape_black_forest_labs_create_image.png) - - - It also works with the `Griptape Create: Image Variation` node. - - ![Black Forest Labs - Image Variation](examples/griptape_black_forest_labs_create_variation.png) - * `Griptape Create: Image Inpainting Variation` to the Griptape -> Image menu. Gives the ability to paint a mask and replace that part of the image. - ![Black Forest Labs - Inpainting](examples/griptape_black_forest_flux_inpainting.png) + ![Inpainting](examples/inpainting.png) * `Griptape Run: Task` - Combines/Replaces `Griptape Run: Prompt Task`, `Griptape Run: Tool Task`, and `Griptape Run Toolkit Task` into a single node that knows what to do. * `Griptape Run: Text Extraction` to the Griptape -> Text menu diff --git a/__init__.py b/__init__.py index 752fd40..dfbc012 100644 --- a/__init__.py +++ b/__init__.py @@ -291,19 +291,8 @@ 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() @@ -312,9 +301,6 @@ # 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" @@ -483,15 +469,21 @@ } # Let's do the settings - +print(" \033[32m- Creating Settings\033[0m") root = "Griptape" +print(" \033[32m- Instantiating\033[0m") settings = GriptapeSettings() + +print(" \033[32m- Getting key configuration\033[0m") settings.get_key_config() +print(" \033[32m- Getting all services\033[0m") 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)) + +print(" \033[32m- Saving settings\033[0m") settings.save_settings() __all__ = ["NODE_CLASS_MAPPINGS", "WEB_DIRECTORY"] diff --git a/examples/Photographer-Workflow-Comparison-Example.json b/examples/Photographer-Workflow-Comparison-Example.json index ebf2e78..1ccf074 100644 --- a/examples/Photographer-Workflow-Comparison-Example.json +++ b/examples/Photographer-Workflow-Comparison-Example.json @@ -83,14 +83,14 @@ "type": "Griptape Create: Rules", "pos": [ -100, - 50 + 25 ], "size": [ 400, 200 ], "flags": {}, - "order": 0, + "order": 9, "mode": 0, "inputs": [], "outputs": [ @@ -115,7 +115,7 @@ }, "widgets_values": [ "Cinematographer Ruleset", - "You identify as a cinematographer\nThe main subject of the image should be well framed\nIf no environment is specified, set the image in a location that will evoke a deep and meaningful connection to the viewer.\nYou care deeply about light, shadow, color, and composition\nWhen coming up with image prompts, you always specify the position of the camera, the lens, and the color\nYou are specific about the technical details of a shot.\nYour responses are brief and concise\nAlways respond with your identity so the agent knows who you are." + "You identify as a cinematographer\nThe main subject of the image should be well framed\nIf no environment is specified, set the image in a location that will evoke a deep and meaningful connection to the viewer.\nYou care deeply about light, shadow, color, and composition\nWhen coming up with image prompts, you always specify the position of the camera, the lens, and the color\nYou are specific about the technical details of a shot.\nYou like to add atmosphere to your shots, so you include depth of field, haze, dust particles in the air close to and far away from camera, and the way lighting reacts with each item.\nYour responses are brief and concise\nAlways respond with your identity so the agent knows who you are." ], "color": "#233", "bgcolor": "#355" @@ -132,7 +132,7 @@ 200 ], "flags": {}, - "order": 1, + "order": 0, "mode": 0, "inputs": [], "outputs": [ @@ -249,7 +249,7 @@ 168.68878173828125 ], "flags": {}, - "order": 2, + "order": 1, "mode": 0, "inputs": [], "outputs": [ @@ -408,7 +408,7 @@ 58 ], "flags": {}, - "order": 3, + "order": 2, "mode": 0, "inputs": [], "outputs": [ @@ -623,7 +623,7 @@ 219.29710388183594 ], "flags": {}, - "order": 9, + "order": 8, "mode": 0, "inputs": [], "outputs": [ @@ -648,7 +648,7 @@ }, "widgets_values": [ "Agent Rules", - "You are creating a prompot for an image generation engine.\nYou have access to topic experts in their respective fields\nWork with the experts to get the results you need\nYou facilitate communication between them.\nIf they ask for feedback, you can provide it.\nAsk the expert on image prompting for the final prompt.\nOutput only the final image generation prompt. Do not wrap in markdown context." + "You are creating a prompt for an image generation engine.\nYou have access to topic experts in their respective fields\nWork with the experts to get the results you need\nYou facilitate communication between them.\nIf they ask for feedback, you can provide it.\nAsk the expert on image prompting for the final prompt.\nOutput only the final image generation prompt. Do not wrap in markdown context." ], "color": "#233", "bgcolor": "#355" @@ -829,7 +829,7 @@ }, "widgets_values": [ "", - "High-angle shot from above of a faded lavender-colored stuffed bunny with a torn and frayed pink satin bow, sitting on a vintage, ornate music box in a dimly lit antique shop. The bunny has glassy plastic eyes and a worn velvet patch on its left ear, giving it a soft, dreamy appearance. Captured with a Red Epic-W camera using an 85mm T1.8 lens, the image features muted colors with blue undertones and pastel shades of pale pink or baby blue, creating a nostalgic and ethereal atmosphere." + "Stuffed bunny sitting on a worn, wooden workbench in an old, dimly lit antique shop. Camera at a 45-degree angle with a medium telephoto lens (50mm). Warm, golden light from a nearby window creates a soft, nostalgic glow on the bunny's fur, casting deep shadows across the workbench. Worn, velvety texture with a hand-sewn patch on its left ear, bright red rubber button nose, tiny golden bell around its neck. Colors clash with bright pink and white, creating visual tension. Dust particles float in the air, hint of old wood polish on the workbench, subtle haze outside the window." ], "color": "#222", "bgcolor": "#000" @@ -964,7 +964,7 @@ 106 ], "flags": {}, - "order": 4, + "order": 3, "mode": 0, "inputs": [], "outputs": [ @@ -1001,7 +1001,7 @@ 200 ], "flags": {}, - "order": 5, + "order": 4, "mode": 0, "inputs": [], "outputs": [ @@ -1162,7 +1162,7 @@ 26 ], "flags": {}, - "order": 6, + "order": 5, "mode": 0, "inputs": [], "outputs": [ @@ -1271,7 +1271,7 @@ 106 ], "flags": {}, - "order": 7, + "order": 6, "mode": 0, "inputs": [], "outputs": [ @@ -1348,10 +1348,10 @@ ], "size": [ 466.1999816894531, - 332 + 356 ], "flags": {}, - "order": 8, + "order": 7, "mode": 0, "inputs": [], "outputs": [ @@ -1372,14 +1372,15 @@ "http://127.0.0.1", "11434", "Prompt Driver", - "llama3.1:latest", + "llama3.2:latest", 10, 0.1, 2048, "fixed", true, -1, - "Embedding Driver", + 240, + "nomic-embed-text:latest", "nomic-embed-text:latest" ], "color": "#2a363b", @@ -1759,10 +1760,10 @@ "config": {}, "extra": { "ds": { - "scale": 0.5644739300537773, + "scale": 0.23525020508613764, "offset": [ - -848.1325481151173, - 359.3482043102513 + 1204.3115464816442, + 1977.246169189889 ] }, "info": { diff --git a/examples/Photographer-Workflow-Comparison-Example.png b/examples/Photographer-Workflow-Comparison-Example.png index a6ea1f9..9117d40 100644 Binary files a/examples/Photographer-Workflow-Comparison-Example.png and b/examples/Photographer-Workflow-Comparison-Example.png differ diff --git a/examples/inpainting.png b/examples/inpainting.png new file mode 100644 index 0000000..ed03298 Binary files /dev/null and b/examples/inpainting.png differ diff --git a/js/griptape_api_keys.js b/js/griptape_api_keys.js index 6342c03..af3bd82 100644 --- a/js/griptape_api_keys.js +++ b/js/griptape_api_keys.js @@ -1,27 +1,27 @@ export const keys_organized = { "@Griptape": ["GRIPTAPE_CLOUD_API_KEY"], - OpenAI: ["OPENAI_API_KEY"], - Amazon: [ + "OpenAI": ["OPENAI_API_KEY"], + "Amazon": [ "AWS_ACCESS_KEY_ID", "AWS_SECRET_ACCESS_KEY", "AWS_DEFAULT_REGION", "AMAZON_OPENSEARCH_HOST", "AMAZON_OPENSEARCH_INDEX_NAME", ], - Anthropic: ["ANTHROPIC_API_KEY"], + "Anthropic": ["ANTHROPIC_API_KEY"], "Microsoft Azure": [ "AZURE_OPENAI_ENDPOINT", "AZURE_OPENAI_DALL_E_3_ENDPOINT", "AZURE_OPENAI_DALL_E_3_API_KEY", "AZURE_OPENAI_API_KEY", ], - Cohere: ["COHERE_API_KEY"], + "Cohere": ["COHERE_API_KEY"], "Eleven Labs": ["ELEVEN_LABS_API_KEY"], - Exa: ["EXA_API_KEY"], - Groq: ["GROQ_API_KEY"], - Google: ["GOOGLE_API_KEY", "GOOGLE_API_SEARCH_ID"], - Huggingface: ["HUGGINGFACE_HUB_ACCESS_TOKEN"], - LeonardoAI: ["LEONARDO_API_KEY"], - Pinecone: ["PINECONE_API_KEY", "PINECONE_ENVIRONMENT", "PINECONE_INDEX_NAME"], - Tavily: ["TAVILY_API_KEY"], + "Exa": ["EXA_API_KEY"], + "Groq": ["GROQ_API_KEY"], + "Google": ["GOOGLE_API_KEY", "GOOGLE_API_SEARCH_ID"], + "Huggingface": ["HUGGINGFACE_HUB_ACCESS_TOKEN"], + "LeonardoAI": ["LEONARDO_API_KEY"], + "Pinecone": ["PINECONE_API_KEY", "PINECONE_ENVIRONMENT", "PINECONE_INDEX_NAME"], + "Tavily": ["TAVILY_API_KEY"], }; diff --git a/js/gtUINodes.js b/js/gtUINodes.js index 0bf2f10..a123caf 100644 --- a/js/gtUINodes.js +++ b/js/gtUINodes.js @@ -28,6 +28,13 @@ app.registerExtension({ api.addEventListener("comfy.gtUI.runagent", messageHandler); // Create the settings + app.ui.settings.addSetting({ + id: `Griptape.default_config`, + category: ["Griptape", "@Griptape", "default_config"], + name: "default_config", + type: "dict", + defaultValue: "", + }); Object.entries(keys_organized).forEach(([category, keys]) => { keys.forEach((key) => { app.ui.settings.addSetting({ diff --git a/nodes/agent/BaseAgent.py b/nodes/agent/BaseAgent.py index cb5c11c..46dd6ba 100644 --- a/nodes/agent/BaseAgent.py +++ b/nodes/agent/BaseAgent.py @@ -5,8 +5,9 @@ from griptape.tools import QueryTool, RagTool, VectorStoreTool from openai import OpenAIError +from ...py.griptape_settings import GriptapeSettings + # from server import PromptServer -from ...py.griptape_config import get_config from .gtComfyAgent import gtComfyAgent default_prompt = "{{ input_string }}" @@ -14,7 +15,8 @@ def get_default_config(): - return get_config("agent_config") + settings = GriptapeSettings() + return settings.get_settings_key("default_config") class BaseAgent: diff --git a/nodes/agent/SetDefaultAgent.py b/nodes/agent/SetDefaultAgent.py deleted file mode 100644 index 1b35f8f..0000000 --- a/nodes/agent/SetDefaultAgent.py +++ /dev/null @@ -1,28 +0,0 @@ -from ...py.griptape_config import update_config_with_dict -from .BaseAgent import BaseAgent - - -class gtUISetDefaultAgent(BaseAgent): - DESCRIPTION = "Set the default agent." - - @classmethod - def INPUT_TYPES(s): - inputs = super().INPUT_TYPES() - del inputs["optional"]["tools"] - del inputs["optional"]["rulesets"] - del inputs["optional"]["input_string"] - del inputs["optional"]["STRING"] - return inputs - - RETURN_TYPES = ("CONFIG",) - OUTPUT_NODE = True - - def run(self, **kwargs): - config = kwargs.get("config", None) - agent = kwargs.get("agent", None) - if config: - update_config_with_dict(config.to_dict()) - if agent: - config = agent.drivers_config - update_config_with_dict(config.to_dict()) - return (config,) diff --git a/nodes/agent/gtComfyAgent.py b/nodes/agent/gtComfyAgent.py index 5382214..5ad20f6 100644 --- a/nodes/agent/gtComfyAgent.py +++ b/nodes/agent/gtComfyAgent.py @@ -3,15 +3,12 @@ from griptape.configs.drivers import DriversConfig, OpenAiDriversConfig from griptape.structures import Agent -from ...py.griptape_config import get_config from ...py.griptape_settings import GriptapeSettings default_prompt = "{{ input_string }}" load_dotenv() -# agent = Agent() - class gtComfyAgent(Agent): def __init__(self, *args, **kwargs): @@ -20,20 +17,29 @@ def __init__(self, *args, **kwargs): if drivers_config is None: # Get the default config - agent_config = get_config("agent_config") - if agent_config: - Defaults.drivers_config = DriversConfig.from_dict(agent_config) - kwargs["prompt_driver"] = Defaults.drivers_config.prompt_driver - else: - # Set the default config - settings = GriptapeSettings() - api_key = settings.get_settings_key_or_use_env("OPENAI_API_KEY") + settings = GriptapeSettings() + agent_config = settings.get_settings_key("default_config") + try: + if agent_config: + Defaults.drivers_config = DriversConfig.from_dict(agent_config) + kwargs["prompt_driver"] = Defaults.drivers_config.prompt_driver + else: + # Set the default config + settings = GriptapeSettings() + api_key = settings.get_settings_key_or_use_env("OPENAI_API_KEY") + Defaults.drivers_config = OpenAiDriversConfig() + Defaults.drivers_config.prompt_driver.api_key = api_key + Defaults.drivers_config.embedding_driver.api_key = api_key + Defaults.drivers_config.text_to_speech_driver.api_key = api_key + Defaults.drivers_config.audio_transcription_driver.api_key = api_key + Defaults.drivers_config.image_generation_driver.api_key = api_key + except Exception: + print( + "Warning - default agent settings are corrupted.\nSetting default to OpenAIDriversConfig" + ) Defaults.drivers_config = OpenAiDriversConfig() - Defaults.drivers_config.prompt_driver.api_key = api_key - Defaults.drivers_config.embedding_driver.api_key = api_key - Defaults.drivers_config.text_to_speech_driver.api_key = api_key - Defaults.drivers_config.audio_transcription_driver.api_key = api_key - Defaults.drivers_config.image_generation_driver.api_key = api_key + settings.overwrite_settings_key("Griptape.default_config", None) + settings.save_settings() else: Defaults.drivers_config = drivers_config @@ -48,7 +54,9 @@ def __init__(self, *args, **kwargs): self.drivers_config = Defaults.drivers_config def set_default_config(self): - agent_config = get_config("agent_config") + # agent_config = get_config("agent_config") + settings = GriptapeSettings() + agent_config = settings.get_settings_key("default_config") if agent_config: config = DriversConfig.from_dict(agent_config) new_agent = self.update_config(config) diff --git a/nodes/agent/gtUIReplaceRulesetsOnAgent.py b/nodes/agent/gtUIReplaceRulesetsOnAgent.py index cbd325e..9b122e4 100644 --- a/nodes/agent/gtUIReplaceRulesetsOnAgent.py +++ b/nodes/agent/gtUIReplaceRulesetsOnAgent.py @@ -1,5 +1,4 @@ # from server import PromptServer -from ...py.griptape_config import get_config from .BaseAgent import BaseAgent from .gtComfyAgent import gtComfyAgent @@ -7,10 +6,6 @@ max_attempts_default = 10 -def get_default_config(): - return get_config("agent_config") - - class gtUIReplaceRulesetsOnAgent(BaseAgent): """ Replace Rulesets on an Agent diff --git a/nodes/agent/gtUIReplaceToolsOnAgent.py b/nodes/agent/gtUIReplaceToolsOnAgent.py index e12faa5..15c3b56 100644 --- a/nodes/agent/gtUIReplaceToolsOnAgent.py +++ b/nodes/agent/gtUIReplaceToolsOnAgent.py @@ -1,5 +1,4 @@ # from server import PromptServer -from ...py.griptape_config import get_config from .BaseAgent import BaseAgent from .gtComfyAgent import gtComfyAgent @@ -7,10 +6,6 @@ max_attempts_default = 10 -def get_default_config(): - return get_config("agent_config") - - class gtUIReplaceToolsOnAgent(BaseAgent): """ Replace Tools on an Agent diff --git a/nodes/agent/gtUIRunAgent.py b/nodes/agent/gtUIRunAgent.py index 9db0ec2..fcf29cd 100644 --- a/nodes/agent/gtUIRunAgent.py +++ b/nodes/agent/gtUIRunAgent.py @@ -2,7 +2,6 @@ from openai import OpenAIError # from server import PromptServer -from ...py.griptape_config import get_config from .gtComfyAgent import gtComfyAgent default_prompt = "{{ input_string }}" @@ -17,10 +16,6 @@ def __ne__(self, __value: object) -> bool: any = AnyType("*") -def get_default_config(): - return get_config("agent_config") - - run_types = ["Default", "Prompt", "Tool(s)", "Summarize"] diff --git a/nodes/agent/gtUISetDefaultAgent.py b/nodes/agent/gtUISetDefaultAgent.py index 3ad3f27..afc040b 100644 --- a/nodes/agent/gtUISetDefaultAgent.py +++ b/nodes/agent/gtUISetDefaultAgent.py @@ -1,4 +1,4 @@ -from ...py.griptape_config import update_config_with_dict +from ...py.griptape_settings import GriptapeSettings from .BaseAgent import BaseAgent @@ -19,6 +19,12 @@ def INPUT_TYPES(s): OUTPUT_NODE = True def run(self, config=None): + settings = GriptapeSettings() if config: - update_config_with_dict(config.to_dict()) + config_dict = config.to_dict() + settings.overwrite_settings_key("Griptape.default_config", config_dict) + settings.save_settings() + else: + settings.overwrite_settings_key("Griptape.default_config", None) + settings.save_settings() return (config,) diff --git a/nodes/drivers/gtUIOllamaPromptDriver.py b/nodes/drivers/gtUIOllamaPromptDriver.py index f356adf..6414c86 100644 --- a/nodes/drivers/gtUIOllamaPromptDriver.py +++ b/nodes/drivers/gtUIOllamaPromptDriver.py @@ -55,6 +55,11 @@ def INPUT_TYPES(s): FUNCTION = "create" + def VALIDATE_INPUTS(self, keep_alive, **kwargs): + if keep_alive < 0: + return "Keep alive must be greater than or equal to 0" + return True + def build_params(self, **kwargs): model = kwargs.get("model", None) base_url = kwargs.get("base_url", default_base_url) @@ -75,7 +80,7 @@ def build_params(self, **kwargs): params["host"] = f"{base_url}:{port}" if max_tokens > 0: params["max_tokens"] = max_tokens - params["extra_params"] = {"keep_alive": keep_alive} + params["extra_params"] = {"keep_alive": int(keep_alive)} return params def create(self, **kwargs): diff --git a/py/griptape_config.py b/py/griptape_config.py deleted file mode 100644 index 31c2bc6..0000000 --- a/py/griptape_config.py +++ /dev/null @@ -1,134 +0,0 @@ -import json -import os - -# Constants for file paths -THIS_DIR = os.path.dirname(os.path.abspath(__file__)) -PARENT_DIR = os.path.dirname(THIS_DIR) -DEFAULT_CONFIG_FILE = os.path.join(PARENT_DIR, "griptape_config.json.default") -USER_CONFIG_FILE = os.path.join(PARENT_DIR, "griptape_config.json") - - -def load_json_file(file_path): - """ - Safely load a JSON file, returning an empty dictionary if the file does not exist or is invalid. - """ - if not os.path.exists(file_path): - print(f"File not found: {file_path}") - return {} - - try: - with open(file_path, "r") as file: - data = json.load(file) - return data - except FileNotFoundError: - print(f"File not found: {file_path}") - except json.JSONDecodeError as e: - print(f"Error decoding JSON from file: {file_path}, Error: {e}") - except Exception as e: - print( - f"Unexpected error occurred while loading JSON file: {file_path}, Error: {e}" - ) - - return {} - - -def merge_configs(default_config, user_config): - """ - Recursively merge user configuration into the default configuration, - ensuring new keys from default_config are always added. - """ - merged_config = user_config.copy() - - for key, value in default_config.items(): - if isinstance(value, dict): - # Recursively merge nested dictionaries - merged_config[key] = merge_configs(value, merged_config.get(key, {})) - elif key not in merged_config: - # Add new keys from default_config - merged_config[key] = value - # Existing keys in user_config are left unchanged - - return merged_config - - -def update_config_with_env(config): - """ - Update the configuration dictionary with environment variables where relevant. - """ - for key in config: - if isinstance(config[key], dict): - update_config_with_env( - config[key] - ) # Recursive call for nested dictionaries - else: - env_value = os.getenv(key) # Get environment variable - if config[key] == "" and env_value is not None: - config[key] = env_value - print(f"Updated {key} from environment variable.") - - -def save_config(config, file_path): - """ - Save a configuration dictionary to a JSON file. - """ - with open(file_path, "w") as file: - json.dump(config, file, indent=4) - - -def load_and_prepare_config(default_file, user_file): - """ - Load the default and user configurations, merge them, and return the merged config. - """ - print(" \033[34m- Loading configuration\033[0m") - default_config = load_json_file(default_file) - user_config = load_json_file(user_file) - final_config = merge_configs(default_config, user_config) - update_config_with_env(final_config) - save_config(final_config, user_file) - return final_config - - -def set_environment_variables_from_config(config): - """ - Set environment variables based on a given configuration dictionary. - """ - print(" \033[34m- Setting Environment Variables\033[0m") - env_config = config.get("env", {}) - for key, value in env_config.items(): - os.environ[key] = str(value) - - -def remove_null_values(data): - if isinstance(data, dict): - return {k: remove_null_values(v) for k, v in data.items() if v is not None} - elif isinstance(data, list): - return [remove_null_values(item) for item in data if item is not None] - else: - return data - - -def get_config(key, default=None): - """ - Retrieve a configuration value using a dot-separated key path from the user config file. - """ - config = load_json_file(USER_CONFIG_FILE) - parts = key.split(".") - for part in parts: - if part in config: - config = config[part] - else: - return default - return remove_null_values(config) - - -def update_config_with_dict(config_dict={}): - with open(USER_CONFIG_FILE, "r") as file: - existing_data = json.load(file) - - agent_config = {"agent_config": config_dict} - existing_data.update(agent_config) - - with open(USER_CONFIG_FILE, "w") as file: - json.dump( - existing_data, file, indent=4 - ) # Use indent=4 for pretty formatting, optional diff --git a/pyproject.toml b/pyproject.toml index d8649af..629426c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -26,7 +26,7 @@ priority = "explicit" [project] name = "comfyui-griptape" description = "Griptape LLM(Large Language Model) Nodes for ComfyUI." -version = "1.0.24" +version = "1.0.25" license = {file = "LICENSE"} dependencies = ["griptape[all]==0.34.3", "python-dotenv"]