File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed
llama-index-integrations/tools/llama-index-tools-mcp Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -103,11 +103,14 @@ def workflow_as_mcp(
103
103
async def _workflow_tool (run_args : StartEventCLS , context : Context ) -> Any :
104
104
# Handle edge cases where the start event is an Event or a BaseModel
105
105
# If the workflow does not have a custom StartEvent class, then we need to handle the event differently
106
- context . session
106
+
107
107
if isinstance (run_args , Event ) and workflow ._start_event_class != StartEvent :
108
108
handler = workflow .run (start_event = run_args )
109
109
elif isinstance (run_args , BaseModel ):
110
110
handler = workflow .run (** run_args .model_dump ())
111
+ elif isinstance (run_args , dict ):
112
+ start_event = StartEventCLS .model_validate (run_args )
113
+ handler = workflow .run (start_event = start_event )
111
114
else :
112
115
raise ValueError (f"Invalid start event type: { type (run_args )} " )
113
116
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ dev = [
29
29
30
30
[project ]
31
31
name = " llama-index-tools-mcp"
32
- version = " 0.2.4 "
32
+ version = " 0.2.5 "
33
33
description = " llama-index tools mcp integration"
34
34
authors = [{
name =
" Chojan Shang" ,
email =
" [email protected] " }]
35
35
requires-python = " >=3.10,<4.0"
You can’t perform that action at this time.
0 commit comments