diff --git a/.gitignore b/.gitignore index 38ad6b9..4c00f76 100644 --- a/.gitignore +++ b/.gitignore @@ -60,3 +60,7 @@ Test-Magazin/ # local todo list TODO.md + +# local experiments; two files here once held key-like literals +scratch/test_openai.py +scratch/test_google_imagen.py diff --git a/scratch/test_google_imagen.py b/scratch/test_google_imagen.py deleted file mode 100644 index cbfbe66..0000000 --- a/scratch/test_google_imagen.py +++ /dev/null @@ -1,20 +0,0 @@ -import requests -import json -import base64 - -API_KEY = "AIzaSyD6aidNxIhr2SKgauZ9zea_FynuCo2DyDo" -url = f"https://generativelanguage.googleapis.com/v1beta/interactions" - -payload = { - "model": "gemini-3.1-flash-image", - "input": [{"type": "user_input", "content": [{"type": "text", "text": "A beautiful square headshot portrait of Karyla. Style: painterly game concept art."}]}], - "response_modalities": ["image"] -} -headers = {'x-goog-api-key': API_KEY, 'Content-Type': 'application/json'} - -response = requests.post(url, headers=headers, json=payload) -print(response.status_code) -if response.ok: - print("Success! Got image") -else: - print(response.text[:500]) diff --git a/scratch/test_openai.py b/scratch/test_openai.py deleted file mode 100644 index 103f51d..0000000 --- a/scratch/test_openai.py +++ /dev/null @@ -1,24 +0,0 @@ -import requests -import json - -API_KEY = "sk-proj-jVzNl_bM-oRpR_W1F-W5bLwXQ4e38nS3pQf4eY6k2M6tX-TZA9YmH4lF" # From settings.json wait, I don't know the full key. I'll read it from settings.json -with open("config/settings.json") as f: - settings = json.load(f) - api_key = settings.get("engine_api_keys", {}).get("openai_image") - -url = "https://api.openai.com/v1/images/generations" - -payload = { - "model": "dall-e-3", - "prompt": "A beautiful square headshot portrait of Karyla. Style: painterly game concept art.", - "n": 1, - "size": "1024x1024" -} -headers = {'Authorization': f'Bearer {api_key}', 'Content-Type': 'application/json'} - -response = requests.post(url, headers=headers, json=payload) -print(response.status_code) -if response.ok: - print("Success! OpenAI generated image.") -else: - print(response.text[:500])