MCPcopy Create free account
hub / github.com/OpenCodeInterpreter/OpenCodeInterpreter / save_json

Function save_json

demo/chatbot.py:81–85  ·  view source on GitHub ↗
(dialog, mode, json_file_path, dialog_id)

Source from the content-addressed store, hash-verified

79 return ""
80
81def save_json(dialog, mode, json_file_path, dialog_id) -> None:
82 with scheduler.lock:
83 with json_file_path.open("a") as f:
84 json.dump({"id": dialog_id, "dialog": dialog, "mode": mode, "datetime": datetime.now().isoformat()}, f, ensure_ascii=False)
85 f.write("\n")
86
87def convert_history(gradio_history: list[list], interpreter_history: list[dict]):
88 interpreter_history = [interpreter_history[0]] if interpreter_history and interpreter_history[0]["role"] == "system" else []

Callers 1

botFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected