From 6ea5cc8f3841cd81a0f7b24ec4992cd55239c8fe Mon Sep 17 00:00:00 2001 From: Bryan Helmkamp Date: Sat, 7 Mar 2026 23:36:32 -0500 Subject: [PATCH] Add API-backend imagegen test workflow for sandbox.env e2e testing Co-Authored-By: Claude Opus 4.6 --- tmp/imagegen-api.dot | 11 +++++++++++ tmp/imagegen-api.toml | 9 +++++++++ 2 files changed, 20 insertions(+) create mode 100644 tmp/imagegen-api.dot create mode 100644 tmp/imagegen-api.toml 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}"