mirror of
https://github.com/f/awesome-chatgpt-prompts.git
synced 2026-02-12 15:52:47 +00:00
Add support for JSON prompts alongside TEXT prompt type
- Add 'type' column to prompts.csv to distinguish JSON vs TEXT prompts - Update script.js to render JSON prompts with syntax highlighting - Add JSON type badge to prompt cards - Update showModal to handle JSON prompts properly - Add CSS styles for JSON syntax highlighting and type badges - Add 3 JSON prompt examples (API Response Generator, Code Review Assistant, Data Transformer) - Update CSV linter workflow to validate the new 'type' column - Update README.md with JSON prompt examples using code blocks Co-Authored-By: Fatih Kadir Akın <fatihkadirakin@gmail.com>
This commit is contained in:
17
.github/workflows/csv_linter.yml
vendored
17
.github/workflows/csv_linter.yml
vendored
@@ -37,16 +37,21 @@ jobs:
|
||||
with open("prompts.csv", "r", encoding="utf-8") as f:
|
||||
reader = csv.reader(f)
|
||||
headers = next(reader)
|
||||
if headers != ["act", "prompt", "for_devs"]:
|
||||
print("Error: CSV headers must be exactly [act, prompt, for_devs]")
|
||||
if headers != ["act", "prompt", "for_devs", "type"]:
|
||||
print("Error: CSV headers must be exactly [act, prompt, for_devs, type]")
|
||||
exit(1)
|
||||
for row_num, row in enumerate(reader, 3):
|
||||
if len(row) != 3:
|
||||
print(f"Error: Row {row_num} has {len(row)} columns, expected 2")
|
||||
valid_types = ["TEXT", "JSON"]
|
||||
for row_num, row in enumerate(reader, 2):
|
||||
if len(row) != 4:
|
||||
print(f"Error: Row {row_num} has {len(row)} columns, expected 4")
|
||||
exit(1)
|
||||
if not row[0] or not row[1] or not row[2]:
|
||||
if not row[0] or not row[1] or not row[2] or not row[3]:
|
||||
print(f"Error: Row {row_num} has empty values")
|
||||
exit(1)
|
||||
if row[3] not in valid_types:
|
||||
print(f"Error: Row {row_num} has invalid type \"{row[3]}\". Must be TEXT or JSON")
|
||||
exit(1)
|
||||
print("CSV format OK")
|
||||
'; then
|
||||
echo "::error::CSV format check failed"
|
||||
exit 1
|
||||
|
||||
Reference in New Issue
Block a user