base_griptape_cloud_tool

Bases: BaseTool , ABC

Attributes

NameTypeDescription
base_urlstrBase URL for the Gen AI Builder Knowledge Base API.
api_keyOptional[str]API key for Gen AI Builder.
headersdictHeaders for the Gen AI Builder Knowledge Base API.
Source Code in griptape/tools/base_griptape_cloud_tool.py
@define
class BaseGriptapeCloudTool(BaseTool, ABC):
    """Base class for Gen AI Builder clients.

    Attributes:
        base_url: Base URL for the Gen AI Builder Knowledge Base API.
        api_key: API key for Gen AI Builder.
        headers: Headers for the Gen AI Builder Knowledge Base API.
    """

    base_url: str = field(
        default=Factory(lambda: os.getenv("GT_CLOUD_BASE_URL", "https://cloud.griptape.ai")),
        kw_only=True,
    )
    api_key: Optional[str] = field(default=Factory(lambda: os.getenv("GT_CLOUD_API_KEY")), kw_only=True)
    headers: dict = field(
        default=Factory(lambda self: {"Authorization": f"Bearer {self.api_key}"}, takes_self=True),
        kw_only=True,
    )
  • api_key = field(default=Factory(lambda: os.getenv('GT_CLOUD_API_KEY')), kw_only=True) class-attribute instance-attribute

  • base_url = field(default=Factory(lambda: os.getenv('GT_CLOUD_BASE_URL', 'https://cloud.griptape.ai')), kw_only=True) class-attribute instance-attribute

  • headers = field(default=Factory(lambda self: {'Authorization': f'Bearer {self.api_key}'}, takes_self=True), kw_only=True) class-attribute instance-attribute


Could this page be better? Report a problem or suggest an addition!