Bedrock titan prompt model driver
BedrockTitanPromptModelDriver
Bases: BasePromptModelDriver
Source code in griptape/griptape/drivers/prompt_model/bedrock_titan_prompt_model_driver.py
prompt_driver: Optional[AmazonBedrockPromptDriver] = field(default=None, kw_only=True)
class-attribute
instance-attribute
tokenizer: BedrockTitanTokenizer
property
Returns the tokenizer for this driver.
We need to pass the session
field from the Prompt Driver to the
Tokenizer. However, the Prompt Driver is not initialized until after
the Prompt Model Driver is initialized. To resolve this, we make the tokenizer
field a @property that is only initialized when it is first accessed.
This ensures that by the time we need to initialize the Tokenizer, the
Prompt Driver has already been initialized.
See this thread more more information: https://github.com/griptape-ai/griptape/issues/244
Returns:
Name | Type | Description |
---|---|---|
BedrockTitanTokenizer |
BedrockTitanTokenizer
|
The tokenizer for this driver. |