added pascal case for tool names
This commit is contained in:
@@ -5,6 +5,7 @@ from griptape.tools import (
|
||||
GriptapeCloudKnowledgeBaseClient,
|
||||
)
|
||||
|
||||
from ..utilities import to_pascal_case
|
||||
from .gtUIBaseTool import gtUIBaseTool
|
||||
|
||||
|
||||
@@ -62,8 +63,8 @@ class gtUIKnowledgeBaseTool(gtUIBaseTool):
|
||||
name = data.get("name", "Griptape Knowledge Base")
|
||||
description = data.get("description", "Contains helpful information")
|
||||
|
||||
print(name)
|
||||
print(description)
|
||||
name = to_pascal_case(name)
|
||||
|
||||
tool = GriptapeCloudKnowledgeBaseClient(
|
||||
name=name,
|
||||
description=description,
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import base64
|
||||
import re
|
||||
from io import BytesIO
|
||||
from urllib.parse import urlparse, urlunparse
|
||||
|
||||
@@ -10,6 +11,17 @@ from jinja2 import Template
|
||||
from PIL import Image, ImageOps, ImageSequence
|
||||
|
||||
|
||||
def to_pascal_case(string):
|
||||
# First, replace any non-word character with a space
|
||||
string = re.sub(r"[^\w\s]", " ", string)
|
||||
|
||||
# Split the string into words
|
||||
words = string.split()
|
||||
|
||||
# Capitalize the first letter of each word after the first word
|
||||
return "".join(word.capitalize() for word in words)
|
||||
|
||||
|
||||
def construct_base_url(base_url: str, port: int) -> str:
|
||||
# Parse the base_url
|
||||
parsed_url = urlparse(base_url)
|
||||
|
||||
Reference in New Issue
Block a user