fix: debug dsagent (#387)

* basic dsagent & debug

debug dsagent

change dsagent conf

* Refine changes

* Update vector_base.py
This commit is contained in:
cyncyw
2024-09-29 01:15:33 -04:00
committed by GitHub
parent 7b865c3337
commit 5cdffe3510
4 changed files with 7 additions and 8 deletions
+2
View File
@@ -66,5 +66,7 @@ class KaggleBasePropSetting(BasePropSetting):
auto_submit: bool = True
dsagent: bool = False
KAGGLE_IMPLEMENT_SETTING = KaggleBasePropSetting()
@@ -50,7 +50,6 @@ class ModelHypothesisGen(HypothesisGen):
.from_string(ModelHypothesisGen.prompts["hypothesis_gen"]["user_prompt"])
.render(
targets="feature engineering and model building",
hypothesis_and_feedback=context_dict["hypothesis_and_feedback"],
RAG=context_dict["RAG"],
)
)
+1 -6
View File
@@ -12,14 +12,9 @@ hypothesis_gen:
{{ hypothesis_output_format }}
user_prompt: |-
{% if hypothesis_and_feedback|length == 0 %}It is the first round of hypothesis generation. The user has no hypothesis on this scenario yet.
{% else %}It is not the first round, the user has made several hypothesis on this scenario and did several evaluation on them.
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):
{{ hypothesis_and_feedback }}
{% endif %}
{% if RAG %}To help you generate new {{targets}}, we have prepared the following information for you:
{{ RAG }}{% endif %}
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.
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.
hypothesis2experiment:
system_prompt: |-
@@ -91,7 +91,10 @@ class KGHypothesisGen(ModelHypothesisGen):
def generate_RAG_content(self, trace: Trace, hypothesis_and_feedback: str) -> str:
if self.scen.if_using_vector_rag:
rag_results, _ = self.scen.vector_base.search_experience(hypothesis_and_feedback, topk_k=5)
if self.scen.dsagent:
rag_results, _ = self.scen.dsagent.vector_base.search_experience(hypothesis_and_feedback, topk_k=1)
else:
rag_results, _ = self.scen.vector_base.search_experience(hypothesis_and_feedback, topk_k=5)
return "\n".join([doc.content for doc in rag_results])
if self.scen.if_using_graph_rag is False or trace.knowledge_base is None:
return None