kailash 0.1.3__py3-none-any.whl → 0.1.4__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- kailash/__init__.py +1 -1
- kailash/api/__init__.py +11 -1
- kailash/api/gateway.py +394 -0
- kailash/api/mcp_integration.py +478 -0
- kailash/api/workflow_api.py +29 -13
- kailash/nodes/ai/__init__.py +4 -4
- kailash/nodes/ai/agents.py +4 -4
- kailash/nodes/ai/ai_providers.py +18 -22
- kailash/nodes/ai/embedding_generator.py +34 -38
- kailash/nodes/ai/llm_agent.py +351 -356
- kailash/nodes/base.py +60 -64
- kailash/nodes/code/python.py +61 -42
- kailash/nodes/data/__init__.py +10 -10
- kailash/nodes/data/readers.py +27 -29
- kailash/nodes/data/retrieval.py +1 -1
- kailash/nodes/data/sharepoint_graph.py +23 -25
- kailash/nodes/data/sql.py +24 -26
- kailash/nodes/data/writers.py +41 -44
- kailash/nodes/logic/__init__.py +9 -3
- kailash/nodes/logic/async_operations.py +14 -14
- kailash/nodes/logic/operations.py +18 -22
- kailash/nodes/mcp/client.py +29 -33
- kailash/nodes/transform/formatters.py +1 -1
- kailash/tracking/metrics_collector.py +6 -7
- kailash/utils/export.py +2 -2
- kailash/utils/templates.py +16 -16
- {kailash-0.1.3.dist-info → kailash-0.1.4.dist-info}/METADATA +103 -28
- {kailash-0.1.3.dist-info → kailash-0.1.4.dist-info}/RECORD +32 -30
- {kailash-0.1.3.dist-info → kailash-0.1.4.dist-info}/WHEEL +0 -0
- {kailash-0.1.3.dist-info → kailash-0.1.4.dist-info}/entry_points.txt +0 -0
- {kailash-0.1.3.dist-info → kailash-0.1.4.dist-info}/licenses/LICENSE +0 -0
- {kailash-0.1.3.dist-info → kailash-0.1.4.dist-info}/top_level.txt +0 -0
@@ -7,7 +7,7 @@ from kailash.nodes.base import Node, NodeParameter, register_node
|
|
7
7
|
|
8
8
|
|
9
9
|
@register_node()
|
10
|
-
class
|
10
|
+
class EmbeddingGeneratorNode(Node):
|
11
11
|
"""
|
12
12
|
Vector embedding generator for RAG systems and semantic similarity operations.
|
13
13
|
|
@@ -61,46 +61,42 @@ class EmbeddingGenerator(Node):
|
|
61
61
|
- Updates usage statistics and cost tracking
|
62
62
|
|
63
63
|
Examples:
|
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
|
-
embedding_1=[0.1, 0.2, 0.3, ...],
|
97
|
-
embedding_2=[0.15, 0.25, 0.35, ...],
|
98
|
-
similarity_metric="cosine"
|
99
|
-
)
|
64
|
+
>>> # Single text embedding
|
65
|
+
>>> embedder = EmbeddingGeneratorNode()
|
66
|
+
>>> result = embedder.run(
|
67
|
+
... provider="openai",
|
68
|
+
... model="text-embedding-3-large",
|
69
|
+
... input_text="This is a sample document to embed",
|
70
|
+
... operation="embed_text"
|
71
|
+
... )
|
72
|
+
|
73
|
+
>>> # Batch document embedding
|
74
|
+
>>> batch_embedder = EmbeddingGeneratorNode()
|
75
|
+
>>> result = batch_embedder.run(
|
76
|
+
... provider="huggingface",
|
77
|
+
... model="sentence-transformers/all-MiniLM-L6-v2",
|
78
|
+
... input_texts=[
|
79
|
+
... "First document content...",
|
80
|
+
... "Second document content...",
|
81
|
+
... "Third document content..."
|
82
|
+
... ],
|
83
|
+
... operation="embed_batch",
|
84
|
+
... batch_size=32,
|
85
|
+
... cache_enabled=True
|
86
|
+
... )
|
87
|
+
|
88
|
+
>>> # Similarity calculation
|
89
|
+
>>> similarity = EmbeddingGeneratorNode()
|
90
|
+
>>> result = similarity.run(
|
91
|
+
... operation="calculate_similarity",
|
92
|
+
... embedding_1=[0.1, 0.2, 0.3], # ... removed for doctest
|
93
|
+
... embedding_2=[0.15, 0.25, 0.35], # ... removed for doctest
|
94
|
+
... similarity_metric="cosine"
|
95
|
+
... )
|
100
96
|
|
101
97
|
Cached embedding with MCP integration:
|
102
98
|
|
103
|
-
mcp_embedder =
|
99
|
+
mcp_embedder = EmbeddingGeneratorNode()
|
104
100
|
result = mcp_embedder.run(
|
105
101
|
provider="azure",
|
106
102
|
model="text-embedding-3-small",
|