gllm-pipeline-binary 0.4.23__cp312-cp312-win_amd64.whl → 0.4.24__cp312-cp312-win_amd64.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.
@@ -1,4 +1,5 @@
1
1
  from _typeshed import Incomplete
2
+ from gllm_core.schema.tool import Tool
2
3
  from gllm_datastore.cache.cache import BaseCache as BaseCache
3
4
  from gllm_pipeline.alias import PipelineState as PipelineState
4
5
  from gllm_pipeline.exclusions import ExclusionManager as ExclusionManager, ExclusionSet as ExclusionSet
@@ -8,11 +9,13 @@ from gllm_pipeline.steps.pipeline_step import BasePipelineStep as BasePipelineSt
8
9
  from gllm_pipeline.steps.terminator_step import TerminatorStep as TerminatorStep
9
10
  from gllm_pipeline.utils.graph import create_edge as create_edge
10
11
  from gllm_pipeline.utils.mermaid import MERMAID_HEADER as MERMAID_HEADER, combine_mermaid_diagrams as combine_mermaid_diagrams, extract_step_diagrams as extract_step_diagrams
12
+ from gllm_pipeline.utils.typing_compat import TypedDict as TypedDict, is_typeddict as is_typeddict
11
13
  from langgraph.graph import StateGraph
12
14
  from langgraph.graph.state import CompiledStateGraph as CompiledStateGraph
13
15
  from pydantic import BaseModel
14
- from typing import Any, TypedDict
16
+ from typing import Any
15
17
 
18
+ DEFAULT_TOOL_NAME: str
16
19
  INDENTATION: str
17
20
 
18
21
  class Pipeline:
@@ -192,6 +195,43 @@ class Pipeline:
192
195
  Returns:
193
196
  Composer: A composer instance that manages this pipeline.
194
197
  """
198
+ def as_tool(self, description: str | None = None) -> Tool:
199
+ '''Convert the pipeline to a Tool instance.
200
+
201
+ This method allows a Pipeline instance to be used as a tool, with the input schema
202
+ being derived from the pipeline\'s input schema. The pipeline must have an input_type
203
+ defined to be convertible as a tool.
204
+
205
+ Args:
206
+ description (str | None, optional): Optional description to associate with the tool.
207
+ Defaults to None, in which case a description will be generated automatically.
208
+
209
+ Returns:
210
+ Tool: A Tool instance that wraps the pipeline.
211
+
212
+ Raises:
213
+ ValueError: If the pipeline does not have an input schema defined.
214
+
215
+ Examples:
216
+ ```python
217
+ class InputState(TypedDict):
218
+ user_query: str
219
+ context: str
220
+
221
+ class OutputState(TypedDict):
222
+ result: str
223
+
224
+ pipeline = Pipeline(
225
+ [retrieval_step, generation_step],
226
+ input_type=InputState,
227
+ output_type=OutputState,
228
+ name="rag_pipeline"
229
+ )
230
+
231
+ tool = pipeline.as_tool(description="Process user questions")
232
+ result = await tool.invoke(user_query="What is AI?", context="")
233
+ ```
234
+ '''
195
235
  def clear(self) -> None:
196
236
  """Clears the pipeline by resetting steps, graph, and app to their initial state.
197
237
 
@@ -1,7 +1,8 @@
1
1
  from _typeshed import Incomplete
2
2
  from gllm_core.event.event_emitter import EventEmitter
3
+ from gllm_pipeline.utils.typing_compat import TypedDict as TypedDict
3
4
  from pydantic import BaseModel
4
- from typing import Any, TypedDict
5
+ from typing import Any
5
6
 
6
7
  class RAGState(TypedDict):
7
8
  '''A TypedDict representing the state of a Retrieval-Augmented Generation (RAG) pipeline.
@@ -665,7 +665,7 @@ def subgraph(subgraph: Pipeline, input_state_map: dict[str, str] | None = None,
665
665
 
666
666
  Examples:
667
667
  ```python
668
- from typing import TypedDict
668
+ from gllm_pipeline.utils.typing_compat import TypedDict
669
669
  from gllm_pipeline.pipeline.pipeline import Pipeline
670
670
 
671
671
  # Define state schemas using TypedDict
@@ -0,0 +1,3 @@
1
+ from typing import TypedDict as TypedDict, is_typeddict as is_typeddict
2
+
3
+ __all__ = ['TypedDict', 'is_typeddict']
Binary file
gllm_pipeline.pyi CHANGED
@@ -22,6 +22,7 @@ import gllm_datastore.cache.cache
22
22
  import asyncio
23
23
  import uuid
24
24
  import copy
25
+ import gllm_core.schema.tool
25
26
  import gllm_core.utils.imports
26
27
  import gllm_core.utils.logger_manager
27
28
  import gllm_inference
@@ -84,4 +85,5 @@ import langgraph.types
84
85
  import dataclasses
85
86
  import gllm_core.event.messenger
86
87
  import gllm_pipeline.steps.step_error_handler.RaiseStepErrorHandler
87
- import traceback
88
+ import traceback
89
+ import sys
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: gllm-pipeline-binary
3
- Version: 0.4.23
3
+ Version: 0.4.24
4
4
  Summary: A library containing components related to Gen AI applications pipeline orchestration.
5
5
  Author-email: Dimitrij Ray <dimitrij.ray@gdplabs.id>, Henry Wicaksono <henry.wicaksono@gdplabs.id>, Kadek Denaya <kadek.d.r.diana@gdplabs.id>
6
6
  Requires-Python: <3.13,>=3.11
@@ -11,6 +11,7 @@ Requires-Dist: gllm-core-binary<0.4.0,>=0.3.0
11
11
  Requires-Dist: gllm-inference-binary<0.6.0,>=0.5.0
12
12
  Requires-Dist: aiohttp<3.13.0,>=3.12.14
13
13
  Requires-Dist: langgraph<0.7.0,>=0.6.0
14
+ Requires-Dist: typing-extensions<5.0.0,>=4.5.0
14
15
  Provides-Extra: dev
15
16
  Requires-Dist: coverage<7.5.0,>=7.4.4; extra == "dev"
16
17
  Requires-Dist: mypy<1.16.0,>=1.15.0; extra == "dev"
@@ -1,5 +1,5 @@
1
- gllm_pipeline.cp312-win_amd64.pyd,sha256=tzPFp3ZMu0Ek6EYDOwCAfzeEO6N-jxpuOPCntj91GHE,2177024
2
- gllm_pipeline.pyi,sha256=SCe8vHfVDlgMZ1I_dfYPa-qFjsj_IWl0lgTa7lRrQqQ,2306
1
+ gllm_pipeline.cp312-win_amd64.pyd,sha256=qjhsaFUWKRHDq6mgIqfYy52U1uMsunzKOu0tQLcGRhk,2189312
2
+ gllm_pipeline.pyi,sha256=KL3UbRkjsWRktt_UM70HNxLAvyYzPTQ0pvNfwTZt8SI,2346
3
3
  gllm_pipeline/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
4
  gllm_pipeline/alias.pyi,sha256=FbALRYZpDlmQMsKNUvgCi6ji11PrEtNo2kgzbt0iT7g,237
5
5
  gllm_pipeline/types.pyi,sha256=CV3cEAxlNsnVatYz5iCxqmEFPEqeKW5vv-qUD3FpF54,241
@@ -7,8 +7,8 @@ gllm_pipeline/exclusions/__init__.pyi,sha256=_LwIlqmH4Iiksn7p09d2vZG4Ek8CdKC8UcD
7
7
  gllm_pipeline/exclusions/exclusion_manager.pyi,sha256=DzoL-2KeTRmFgJEo8rzYViFYKbzZVTZGJmKvzaoTC0M,2960
8
8
  gllm_pipeline/exclusions/exclusion_set.pyi,sha256=11XTt6IfkHpzomcNybA78SfWlp752Z3AGhXfm2rL0Fk,1685
9
9
  gllm_pipeline/pipeline/__init__.pyi,sha256=1IKGdMvmLWEiOOmAKFNUPm-gdw13zrnU1gs7tDNzgEU,168
10
- gllm_pipeline/pipeline/pipeline.pyi,sha256=m8OStEgk9SsV6faKX6wEqGyygE_xF421wJWQJvBAEeY,14979
11
- gllm_pipeline/pipeline/states.pyi,sha256=EiyfBPwrVDZ336w5wyD1q8W4E6G1uZNzsP-bzrHDumo,6464
10
+ gllm_pipeline/pipeline/pipeline.pyi,sha256=CgP179RgbwtIsz_U0cMi3jdwbVOBz-D4sIKjoLkV55g,16504
11
+ gllm_pipeline/pipeline/states.pyi,sha256=WezH44ULqlim8CoEupQGHXs5xNzkqLvK8epwYQYRT4I,6523
12
12
  gllm_pipeline/pipeline/composer/__init__.pyi,sha256=-hcOUQgpTRt1QjQfRurTf-UApFnTrhilx6vN-gYd5J0,666
13
13
  gllm_pipeline/pipeline/composer/composer.pyi,sha256=7h7EhEA-hex6w36Is6uGTz9OBUbmq6C0SdkeBeLFcAI,28715
14
14
  gllm_pipeline/pipeline/composer/guard_composer.pyi,sha256=YfbXmzyU3CwAvGnCfM-6MVcTdxk53-j6Cv3IdzNr_-c,3335
@@ -40,7 +40,7 @@ gllm_pipeline/router/preset/aurelio/router_image_domain_specific.pyi,sha256=6pm2
40
40
  gllm_pipeline/router/preset/lm_based/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
41
41
  gllm_pipeline/router/preset/lm_based/router_image_domain_specific.pyi,sha256=UdiuoSXm2MVAL8AspAaSkyXYkE59bYj1y4xRRgKwavE,655
42
42
  gllm_pipeline/steps/__init__.pyi,sha256=5HtVA5CODr_9_7_OGEXFXU40edqhHa9YlCV5qVx3xbU,1989
43
- gllm_pipeline/steps/_func.pyi,sha256=FS-g9LiyHb8OHLM8bXrAMiqvk4-KgaxV8RacD0IQw-Q,64125
43
+ gllm_pipeline/steps/_func.pyi,sha256=TDTSsBwiUMwlFXLcLVolcd_7g7bAcg4mDx_r_y2mDb4,64152
44
44
  gllm_pipeline/steps/branching_step.pyi,sha256=iNarrcZgWfiRdr8CJfGm8GzUlYq13Rx5cgYXnBsNWN4,1041
45
45
  gllm_pipeline/steps/component_step.pyi,sha256=VNBFZscK2Q4HgBt8ZrbE6B69oLTKcXo-KkqbTjmYYhM,5748
46
46
  gllm_pipeline/steps/composite_step.pyi,sha256=lvueTBQG_t0TtS5qRvUzZOIt3h6-uD26DJXW4ZSkuUc,3544
@@ -70,8 +70,9 @@ gllm_pipeline/utils/input_map.pyi,sha256=mPWU9_b3VGhszuTjB3yQggZWJCxjZth4_WQdKec
70
70
  gllm_pipeline/utils/mermaid.pyi,sha256=B096GTXxVAO--kw3UDsbysOsnjGOytYfozX39YaM21A,1174
71
71
  gllm_pipeline/utils/retry_converter.pyi,sha256=JPUuaGzKpVLshrbhX9rQHYl5XmC9GDa59rGU-FtOpWM,1128
72
72
  gllm_pipeline/utils/step_execution.pyi,sha256=3o28tiCHR8t-6Vk3Poz91V-CLdYrdhvJblPW9AoOK-c,996
73
+ gllm_pipeline/utils/typing_compat.pyi,sha256=V4812i25ncSqZ0o_30lUX65tU07bWEs4LIpdLPt2ngg,116
73
74
  gllm_pipeline.build/.gitignore,sha256=aEiIwOuxfzdCmLZe4oB1JsBmCUxwG8x-u-HBCV9JT8E,1
74
- gllm_pipeline_binary-0.4.23.dist-info/METADATA,sha256=rro3zbAKhq4bHW2wFZZjHyFTFaAH_ZxbCCWFpJ9OKvY,4476
75
- gllm_pipeline_binary-0.4.23.dist-info/WHEEL,sha256=x5rgv--I0NI0IT1Lh9tN1VG2cI637p3deednwYLKnxc,96
76
- gllm_pipeline_binary-0.4.23.dist-info/top_level.txt,sha256=C3yeOtoE6ZhuOnBEq_FFc_Rp954IHJBlB6fBgSdAWYI,14
77
- gllm_pipeline_binary-0.4.23.dist-info/RECORD,,
75
+ gllm_pipeline_binary-0.4.24.dist-info/METADATA,sha256=8mzbtoKhwpZLS3hpZ2rK6Rwu-eNZRs_fV_gD7rdh9eo,4524
76
+ gllm_pipeline_binary-0.4.24.dist-info/WHEEL,sha256=x5rgv--I0NI0IT1Lh9tN1VG2cI637p3deednwYLKnxc,96
77
+ gllm_pipeline_binary-0.4.24.dist-info/top_level.txt,sha256=C3yeOtoE6ZhuOnBEq_FFc_Rp954IHJBlB6fBgSdAWYI,14
78
+ gllm_pipeline_binary-0.4.24.dist-info/RECORD,,