-
LlamaIndex extensively uses typing hints for constructing workflows. In comparison to LangGraph, where you have to manually construct graph nodes and edges. LlamaIndex can do this automatically with type hints. However, IMHO, this feels a bit inconsistent |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
To restrict the type of a from llama_index.core.workflow import StartEvent
from pydantic import BaseModel
from pathlib import Path
class MyCustomStartEvent(StartEvent):
a_string_field: str
a_path_to_somewhere: Path
an_index: BaseModel # Replace with the actual type you need
an_llm: BaseModel # Replace with the actual type you need By defining a custom To continue talking to Dosu, mention @dosu. Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other |
Beta Was this translation helpful? Give feedback.
-
I'm sorry. It's written in the docs: https://docs.llamaindex.ai/en/stable/module_guides/workflow/. I'm just confused a bit in the documentation, as there are several types of docs for different purposes |
Beta Was this translation helpful? Give feedback.
I'm sorry.
It's written in the docs: https://docs.llamaindex.ai/en/stable/module_guides/workflow/.
I'm just confused a bit in the documentation, as there are several types of docs for different purposes