mirror of
https://github.com/csd4ni3l/debt-by-ai.git
synced 2026-01-01 04:23:45 +01:00
Add maximum cap to final debt in offensive mode
This commit is contained in:
2
app.py
2
app.py
@@ -326,7 +326,7 @@ def ai_answer():
|
|||||||
|
|
||||||
base_prompt = OFFENSIVE_ANSWER_PROMPT if scenario_type == "offensive" else DEFENSIVE_ANSWER_PROMPT
|
base_prompt = OFFENSIVE_ANSWER_PROMPT if scenario_type == "offensive" else DEFENSIVE_ANSWER_PROMPT
|
||||||
|
|
||||||
while not re.findall(evaluation_regex, text):
|
while not re.findall(evaluation_regex, text) or int(text.split("Final Debt Amount: ")[1].split("$")[0]) > 1000000:
|
||||||
text = ai_prompt(base_prompt.format_map({"scenario": scenario, "user_input": user_input, "ai_name": AI_NAME, "debt_amount": debt_amount}))
|
text = ai_prompt(base_prompt.format_map({"scenario": scenario, "user_input": user_input, "ai_name": AI_NAME, "debt_amount": debt_amount}))
|
||||||
|
|
||||||
time.sleep(0.5)
|
time.sleep(0.5)
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ Final Debt Amount: [Integer >= Original Debt if Yes, or 0$ if No]
|
|||||||
|
|
||||||
**STRICTLY ONLY REPLY IN THE REPLY FORMAT MENTIONED ABOVE. NO EXCEPTIONS.**
|
**STRICTLY ONLY REPLY IN THE REPLY FORMAT MENTIONED ABOVE. NO EXCEPTIONS.**
|
||||||
For 'Convinced', reply only as **Yes** or **No**.
|
For 'Convinced', reply only as **Yes** or **No**.
|
||||||
For 'Final Debt Amount', reply only as an integer immediately followed by `$`.
|
For 'Final Debt Amount', reply only as an integer immediately followed by `$`. The 'Final Debt Amount' CAN'T EXCEED 1000000$.
|
||||||
* If **Convinced: Yes**, the amount must be **>=** {debt_amount}.
|
* If **Convinced: Yes**, the amount must be **>=** {debt_amount}.
|
||||||
* If **Convinced: No**, the amount **MUST** be **0$**.
|
* If **Convinced: No**, the amount **MUST** be **0$**.
|
||||||
"""
|
"""
|
||||||
|
|||||||
Reference in New Issue
Block a user