Embedding
Modules:
Name | Description |
---|---|
base_embedding |
|
openai_embedding |
|
Classes:
Name | Description |
---|---|
BaseEmbedding |
|
OpenAIEmbedding |
|
Attributes¶
Classes¶
BaseEmbedding
¶
Bases: ABC
Methods:
Name | Description |
---|---|
aembed |
Generate embedding for a single text. |
aembed_batch |
Generate embeddings for a list of texts. |
embed |
Synchronous wrapper for |
embed_batch |
Synchronous wrapper for |
Attributes:
Name | Type | Description |
---|---|---|
dimension |
int
|
Synchronous wrapper for that runs the async implementation. |
Source code in pyagenity/store/embedding/base_embedding.py
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
|
Attributes¶
dimension
abstractmethod
property
¶
dimension
Synchronous wrapper for that runs the async implementation.
Functions¶
aembed
abstractmethod
async
¶
aembed(text)
Generate embedding for a single text.
Source code in pyagenity/store/embedding/base_embedding.py
20 21 22 23 |
|
aembed_batch
abstractmethod
async
¶
aembed_batch(texts)
Generate embeddings for a list of texts.
Source code in pyagenity/store/embedding/base_embedding.py
11 12 13 |
|
embed
¶
embed(text)
Synchronous wrapper for aembed
that runs the async implementation.
Source code in pyagenity/store/embedding/base_embedding.py
16 17 18 |
|
embed_batch
¶
embed_batch(texts)
Synchronous wrapper for aembed_batch
that runs the async implementation.
Source code in pyagenity/store/embedding/base_embedding.py
7 8 9 |
|
OpenAIEmbedding
¶
Bases: BaseEmbedding
Methods:
Name | Description |
---|---|
__init__ |
|
aembed |
|
aembed_batch |
|
embed |
Synchronous wrapper for |
embed_batch |
Synchronous wrapper for |
Attributes:
Name | Type | Description |
---|---|---|
api_key |
|
|
client |
|
|
dimension |
int
|
|
model |
|
Source code in pyagenity/store/embedding/openai_embedding.py
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
|
Attributes¶
Functions¶
__init__
¶
__init__(model='text-embedding-3-small', OPENAI_API_KEY=None)
Source code in pyagenity/store/embedding/openai_embedding.py
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
|
aembed
async
¶
aembed(text)
Source code in pyagenity/store/embedding/openai_embedding.py
54 55 56 57 58 59 60 61 62 |
|
aembed_batch
async
¶
aembed_batch(texts)
Source code in pyagenity/store/embedding/openai_embedding.py
44 45 46 47 48 49 50 51 52 |
|
embed
¶
embed(text)
Synchronous wrapper for aembed
that runs the async implementation.
Source code in pyagenity/store/embedding/base_embedding.py
16 17 18 |
|
embed_batch
¶
embed_batch(texts)
Synchronous wrapper for aembed_batch
that runs the async implementation.
Source code in pyagenity/store/embedding/base_embedding.py
7 8 9 |
|
Modules¶
base_embedding
¶
Classes:
Name | Description |
---|---|
BaseEmbedding |
|
Classes¶
BaseEmbedding
¶
Bases: ABC
Methods:
Name | Description |
---|---|
aembed |
Generate embedding for a single text. |
aembed_batch |
Generate embeddings for a list of texts. |
embed |
Synchronous wrapper for |
embed_batch |
Synchronous wrapper for |
Attributes:
Name | Type | Description |
---|---|---|
dimension |
int
|
Synchronous wrapper for that runs the async implementation. |
Source code in pyagenity/store/embedding/base_embedding.py
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
|
Attributes¶
dimension
abstractmethod
property
¶dimension
Synchronous wrapper for that runs the async implementation.
Functions¶
aembed
abstractmethod
async
¶aembed(text)
Generate embedding for a single text.
Source code in pyagenity/store/embedding/base_embedding.py
20 21 22 23 |
|
aembed_batch
abstractmethod
async
¶aembed_batch(texts)
Generate embeddings for a list of texts.
Source code in pyagenity/store/embedding/base_embedding.py
11 12 13 |
|
embed
¶embed(text)
Synchronous wrapper for aembed
that runs the async implementation.
Source code in pyagenity/store/embedding/base_embedding.py
16 17 18 |
|
embed_batch
¶embed_batch(texts)
Synchronous wrapper for aembed_batch
that runs the async implementation.
Source code in pyagenity/store/embedding/base_embedding.py
7 8 9 |
|
Functions¶
openai_embedding
¶
Classes:
Name | Description |
---|---|
OpenAIEmbedding |
|
Attributes:
Name | Type | Description |
---|---|---|
HAS_OPENAI |
|
Attributes¶
Classes¶
OpenAIEmbedding
¶
Bases: BaseEmbedding
Methods:
Name | Description |
---|---|
__init__ |
|
aembed |
|
aembed_batch |
|
embed |
Synchronous wrapper for |
embed_batch |
Synchronous wrapper for |
Attributes:
Name | Type | Description |
---|---|---|
api_key |
|
|
client |
|
|
dimension |
int
|
|
model |
|
Source code in pyagenity/store/embedding/openai_embedding.py
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
|
Attributes¶
Functions¶
__init__
¶__init__(model='text-embedding-3-small', OPENAI_API_KEY=None)
Source code in pyagenity/store/embedding/openai_embedding.py
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
|
aembed
async
¶aembed(text)
Source code in pyagenity/store/embedding/openai_embedding.py
54 55 56 57 58 59 60 61 62 |
|
aembed_batch
async
¶aembed_batch(texts)
Source code in pyagenity/store/embedding/openai_embedding.py
44 45 46 47 48 49 50 51 52 |
|
embed
¶embed(text)
Synchronous wrapper for aembed
that runs the async implementation.
Source code in pyagenity/store/embedding/base_embedding.py
16 17 18 |
|
embed_batch
¶embed_batch(texts)
Synchronous wrapper for aembed_batch
that runs the async implementation.
Source code in pyagenity/store/embedding/base_embedding.py
7 8 9 |
|