mirror of
https://github.com/NicolasBohn/NexQuant.git
synced 2026-08-04 02:37:44 +00:00
feat: add user interaction in data science scenario (#1251)
* feat: add interactor classes and user interaction handling for experiments * update code * use fragment retry mechanism instead of rerun() * fix a bug * integrate user instructions into proposal and coder * fix CI * fix CI * feat: add approval option for user instructions submission * feat: enhance user instructions handling in Task and DSExperiment classes * fix CI * add user instructions into hypothesis rewrite * add interface to command line --------- Co-authored-by: Bowen Xian <xianbowen@outlook.com>
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from abc import ABC, abstractmethod
|
||||
from trace import Trace
|
||||
from typing import TYPE_CHECKING, Generic
|
||||
|
||||
from rdagent.core.experiment import ASpecificExp
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from rdagent.core.scenario import Scenario
|
||||
|
||||
|
||||
class Interactor(ABC, Generic[ASpecificExp]):
|
||||
def __init__(self, scen: Scenario) -> None:
|
||||
self.scen: Scenario = scen
|
||||
|
||||
@abstractmethod
|
||||
def interact(self, exp: ASpecificExp, trace: Trace | None = None) -> ASpecificExp:
|
||||
"""
|
||||
Interact with the experiment to get feedback or confirmation.
|
||||
|
||||
Responsibilities:
|
||||
- Present the current state of the experiment.
|
||||
- Collect input to guide the next steps in the experiment.
|
||||
- Rewrite the experiment based on feedback.
|
||||
"""
|
||||
Reference in New Issue
Block a user