from smartgraph import ReactiveSmartGraph
from smartgraph.components import TextInputHandler, CompletionComponent
# Create the graph
graph = ReactiveSmartGraph()
# Create a pipeline
pipeline = graph.create_pipeline("SimpleLLM")
# Add components to the pipeline
pipeline.add_component(TextInputHandler("TextInput"))
pipeline.add_component(CompletionComponent("LLM", model="gpt-4o-mini"))
# Compile the graph
graph.compile()
# Execute the pipeline
result = await graph.execute("SimpleLLM", "Tell me a joke")
print(result)