Skip to content

Commit ac008a6

Browse files
authored
fix: import path of T (#787)
* feat: add DocDev for auto-generating workspace documentation * fix: update markdown instructions in tpl.yaml * feat: add enable_doc_dev flag and conditionally call DocDev * refactor: update T import and prompt keys for DocDev * fix: update include path for MarkdownOut template * fix: update file search, README injection, and brief prompt text * docs: update prompt to only introduce models * lint
1 parent 3be0057 commit ac008a6

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

rdagent/components/coder/data_science/share/doc.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from rdagent.core.experiment import Experiment, FBWorkspace
77
from rdagent.oai.llm_utils import APIBackend
88
from rdagent.utils.agent.ret import MarkdownAgentOut
9-
from rdagent.utils.agent.workflow import T
9+
from rdagent.utils.agent.tpl import T
1010

1111

1212
class DocDev(Developer[Experiment]):
@@ -20,12 +20,12 @@ def develop(self, exp: Experiment) -> None:
2020
"""
2121
ws: FBWorkspace = exp.experiment_workspace
2222

23-
file_li = [str(file.relative_to(ws.workspace_path)) for file in ws.workspace_path.iterdir() if file.is_file()]
23+
file_li = [str(file.relative_to(ws.workspace_path)) for file in ws.workspace_path.rglob("*") if file.is_file()]
2424

2525
key_file_list = ["main.py", "scores.csv"]
2626

27-
system_prompt = T(".prompts:dump_model_eval.system").r()
28-
user_prompt = T(".prompts:dump_model_eval.user").r(
27+
system_prompt = T(".prompts:docdev.system").r()
28+
user_prompt = T(".prompts:docdev.user").r(
2929
file_li=file_li,
3030
key_files={f: (ws.workspace_path / f).read_text() for f in key_file_list},
3131
)
@@ -34,4 +34,4 @@ def develop(self, exp: Experiment) -> None:
3434
user_prompt=user_prompt, system_prompt=system_prompt
3535
)
3636
markdown = MarkdownAgentOut.extract_output(resp)
37-
ws.inject_files({"README.md": markdown})
37+
ws.inject_files(**{"README.md": markdown})

rdagent/components/coder/data_science/share/prompts.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,11 @@ docdev:
6767
- Important training parameters
6868
- Model details
6969
- Performance of each model
70-
- Ensemble
7170
72-
{% include "rdagent.utils.agent.tpl:MarkdownOut" %}
71+
Be brief. Mention the file path when you introduce files.
72+
Don't introduce anything other than models.
73+
74+
{% include "utils.agent.tpl:MarkdownOut" %}
7375
7476
user: |-
7577
--------------- The file list in the workspace ---------------

0 commit comments

Comments
 (0)