Try to make LLM only write one paragraph

This commit is contained in:
Anthony Wang 2024-02-04 01:30:42 -05:00
parent 5896b95994
commit 55b2f6a8a1
Signed by: a
SSH key fingerprint: SHA256:B5ADfMCqd2M7d/jtXDoihAV/yfXOAbWWri9+GdCN4hQ

View file

@ -34,7 +34,7 @@ while c["player"]["health"] > 0 and c["player"][c["win"]["property"]] < c["win"]
prompt += "Player status:\n" + json.dumps(c["player"]) + "\n"
prompt += "NPC statuses:\n" + json.dumps({k: v for k, v in c["npc"].items() if v["location"] == c["player"]["location"]}) + "\n"
prompt += "Player action: " + act + "\n"
prompt += "Please write one single paragraph about what happens due to this action referring to me, the player, in second person. Do not write more than one paragraph. Then, return the player status and NPC statuses updated to reflect changes due to this action. Make sure to meticulously update the states of both the player and the NPCs!"
prompt += "Please write one single paragraph about what happens due to this action referring to me, the player, in second person. Remember, do not write more than one paragraph! Then, return the player status and NPC statuses updated to reflect changes due to this action. Make sure to meticulously update the states of both the player and the NPCs!"
# cprint(prompt, "green")
stream = client.chat.completions.create(messages=[{"role": "user", "content": prompt}], model="", stream=True)
updated = ""