mirror of
https://github.com/NicolasBohn/NexQuant.git
synced 2026-08-06 03:27:44 +00:00
fix: target json type & round (#662)
* refactor: Rename direct_exp_gen to json_target_type in DSExpGen class * fix type * fix: Adjust loop iterations and update json_target_type for nested dicts
This commit is contained in:
@@ -378,7 +378,7 @@ class APIBackend(ABC):
|
||||
|
||||
all_response = ""
|
||||
new_messages = deepcopy(messages)
|
||||
for _ in range(3):
|
||||
for _ in range(6): # for some long code, 3 times may not enough for reasoning models
|
||||
if "json_mode" in kwargs:
|
||||
del kwargs["json_mode"]
|
||||
response, finish_reason = self._create_chat_completion_add_json_in_prompt(
|
||||
|
||||
@@ -420,7 +420,10 @@ class DSExpGen(ExpGen):
|
||||
user_prompt=user_prompt,
|
||||
system_prompt=system_prompt,
|
||||
json_mode=True,
|
||||
json_target_type=dict[str, dict[str, str] | str], # workflow_update may be a string
|
||||
# NOTE: corner cases.
|
||||
# workflow_update may be a string
|
||||
# model could have 2 level nested dict.
|
||||
json_target_type=dict[str, dict[str, str | dict] | str],
|
||||
)
|
||||
)
|
||||
assert "hypothesis_proposal" in resp_dict, "Hypothesis proposal not provided."
|
||||
|
||||
Reference in New Issue
Block a user