Watsonx
WatsonXDocumentEmbedder
Bases: DocumentEmbedder
Provides functionality to compute embeddings for documents using WatsonX models.
This class extends ConnectionNode to create embeddings for documents using litellm embedding.
Attributes:
Name | Type | Description |
---|---|---|
group |
Literal[EMBEDDERS]
|
The group the node belongs to. |
name |
str
|
The name of the node. |
connection |
WatsonX | None
|
The connection to the WatsonX API. |
model |
str
|
The model name to use for embedding. |
document_embedder |
WatsonXDocumentEmbedderComponent
|
The component for document embedding. |
Parameters:
Name | Type | Description | Default |
---|---|---|---|
connection |
Optional[WatsonX]
|
The connection to the WatsonX API. A new connection is created if none is provided. |
required |
model |
str
|
The model name to use for embedding. Defaults to 'watsonx/ibm/slate-30m-english-rtrvr'. |
required |
Source code in dynamiq/nodes/embedders/watsonx.py
7 8 9 10 11 12 13 14 15 16 17 18 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 |
|
__init__(**kwargs)
Initializes the WatsonXDocumentEmbedder.
If neither client nor connection is provided in kwargs, a new WatsonXConnection is created.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
**kwargs |
Arbitrary keyword arguments. |
{}
|
Source code in dynamiq/nodes/embedders/watsonx.py
31 32 33 34 35 36 37 38 39 40 41 42 |
|
init_components(connection_manager=None)
Initializes the components of the WatsonXDocumentEmbedder.
This method sets up the document_embedder component if it hasn't been initialized yet.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
connection_manager |
ConnectionManager
|
The connection manager to use. Defaults to a new ConnectionManager instance. |
None
|
Source code in dynamiq/nodes/embedders/watsonx.py
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
|
WatsonXTextEmbedder
Bases: TextEmbedder
A component designed to embed strings using specified WatsonX models.
This class extends ConnectionNode to provide text embedding functionality using WatsonX API.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
connection |
Optional[WatsonX]
|
An existing connection to WatsonX API. If not provided, a new connection will be established using environment variables. |
required |
model |
str
|
The identifier of the WatsonX model for text embeddings. Defaults to 'watsonx/ibm/slate-30m-english-rtrvr'. |
required |
Attributes:
Name | Type | Description |
---|---|---|
group |
Literal[EMBEDDERS]
|
The group the node belongs to. |
name |
str
|
The name of the node. |
connection |
WatsonX | None
|
The connection to WatsonX's API. |
model |
str
|
The WatsonX model identifier for text embeddings. |
text_embedder |
WatsonXTextEmbedderComponent
|
The component for text embedding. |
Source code in dynamiq/nodes/embedders/watsonx.py
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 |
|
__init__(**kwargs)
Initialize the WatsonXTextEmbedder.
If neither client nor connection is provided in kwargs, a new WatsonXConnection is created.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
**kwargs |
Keyword arguments to initialize the node. |
{}
|
Source code in dynamiq/nodes/embedders/watsonx.py
88 89 90 91 92 93 94 95 96 97 98 |
|
init_components(connection_manager=None)
Initialize the components of the WatsonXTextEmbedder.
This method sets up the text_embedder component if it hasn't been initialized yet.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
connection_manager |
ConnectionManager
|
The connection manager to use. Defaults to a new ConnectionManager instance. |
None
|
Source code in dynamiq/nodes/embedders/watsonx.py
104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 |
|