feat: add python source loader

This commit is contained in:
lda
2026-06-11 18:46:14 +07:00 Verified
parent e1ac095df2
commit c114cde2da
5 changed files with 163 additions and 1 deletions
+26
View File
@@ -0,0 +1,26 @@
from __future__ import annotations
from pydantic import BaseModel
from wf_authoring import node
class EchoInput(BaseModel):
text: str
class EchoOutput(BaseModel):
echoed: str
@node(name="echo")
def echo(payload: EchoInput) -> EchoOutput:
return EchoOutput(echoed=payload.text)
@node(name="authoring.upper")
def upper(payload: EchoInput) -> EchoOutput:
return EchoOutput(echoed=payload.text.upper())
registry = [echo, upper]