diff --git a/upload_to_markprompt b/upload_to_markprompt deleted file mode 100755 index 73de7ad..0000000 --- a/upload_to_markprompt +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env python3 -import json -import os -import urllib.request -from pathlib import Path -from typing import Dict - - -def upload_files(file_dict: Dict[str, str]) -> str: - data = json.dumps(file_dict).encode() - - url = "https://api.markprompt.com/train" - headers = { - "Authorization": f'Bearer {os.getenv("MARKPROMPT_API_KEY", "")}', - "Content-Type": "application/json", - } - req = urllib.request.Request(url, data=data, headers=headers, method="POST") - response = urllib.request.urlopen(req) - result = response.read() - return result.decode("utf-8") - - -files = {} -for file in Path(".").glob("**/*.md"): - with file.open() as f: - files[str(file)] = f.read() - -print(upload_files(files))