diff --git a/tmp/imagegen-api.dot b/tmp/imagegen-api.dot index 0f1da47be..9216ca1a1 100644 --- a/tmp/imagegen-api.dot +++ b/tmp/imagegen-api.dot @@ -5,7 +5,7 @@ digraph ImageGen { start [shape=Mdiamond, label="Start"] exit [shape=Msquare, label="Exit"] - generate [label="Generate Image", prompt="Generate an image of: $goal\n\nUse the shell tool to call the Gemini image generation API.\nThe GEMINI_API_KEY env var is already set in your environment.\n\nRun this curl command (substituting $$GEMINI_API_KEY from env):\n\ncurl -s --fail-with-body -X POST \"https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash-image:generateContent?key=$$GEMINI_API_KEY\" -H 'Content-Type: application/json' -d '{\"contents\": [{\"parts\": [{\"text\": \"A cute robot painting a landscape\"}]}], \"generationConfig\": {\"responseModalities\": [\"TEXT\", \"IMAGE\"]}}' | jq -r '.candidates[0].content.parts[] | select(.inlineData) | .inlineData.data' | head -1 | base64 -d > generated.png\n\nThen verify the file was created with ls -la generated.png"] + generate [label="Generate Image", prompt="Generate an image of: $goal\n\nUse the shell tool to call the Gemini image generation API.\nThe GEMINI_API_KEY env var is already set in your environment.\n\nSteps:\n1. Use the shell tool to run: echo GEMINI_API_KEY is set: ${#GEMINI_API_KEY} chars\n2. Then run a curl command to POST to https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash-image:generateContent with the API key as query param.\n Pass JSON body with contents/parts/text for the prompt and generationConfig with responseModalities TEXT and IMAGE.\n3. Extract base64 image data from response using jq, decode with base64 -d, save to generated.png\n4. Verify with ls -la generated.png"] start -> generate -> exit }