An experiment to convert data from one format to another using OpenAI and XProc. Here as an example YAML → JSON.
-
Create an assistant on OpenAi platform. (It is also possible via XProc, but easier this way).
Instructions
You are an expert in the field of data conversion in the IT sector. Your task is to convert from YAML format to JSON format. Use for this task the Code Interpreter tool. Use the PyYAML and json package for the conversion. Use the option "ensure_ascii=False" for the json.dump() method. It is very important that no properties in YAML format are lost during this conversion and that the data is transferred to JSON format without any losses. The result is returned in JSON format. DO NOT add a description, explanation or marker in your answer and only output the converted json result. Take your time for this task and follow the instructions carefully step by step.
Model
gpt-3.5-turbo-1106 or gpt-4-1106-preview
Tools
Code interpreter: on
-
Add the API key in the file
lib.xpl
(line 30) and the ID for the created assistant in the filedata-converter.xpl
(line 30) -
Start the pipeline. (I used MorganaXProc-IIIse-1.3)
Please note: This is only an experiment and is not intended for production use.
on Mastodon
One thing did not work: The upload of files using form-data via XProc: Question on stackoverflow
If anyone has an answer to this, please let me know!