
Ausgabe von ChatGPT Text im JSON und CSV Format
06.04.2023 - Sebastian Pech - ~1 Minute
Mit der Angabe eines Formats können die Ausgaben von ChatGPT-4 im JSON oder CSV Format ausgegeben werden. Test auf OpenAI Playground .
JSON
USER
Classify the following items as fruit or vegetable: apple, banana, cucumber.
Output the data as JSON in the format [{"name": "Apple", "type": "Fruit/Vegetable"}]
ASSISTANT
[{"name": "Apple", "type": "Fruit"}, {"name": "Banana", "type": "Fruit"}, {"name": "Cucumber", "type": "Vegetable"}]
CSV
USER
Classify the following items as fruit or vegetable: apple, banana, cucumber. Output the data as CSV in the format "name", "type"
ASSISTANT
"apple", "fruit"
"banana", "fruit"
"cucumber", "vegetable"
Gist: GitHub .