base_embedding_driver
VectorOperation = Literal['query', 'upsert']
module-attribute
BaseEmbeddingDriver
Bases: SerializableMixin
, ExponentialBackoffMixin
, ABC
Base Embedding Driver.
Attributes:
Name | Type | Description |
---|---|---|
model |
str
|
The name of the model to use. |
tokenizer |
Optional[BaseTokenizer]
|
An instance of |
Source code in griptape/drivers/embedding/base_embedding_driver.py
chunker = field(init=False)
class-attribute
instance-attribute
model = field(kw_only=True, metadata={'serializable': True})
class-attribute
instance-attribute
tokenizer = field(default=None, kw_only=True)
class-attribute
instance-attribute
__attrs_post_init__()
_embed_long_string(string, *, vector_operation=None)
Embeds a string that is too long to embed in one go.
Adapted from: https://github.com/openai/openai-cookbook/blob/683e5f5a71bc7a1b0e5b7a35e087f53cc55fceea/examples/Embedding_long_inputs.ipynb