update assistant message format

This commit is contained in:
Adil Hafeez 2025-04-15 10:54:41 -07:00
parent cee177e8c4
commit 9b538ff074
No known key found for this signature in database
GPG key ID: 9B18EF7691369645

View file

@ -93,12 +93,16 @@ def chat(
# {
# "response": "<assistant response>",
# }
# and this entire block needs to be encoded in ```json\n{json_encoded_content}\n```
if not history[-1]["model"].startswith("Arch"):
assistant_response = {
"response": history[-1]["content"],
}
history[-1]["content"] = json.dumps(assistant_response)
history[-1]["content"] = "```json\n{}\n```".format(
json.dumps(assistant_response)
)
log.info("history: {}".format(json.dumps(history)))
def main():