mirror of
https://github.com/NicolasBohn/NexQuant.git
synced 2026-08-07 03:57:45 +00:00
CI checks that can be automatically repaired (#119)
* fix isort & black & toml-sort & sphinx error * fix ci error * fix ci error * add comments * Update Makefile * change sphinx build command * add auto-lint * add black args * format with black * Auto Linting document * fix ci error --------- Co-authored-by: you-n-g <you-n-g@users.noreply.github.com> Co-authored-by: Young <afe.young@gmail.com>
This commit is contained in:
@@ -25,14 +25,16 @@ class EvoAgent(ABC):
|
||||
evo: EvolvableSubjects,
|
||||
eva: Evaluator | Feedback,
|
||||
filter_final_evo: bool = False,
|
||||
) -> EvolvableSubjects: ...
|
||||
) -> EvolvableSubjects:
|
||||
...
|
||||
|
||||
@abstractmethod
|
||||
def filter_evolvable_subjects_by_feedback(
|
||||
self,
|
||||
evo: EvolvableSubjects,
|
||||
feedback: Feedback | None,
|
||||
) -> EvolvableSubjects: ...
|
||||
) -> EvolvableSubjects:
|
||||
...
|
||||
|
||||
|
||||
class RAGEvoAgent(EvoAgent):
|
||||
@@ -52,7 +54,6 @@ class RAGEvoAgent(EvoAgent):
|
||||
self.with_feedback = with_feedback
|
||||
self.knowledge_self_gen = knowledge_self_gen
|
||||
|
||||
|
||||
def multistep_evolve(
|
||||
self,
|
||||
evo: EvolvableSubjects,
|
||||
@@ -86,7 +87,9 @@ class RAGEvoAgent(EvoAgent):
|
||||
es.feedback = (
|
||||
# TODO: Due to the irregular design of rdagent.core.evaluation.Evaluator,
|
||||
# it fails mypy's test here, so we'll ignore this error for now.
|
||||
eva if isinstance(eva, Feedback) else eva.evaluate(evo, queried_knowledge=queried_knowledge) # type: ignore[arg-type, call-arg]
|
||||
eva
|
||||
if isinstance(eva, Feedback)
|
||||
else eva.evaluate(evo, queried_knowledge=queried_knowledge) # type: ignore[arg-type, call-arg]
|
||||
)
|
||||
logger.log_object(es.feedback, tag="evolving feedback")
|
||||
|
||||
|
||||
@@ -99,12 +99,12 @@ class HypothesisGen(ABC):
|
||||
# def gen(self, scenario_desc: str, ) -> Hypothesis:
|
||||
"""
|
||||
Motivation of the variable `scenario_desc`:
|
||||
- Mocking a data-scientist is observing the scenario.
|
||||
- Mocking a data-scientist is observing the scenario.
|
||||
|
||||
scenario_desc may conclude:
|
||||
- data observation:
|
||||
- Original or derivative
|
||||
- Task information:
|
||||
scenario_desc may include:
|
||||
- data observation:
|
||||
- Original or derivative
|
||||
- Task information:
|
||||
"""
|
||||
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ class SingletonBaseClass:
|
||||
Because we try to support defining Singleton with `class A(SingletonBaseClass)`
|
||||
instead of `A(metaclass=SingletonMeta)` this class becomes necessary.
|
||||
"""
|
||||
|
||||
_instance_dict: ClassVar[dict] = {}
|
||||
|
||||
def __new__(cls, *args: Any, **kwargs: Any) -> Any:
|
||||
@@ -34,7 +35,6 @@ class SingletonBaseClass:
|
||||
return cls._instance_dict[kwargs_hash]
|
||||
|
||||
|
||||
|
||||
def parse_json(response: str) -> Any:
|
||||
try:
|
||||
return json.loads(response)
|
||||
|
||||
Reference in New Issue
Block a user