Skip to content
This repository was archived by the owner on Mar 15, 2026. It is now read-only.

Remove Gemini API key param, use env var - #27

Merged
bokelley merged 6 commits into
mainfrom
bokelley/fix-build-param
Oct 20, 2025
Merged

Remove Gemini API key param, use env var#27
bokelley merged 6 commits into
mainfrom
bokelley/fix-build-param

Conversation

@bokelley

Copy link
Copy Markdown
Contributor

Background

The gemini_api_key parameter was not compliant with the ADCP spec. API keys should be managed via environment variables for creative agents.

Changes

  • src/creative_agent/schemas/build.py: Removed gemini_api_key from BuildCreativeRequest schema.
  • src/creative_agent/server.py: Removed gemini_api_key parameter from build_creative function. The function now reads the Gemini API key from the GEMINI_API_KEY environment variable. Added a more informative error message if the environment variable is not set.

Testing

  • Call build_creative without GEMINI_API_KEY set, verify error message.
  • Call build_creative with GEMINI_API_KEY environment variable set, verify successful execution.
  • Verify the target_format_id parameter is still correctly handled.

bokelley and others added 6 commits October 20, 2025 11:21
Changed parameter from target_format_id to format_id to match the
BuildCreativeRequest schema and MCP client expectations.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Changed format_id to target_format_id to match the official ADCP
spec (/schemas/v1/media-buy/build-creative-request.json).

Note: This reveals that the MCP client (Conductor) is sending
format_id instead of target_format_id, which is a client-side bug.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Added backward compatibility for MCP clients (like Conductor) that
incorrectly use 'format_id' instead of 'target_format_id'.

The ADCP spec defines 'target_format_id', but some clients use
'format_id'. Now we accept both parameters with clear error messages
if neither is provided.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Removed gemini_api_key parameter from build_creative tool signature
and moved it to GEMINI_API_KEY environment variable. This makes the
tool fully ADCP spec-compliant.

Per ADCP spec, creative agents should manage their own credentials
rather than requiring clients to provide API keys as parameters.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@bokelley
bokelley merged commit 9643011 into main Oct 20, 2025
3 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant