Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
251e265
feat: Introduce new input field types to HumanInput node
QuantumGhost Apr 19, 2026
8246f2a
test: add serialization tests for FormInput Type
QuantumGhost Apr 19, 2026
4b5e7f8
refactor!: Rename `FormInput` and `FormInputDefault`
QuantumGhost Apr 19, 2026
b6897a8
refactor!: Rename `PlaceholderType` to `ValueSourceType`
QuantumGhost Apr 19, 2026
54a5c45
chore!: Drop `TEXT_INPUT` form input type
QuantumGhost Apr 19, 2026
95fd712
refactor: remove unused get_all_by_node method
QuantumGhost Apr 20, 2026
03ed965
chore: check protocol compatibility statically for ReadOnlyVariablePool
QuantumGhost Apr 20, 2026
d000e45
test: add tests for HumanInputNode.resolve_default_values
QuantumGhost Apr 20, 2026
cfb255a
test: add tests for HumanInputNodeData variable mapping extraction
QuantumGhost Apr 20, 2026
7372a71
feat: introduce new input field types for HumanInputNode
QuantumGhost Apr 20, 2026
54cbe8b
chore: ignore PLC1901 in tests
QuantumGhost Apr 20, 2026
ba9186b
chore: ignore coverage related files
QuantumGhost Apr 20, 2026
f445e74
chore: add editorconfig configuration
QuantumGhost Apr 20, 2026
6dd2793
docs: clarify fields in `VariablePool`
QuantumGhost Apr 21, 2026
f88e7f6
refactor: promote `output_variable_name` to base class
QuantumGhost Apr 21, 2026
547db9d
feat: introduce `submitted_data` to HumanInputFormFilledEvent
QuantumGhost Apr 21, 2026
dd75bf5
docs: adjust documentation for VariablePool
QuantumGhost Apr 21, 2026
9967c0f
refactor: rename FormInput to FormInputConfig
QuantumGhost Apr 21, 2026
548b6fa
WIP
QuantumGhost Apr 23, 2026
f70c911
chore(human-input): use string constant for FormInputType enum values
QuantumGhost Apr 27, 2026
027abb8
chore(human-input): rename form_data to submitted_data in methods and…
QuantumGhost Apr 27, 2026
d2f7cf5
chore(human-input): mark methods in protocol as abstract
QuantumGhost Apr 27, 2026
d1da838
fixup! chore(human-input): rename form_data to submitted_data in meth…
QuantumGhost Apr 27, 2026
80c820d
fixup! chore(human-input): rename form_data to submitted_data in meth…
QuantumGhost Apr 27, 2026
e122712
fixup! chore(human-input): rename form_data to submitted_data in meth…
QuantumGhost Apr 27, 2026
91941bf
refactor(human-input): unify special output creation
QuantumGhost Apr 27, 2026
b99ebd0
Merge remote-tracking branch 'upstream' into QuantumGhost/hitl-form-dsl
QuantumGhost May 12, 2026
70b417c
docs: add a short docstring to FileReferenceFactoryProtocol.
QuantumGhost May 12, 2026
e10abc1
test(human-input): move tests for human input definition to test_enti…
QuantumGhost May 12, 2026
3d82420
chore: suppress SLF001 for tests
QuantumGhost May 12, 2026
5539d04
feat(human-input): remove restore_submitted_data from HumanInputNodeR…
QuantumGhost May 12, 2026
b8f72b5
chore(test): remove SLF001 ignore in code
QuantumGhost May 12, 2026
a6d4c1a
refactor(human-input): ensure all form data are converted to runtime …
QuantumGhost May 12, 2026
2287be4
refactor(human-input): move _InvalidSubmittedDataError to _exc
QuantumGhost May 12, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
root = true

[*]
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
charset = utf-8

[*.py]
indent_style = space
indent_size = 4

[*.toml]
indent_style = space
indent_size = 4

[*.md]
trim_trailing_whitespace = false
14 changes: 14 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,17 @@ dist/

# Plugin Daemon Slim
.slim
# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/
5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@ ignore-one-line-docstrings = true
'S101', # Assert statements used for pytest.
'PLR2004', # Magic value used in test cases.
'PLC2701', # Allow import private members from graphon module.
'PLC1901', # be more precise about assertion in tests.

# permit calls of private methods until we separate
# public interface tests from implementation tests.
'SLF001', # allow calls of private class methods in tests
]

[tool.ty.environment]
Expand Down
6 changes: 3 additions & 3 deletions src/graphon/entities/pause_reason.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from pydantic import BaseModel, Field

from graphon.nodes.human_input.entities import FormInput, UserAction
from graphon.nodes.human_input.entities import FormInputConfig, UserActionConfig


class PauseReasonType(StrEnum):
Expand All @@ -18,8 +18,8 @@ class HumanInputRequired(BaseModel):
)
form_id: str
form_content: str
inputs: list[FormInput] = Field(default_factory=list)
actions: list[UserAction] = Field(default_factory=list)
inputs: list[FormInputConfig] = Field(default_factory=list[FormInputConfig])
actions: list[UserActionConfig] = Field(default_factory=list[UserActionConfig])
node_id: str
node_title: str

Expand Down
5 changes: 5 additions & 0 deletions src/graphon/graph_events/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from pydantic import Field

from graphon.entities.pause_reason import PauseReason
from graphon.variables.segments import Segment
from graphon.variables.variables import Variable

from .base import GraphNodeEventBase
Expand Down Expand Up @@ -91,6 +92,10 @@ class NodeRunHumanInputFormFilledEvent(GraphNodeEventBase):
...,
description="Display text of the chosen action button.",
)
submitted_data: Mapping[str, Segment] = Field(
default_factory=dict,
description="Runtime submitted values keyed by form output variable name.",
)


class NodeRunHumanInputFormTimeoutEvent(GraphNodeEventBase):
Expand Down
6 changes: 6 additions & 0 deletions src/graphon/node_events/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from graphon.file.models import File
from graphon.model_runtime.entities.llm_entities import LLMUsage
from graphon.node_events.base import NodeRunResult
from graphon.variables.segments import Segment
from graphon.variables.variables import Variable

from .base import NodeEventBase
Expand Down Expand Up @@ -73,6 +74,11 @@ class HumanInputFormFilledEvent(NodeEventBase):
action_id: str
action_text: str

# submitted_data records the data user submitted in the form inputs.
# It is a mapping from FormInput.output_variable_name to
# their runtime values.
submitted_data: Mapping[str, Segment] = Field(default_factory=dict)


class HumanInputFormTimeoutEvent(NodeEventBase):
"""Event emitted when a human input form times out."""
Expand Down
1 change: 1 addition & 0 deletions src/graphon/nodes/base/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -884,6 +884,7 @@ def _(self, event: HumanInputFormFilledEvent) -> NodeRunHumanInputFormFilledEven
rendered_content=event.rendered_content,
action_id=event.action_id,
action_text=event.action_text,
submitted_data=event.submitted_data,
)

@_dispatch.register
Expand Down
22 changes: 22 additions & 0 deletions src/graphon/nodes/human_input/_exc.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
from graphon.file.enums import FileTransferMethod


class InvalidConfigError(Exception):
pass


class InvalidSubmittedDataError(Exception):
pass


class InvalidTransferMethodError(InvalidConfigError):
transfer_method: FileTransferMethod

def __init__(self, transfer_method: FileTransferMethod) -> None:
self.transfer_method = transfer_method
super().__init__(f"invalid file transfer method: {transfer_method}")


class ExtensionsNotSetErrorValueError(InvalidConfigError):
def __init__(self) -> None:
super().__init__("allowed_file_extensions not set")
Loading
Loading