Skip to content

Commit

Permalink
Merge pull request #145 from griptape-ai:dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
shhlife authored Oct 30, 2024
2 parents 65e55c7 + 474f1bc commit 203854d
Show file tree
Hide file tree
Showing 50 changed files with 909 additions and 176 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ You can previous and download more examples [here](examples/README.md).

## Recent Changelog

### Oct 31, 2024
* Added tooltips for all drivers to help clarify properties
* Added fix for Ollama Driver Config so it wouldn't fail if no embedding driver was specified.

### Oct 30, 2024
* Updated to Griptape Framework v0.34.0
* **Breaking Changes**
Expand Down
9 changes: 8 additions & 1 deletion js/versions.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
export const versions = {
"version": "0.34.0",
"version": "0.34.0a",
"releaseDate": "2024-10-30",
"name": "ComfyUI-Griptape",
"description": "Griptape integration for ComfyUI",
"author": "Jason Schleifer",
"repository": "https://github.com/griptape-ai/ComfyUI-Griptape",
"changelog": [
{
"version": "0.34.0a",
"date": "2024-10-31",
"changes": [
"fix for ollama driver to not break if no embedding driver specified",
]
},
{
"version": "0.34.0",
"date": "2024-10-30",
Expand Down
12 changes: 8 additions & 4 deletions nodes/config/gtUIOllamaDriversConfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

# StructureGlobalDriversConfig,
from griptape.drivers import (
DummyEmbeddingDriver,
LocalVectorStoreDriver,
OllamaEmbeddingDriver,
OllamaPromptDriver,
Expand Down Expand Up @@ -59,11 +60,14 @@ def create(self, **kwargs):
drivers_config_params["prompt_driver"] = OllamaPromptDriver(
**prompt_driver_params
)
drivers_config_params["embedding_driver"] = OllamaEmbeddingDriver(
**embedding_driver_params
)
if "model" not in embedding_driver_params:
drivers_config_params["embedding_driver"] = DummyEmbeddingDriver()
else:
drivers_config_params["embedding_driver"] = OllamaEmbeddingDriver(
**embedding_driver_params
)
drivers_config_params["vector_store_driver"] = LocalVectorStoreDriver(
embedding_driver=OllamaEmbeddingDriver(**embedding_driver_params)
embedding_driver=drivers_config_params["embedding_driver"]
)

try:
Expand Down
15 changes: 12 additions & 3 deletions nodes/drivers/gtUIAmazonBedrockPromptDriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,24 @@ def INPUT_TYPES(s):
{
"aws_access_key_id_env_var": (
"STRING",
{"default": DEFAULT_AWS_ACCESS_KEY_ID},
{
"default": DEFAULT_AWS_ACCESS_KEY_ID,
"tooltip": "Enter the name of the environment variable for your AWS_ACCESS_KEY_ID, not your actual key.",
},
),
"aws_secret_access_key_env_var": (
"STRING",
{"default": DEFAULT_AWS_SECRET_ACCESS_KEY},
{
"default": DEFAULT_AWS_SECRET_ACCESS_KEY,
"tooltip": "Enter the name of the environment variable for your AWS_SECRET_ACCESS_KEY, not your actual key.",
},
),
"aws_default_region_env_var": (
"STRING",
{"default": DEFAULT_AWS_DEFAULT_REGION},
{
"default": DEFAULT_AWS_DEFAULT_REGION,
"tooltip": "Enter the name of the environment variable for your AWS_DEFAULT_REGION, not your actual region.",
},
),
}
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,27 +52,60 @@ def INPUT_TYPES(s):

inputs["optional"].update(
{
"style_preset": (style_presets, {"default": style_presets[4]}),
"style_preset": (
style_presets,
{
"default": style_presets[4],
"tooltip": "Select a style preset for the image generation.",
},
),
"width": (
"INT",
{"default": 512, "min": 64, "max": 2048, "step": 64},
{
"default": 512,
"min": 64,
"max": 2048,
"step": 64,
"tooltip": "Specify the width of the generated image.",
},
),
"height": (
"INT",
{"default": 512, "min": 64, "max": 2048, "step": 64},
{
"default": 512,
"min": 64,
"max": 2048,
"step": 64,
"tooltip": "Specify the height of the generated image.",
},
),
"seed": (
"INT",
{
"default": 12345,
"tooltip": "Set the seed for random number generation to ensure reproducibility.",
},
),
"seed": ("INT", {"default": 12345}),
"aws_access_key_id_env_var": (
"STRING",
{"default": DEFAULT_AWS_ACCESS_KEY_ID},
{
"default": DEFAULT_AWS_ACCESS_KEY_ID,
"tooltip": "Enter the name of the environment variable for your AWS_ACCESS_KEY_ID, not your actual key.",
},
),
"aws_secret_access_key_env_var": (
"STRING",
{"default": DEFAULT_AWS_SECRET_ACCESS_KEY},
{
"default": DEFAULT_AWS_SECRET_ACCESS_KEY,
"tooltip": "Enter the name of the environment variable for your AWS_SECRET_ACCESS_KEY, not your actual key.",
},
),
"aws_default_region_env_var": (
"STRING",
{"default": DEFAULT_AWS_DEFAULT_REGION},
{
"default": DEFAULT_AWS_DEFAULT_REGION,
"tooltip": "Enter the name of the environment variable for your AWS_DEFAULT_REGION, not your actual region.",
},
),
}
)
Expand Down
20 changes: 16 additions & 4 deletions nodes/drivers/gtUIAmazonBedrockTitanEmbeddingDriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,31 @@ def INPUT_TYPES(s):
{
"embedding_model": (
models,
{"default": models[0]},
{
"default": models[0],
"tooltip": "Select the embedding model to use.",
},
),
"aws_access_key_id_env_var": (
"STRING",
{"default": DEFAULT_AWS_ACCESS_KEY_ID},
{
"default": DEFAULT_AWS_ACCESS_KEY_ID,
"tooltip": "Enter the name of the environment variable for your AWS_ACCESS_KEY_ID, not your actual key.",
},
),
"aws_secret_access_key_env_var": (
"STRING",
{"default": DEFAULT_AWS_SECRET_ACCESS_KEY},
{
"default": DEFAULT_AWS_SECRET_ACCESS_KEY,
"tooltip": "Enter the name of the environment variable for your AWS_SECRET_ACCESS_KEY, not your actual key.",
},
),
"aws_default_region_env_var": (
"STRING",
{"default": DEFAULT_AWS_DEFAULT_REGION},
{
"default": DEFAULT_AWS_DEFAULT_REGION,
"tooltip": "Enter the name of the environment variable for your AWS_DEFAULT_REGION, not your actual region.",
},
),
}
)
Expand Down
36 changes: 30 additions & 6 deletions nodes/drivers/gtUIAmazonBedrockTitanImageGenerationDriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,45 @@ def INPUT_TYPES(s):
{
"image_generation_model": (
"STRING",
{"default": "amazon.titan-image-generator-v1"},
{
"default": "amazon.titan-image-generator-v1",
"tooltip": "Select the image generation model to use.",
},
),
"size": (
sizes,
{
"default": sizes[0],
"tooltip": "Choose the size of the generated image.",
},
),
"seed": (
"INT",
{
"default": 10342349342,
"tooltip": "Set the seed for random number generation.",
},
),
"size": (sizes, {"default": sizes[0]}),
"seed": ("INT", {"default": 10342349342}),
"aws_access_key_id_env_var": (
"STRING",
{"default": DEFAULT_AWS_ACCESS_KEY_ID},
{
"default": DEFAULT_AWS_ACCESS_KEY_ID,
"tooltip": "Enter the name of the environment variable for your AWS_ACCESS_KEY_ID, not your actual key.",
},
),
"aws_secret_access_key_env_var": (
"STRING",
{"default": DEFAULT_AWS_SECRET_ACCESS_KEY},
{
"default": DEFAULT_AWS_SECRET_ACCESS_KEY,
"tooltip": "Enter the name of the environment variable for your AWS_SECRET_ACCESS_KEY, not your actual key.",
},
),
"aws_default_region_env_var": (
"STRING",
{"default": DEFAULT_AWS_DEFAULT_REGION},
{
"default": DEFAULT_AWS_DEFAULT_REGION,
"tooltip": "Enter the name of the environment variable for your AWS_DEFAULT_REGION, not your actual region.",
},
),
}
)
Expand Down
31 changes: 26 additions & 5 deletions nodes/drivers/gtUIAmazonOpenSearchVectorStoreDriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,40 @@ def INPUT_TYPES(s):

inputs["optional"].update(
{
"host_env": ("STRING", {"default": DEFAULT_HOST_ENV}),
"index_env": ("STRING", {"default": DEFAULT_INDEX_ENV}),
"host_env": (
"STRING",
{
"default": DEFAULT_HOST_ENV,
"tooltip": "Enter the name of the environment variable for your AMAZON_OPENSEARCH_HOST, not your actual host.",
},
),
"index_env": (
"STRING",
{
"default": DEFAULT_INDEX_ENV,
"tooltip": "Enter the name of the environment variable for your AMAZON_OPENSEARCH_INDEX_NAME, not your actual index name.",
},
),
"aws_access_key_id_env_var": (
"STRING",
{"default": DEFAULT_AWS_ACCESS_KEY_ID},
{
"default": DEFAULT_AWS_ACCESS_KEY_ID,
"tooltip": "Enter the name of the environment variable for your AWS_ACCESS_KEY_ID, not your actual key.",
},
),
"aws_secret_access_key_env_var": (
"STRING",
{"default": DEFAULT_AWS_SECRET_ACCESS_KEY},
{
"default": DEFAULT_AWS_SECRET_ACCESS_KEY,
"tooltip": "Enter the name of the environment variable for your AWS_SECRET_ACCESS_KEY, not your actual key.",
},
),
"aws_default_region_env_var": (
"STRING",
{"default": DEFAULT_AWS_DEFAULT_REGION},
{
"default": DEFAULT_AWS_DEFAULT_REGION,
"tooltip": "Enter the name of the environment variable for your AWS_DEFAULT_REGION, not your actual region.",
},
),
}
)
Expand Down
31 changes: 26 additions & 5 deletions nodes/drivers/gtUIAmazonSageMakerJumpstartEmbeddingDriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,40 @@ def INPUT_TYPES(s):
inputs["optional"].update(base_optional_inputs)
inputs["optional"].update(
{
"embedding_model": ("STRING", {"default": default_model}),
"endpoint": ("STRING", {"default": default_endpoint}),
"embedding_model": (
"STRING",
{
"default": default_model,
"tooltip": "Specify the embedding model to use.",
},
),
"endpoint": (
"STRING",
{
"default": default_endpoint,
"tooltip": "Specify the SageMaker endpoint to use.",
},
),
"aws_access_key_id_env_var": (
"STRING",
{"default": DEFAULT_AWS_ACCESS_KEY_ID},
{
"default": DEFAULT_AWS_ACCESS_KEY_ID,
"tooltip": "Enter the name of the environment variable for your AWS_ACCESS_KEY_ID, not your actual key.",
},
),
"aws_secret_access_key_env_var": (
"STRING",
{"default": DEFAULT_AWS_SECRET_ACCESS_KEY},
{
"default": DEFAULT_AWS_SECRET_ACCESS_KEY,
"tooltip": "Enter the name of the environment variable for your AWS_SECRET_ACCESS_KEY, not your actual key.",
},
),
"aws_default_region_env_var": (
"STRING",
{"default": DEFAULT_AWS_DEFAULT_REGION},
{
"default": DEFAULT_AWS_DEFAULT_REGION,
"tooltip": "Enter the name of the environment variable for your AWS_DEFAULT_REGION, not your actual region.",
},
),
}
)
Expand Down
31 changes: 26 additions & 5 deletions nodes/drivers/gtUIAmazonSageMakerJumpstartPromptDriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,40 @@ def INPUT_TYPES(s):
inputs["required"].update()
inputs["optional"].update(
{
"model": ("STRING", {"default": default_model}),
"endpoint": ("STRING", {"default": default_endpoint}),
"model": (
"STRING",
{
"default": default_model,
"tooltip": "Specify the model to use. Default is Meta-Llama-3-8B-Instruct.",
},
),
"endpoint": (
"STRING",
{
"default": default_endpoint,
"tooltip": "Specify the SageMaker endpoint to use.",
},
),
"aws_access_key_id_env_var": (
"STRING",
{"default": DEFAULT_AWS_ACCESS_KEY_ID},
{
"default": DEFAULT_AWS_ACCESS_KEY_ID,
"tooltip": "Enter the name of the environment variable for your AWS_ACCESS_KEY_ID, not your actual key.",
},
),
"aws_secret_access_key_env_var": (
"STRING",
{"default": DEFAULT_AWS_SECRET_ACCESS_KEY},
{
"default": DEFAULT_AWS_SECRET_ACCESS_KEY,
"tooltip": "Enter the name of the environment variable for your AWS_SECRET_ACCESS_KEY, not your actual key.",
},
),
"aws_default_region_env_var": (
"STRING",
{"default": DEFAULT_AWS_DEFAULT_REGION},
{
"default": DEFAULT_AWS_DEFAULT_REGION,
"tooltip": "Enter the name of the environment variable for your AWS_DEFAULT_REGION, not your actual region.",
},
),
}
)
Expand Down
Loading

0 comments on commit 203854d

Please sign in to comment.