diff --git a/tmp/imagegen-api.dot b/tmp/imagegen-api.dot new file mode 100644 index 000000000..0f1da47be --- /dev/null +++ b/tmp/imagegen-api.dot @@ -0,0 +1,11 @@ +digraph ImageGen { + graph [goal="A cute robot painting a landscape"] + rankdir=LR + + 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"] + + start -> generate -> exit +} diff --git a/tmp/imagegen-api.toml b/tmp/imagegen-api.toml new file mode 100644 index 000000000..ca0f14c30 --- /dev/null +++ b/tmp/imagegen-api.toml @@ -0,0 +1,9 @@ +version = 1 +goal = "A cute robot painting a landscape" +graph = "imagegen-api.dot" + +[sandbox] +provider = "daytona" + +[sandbox.env] +GEMINI_API_KEY = "${env.GEMINI_API_KEY}"