diff options
| author | 2024-01-26 17:51:14 +0800 | |
|---|---|---|
| committer | 2024-01-26 17:51:14 +0800 | |
| commit | c89694f25be9ea966c4e7eedf9dfb6de8f72dbef (patch) | |
| tree | f9343fc4a3b16e82bb2101256edc62489e6f819b | |
| parent | 1961d25839ddec0fe8a0ad35558154ad5d978a0b (diff) | |
| download | infini-c89694f25be9ea966c4e7eedf9dfb6de8f72dbef.tar.gz infini-c89694f25be9ea966c4e7eedf9dfb6de8f72dbef.zip | |
:sparkles: feat(generator): add generator method
| -rw-r--r-- | src/infini/core.py | 2 | ||||
| -rw-r--r-- | src/infini/generator.py | 10 |
2 files changed, 10 insertions, 2 deletions
diff --git a/src/infini/core.py b/src/infini/core.py index 2bb3e7da..4eaeb4f8 100644 --- a/src/infini/core.py +++ b/src/infini/core.py @@ -29,7 +29,7 @@ class Core: yield output def generate(self, output: Output) -> str: - return output.name # TODO 生成器实现 + return self.generator.output(output) def intercept(self, output: str) -> str: return ( diff --git a/src/infini/generator.py b/src/infini/generator.py index a4d60e27..81f5a69c 100644 --- a/src/infini/generator.py +++ b/src/infini/generator.py @@ -1,2 +1,10 @@ +from infini.output import Output +from infini.typing import Dict, Callable + + class Generator: - ... + events: Dict[str, str] + global_variables: Dict[str, str | Callable] + + def output(self, output: Output) -> str: + return output.name |
