Skip to content

Commit 8fe9511

Browse files
authored
fix: debug dsagent (#387)
* basic dsagent & debug debug dsagent change dsagent conf * Refine changes * Update vector_base.py
1 parent f2a6e75 commit 8fe9511

File tree

4 files changed

+7
-8
lines changed

4 files changed

+7
-8
lines changed

rdagent/app/kaggle/conf.py

+2
Original file line numberDiff line numberDiff line change
@@ -66,5 +66,7 @@ class Config:
6666

6767
auto_submit: bool = True
6868

69+
dsagent: bool = False
70+
6971

7072
KAGGLE_IMPLEMENT_SETTING = KaggleBasePropSetting()

rdagent/components/proposal/model_proposal.py

-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ def gen(self, trace: Trace) -> ModelHypothesis:
5050
.from_string(ModelHypothesisGen.prompts["hypothesis_gen"]["user_prompt"])
5151
.render(
5252
targets="feature engineering and model building",
53-
hypothesis_and_feedback=context_dict["hypothesis_and_feedback"],
5453
RAG=context_dict["RAG"],
5554
)
5655
)

rdagent/components/proposal/prompts.yaml

+1-6
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,9 @@ hypothesis_gen:
1212
{{ hypothesis_output_format }}
1313
1414
user_prompt: |-
15-
{% if hypothesis_and_feedback|length == 0 %}It is the first round of hypothesis generation. The user has no hypothesis on this scenario yet.
16-
{% else %}It is not the first round, the user has made several hypothesis on this scenario and did several evaluation on them.
17-
The former hypothesis and the corresponding feedbacks are as follows (focus on the last one & the new hypothesis that it provides and reasoning to see if you agree):
18-
{{ hypothesis_and_feedback }}
19-
{% endif %}
2015
{% if RAG %}To help you generate new {{targets}}, we have prepared the following information for you:
2116
{{ RAG }}{% endif %}
22-
Please generate the new hypothesis based on the information above. Also generate the relevant keys for the reasoning and the distilled knowledge that follows. For those keys, in particular for knowledge, explain in the context of the specific scenario to build up domain knowledge in the specific field rather than general knowledge.
17+
Also generate the relevant keys for the reasoning and the distilled knowledge that follows. For those keys, in particular for knowledge, explain in the context of the specific scenario to build up domain knowledge in the specific field rather than general knowledge.
2318
2419
hypothesis2experiment:
2520
system_prompt: |-

rdagent/scenarios/kaggle/proposal/proposal.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,10 @@ def __init__(self, scen: Scenario) -> Tuple[dict, bool]:
9191

9292
def generate_RAG_content(self, trace: Trace, hypothesis_and_feedback: str) -> str:
9393
if self.scen.if_using_vector_rag:
94-
rag_results, _ = self.scen.vector_base.search_experience(hypothesis_and_feedback, topk_k=5)
94+
if self.scen.dsagent:
95+
rag_results, _ = self.scen.dsagent.vector_base.search_experience(hypothesis_and_feedback, topk_k=1)
96+
else:
97+
rag_results, _ = self.scen.vector_base.search_experience(hypothesis_and_feedback, topk_k=5)
9598
return "\n".join([doc.content for doc in rag_results])
9699
if self.scen.if_using_graph_rag is False or trace.knowledge_base is None:
97100
return None

0 commit comments

Comments
 (0)