Files
windmill/frontend/src/lib/components/copilot/prompts/yaml2json.py
T
HugoCasa 59e27a98f4 feat: ai gen support all langs (#2276)
* feat: ai gen support all langs

* fix: improve db schema explorer

* fix: frontend check
2023-09-15 16:41:10 +02:00

17 lines
678 B
Python

import yaml, json
with open("gen.yaml", "r") as f:
promptConfig = json.dumps(yaml.load(f, Loader=yaml.CLoader), indent=2)
with open("genPrompt.ts", "w") as f2:
f2.write("export const GEN_PROMPT = " + promptConfig + ";")
with open("edit.yaml", "r") as f:
promptConfig = json.dumps(yaml.load(f, Loader=yaml.CLoader), indent=2)
with open("editPrompt.ts", "w") as f2:
f2.write("export const EDIT_PROMPT = " + promptConfig + ";")
with open("fix.yaml", "r") as f:
promptConfig = json.dumps(yaml.load(f, Loader=yaml.CLoader), indent=2)
with open("fixPrompt.ts", "w") as f2:
f2.write("export const FIX_PROMPT = " + promptConfig + ";")