griptape_cloud
__all__ = ['GriptapeCloudRulesetDriver']
module-attribute
GriptapeCloudRulesetDriver
Bases: BaseRulesetDriver
A driver for storing conversation memory in the Griptape Cloud.
Attributes:
Name | Type | Description |
---|---|---|
ruleset_id |
str
|
The ID of the Thread to store the conversation memory in. If not provided, the driver will attempt to
retrieve the ID from the environment variable |
base_url |
str
|
The base URL of the Griptape Cloud API. Defaults to the value of the environment variable
|
api_key |
Optional[str]
|
The API key to use for authenticating with the Griptape Cloud API. If not provided, the driver will
attempt to retrieve the API key from the environment variable |
Raises:
Type | Description |
---|---|
ValueError
|
If |
Source code in griptape/drivers/ruleset/griptape_cloud_ruleset_driver.py
api_key: Optional[str] = field(default=Factory(lambda: os.getenv('GT_CLOUD_API_KEY')))
class-attribute
instance-attribute
base_url: str = field(default=Factory(lambda: os.getenv('GT_CLOUD_BASE_URL', 'https://cloud.griptape.ai')))
class-attribute
instance-attribute
headers: dict = field(default=Factory(lambda self: {'Authorization': f'Bearer {self.api_key}'}, takes_self=True), init=False)
class-attribute
instance-attribute
ruleset_id: str = field(default=None, metadata={'serializable': True})
class-attribute
instance-attribute
load(ruleset_name)
Load the ruleset from Griptape Cloud, using the ruleset name as an alias if ruleset_id is not provided.