Skip to content

Commit e2f537a

Browse files
committed
add response format class
1 parent 1eacbad commit e2f537a

File tree

1 file changed

+8
-1
lines changed
  • rdagent/scenarios/data_science/proposal/exp_gen

1 file changed

+8
-1
lines changed

rdagent/scenarios/data_science/proposal/exp_gen/proposal.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,13 @@ class HypothesisDetail(BaseModel):
247247
evaluation: HypothesisEvaluation = Field(description="Evaluate the quality of the hypothesis.")
248248

249249

250+
class HypothesisSimple(BaseModel):
251+
hypothesis: str = Field(
252+
description="The statement of the hypothesis. It could be a design of a new component, or a concise, testable statement derived from previous experimental outcomes."
253+
)
254+
component: HypothesisComponent = Field(description="The component tag of the hypothesis.")
255+
256+
250257
class HypothesisList(BaseModel):
251258
deduplicated_challenges: List[str] = Field(
252259
description="A list of deduplicated challenge captions. Each must retain its original wording. If multiple captions are semantically identical, keep the first one."
@@ -755,7 +762,7 @@ def hypothesis_select_with_llm(
755762
response = APIBackend().build_messages_and_create_chat_completion(
756763
user_prompt=user_prompt,
757764
system_prompt=sys_prompt,
758-
response_format=HypothesisList if self.supports_response_schema else {"type": "json_object"},
765+
response_format=HypothesisSimple if self.supports_response_schema else {"type": "json_object"},
759766
json_target_type=(
760767
Dict[str, Dict[str, str | Dict[str, str | int]]] if not self.supports_response_schema else None
761768
),

0 commit comments

Comments
 (0)