Skip to content

feat(py)!: stop exporting bedrock_name, anthropic_name, ollama_name - #6662

Merged
huangjeff5 merged 3 commits into
mainfrom
chore/py-unexport-name-helpers
Oct 10, 2026
Merged

huangjeff5 merged 3 commits into
mainfrom
chore/py-unexport-name-helpers

Conversation

@huangjeff5

@huangjeff5 huangjeff5 commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Three plugins exported a helper that only prefixes a model id with the plugin name. Nothing outside each plugin's own tests imports them. googleai_name, vertexai_name, and open_ai_name are already private, and #6500 drops model_garden_name. This brings the rest in line.

Main Changes

  • genkit_amazon_bedrock no longer exports bedrock_name.
  • genkit_anthropic no longer exports anthropic_name.
  • genkit_ollama no longer exports ollama_name.
  • Bedrock and Ollama tests assert the literal bedrock/ / ollama/ names instead of importing the helpers, so refactor(py)!: plugin packages expose only their top-level module #6671 only has to resolve import lines.

Decisions

  • Write the model string directly: from genkit_anthropic import anthropic_name now raises ImportError; pass model='anthropic/claude-sonnet-4' instead. This only removes the package-root export. genkit_amazon_bedrock.plugin and genkit_ollama.plugin_api stay importable until refactor(py)!: plugin packages expose only their top-level module #6671 makes them private. We chose removal over deprecation because the helper is one f-string and no docs or samples use it.
  • Helpers stay in place: The plugins still call them to build action names, so only the package __all__ changes.
# 1. Before
from genkit_anthropic import anthropic_name
response = await ai.generate(model=anthropic_name('claude-sonnet-4'), prompt='Suggest a dish.')

# 2. After
response = await ai.generate(model='anthropic/claude-sonnet-4', prompt='Suggest a dish.')

Verification

  • bedrock, anthropic, ollama tests: 889 passed, 31 skipped.
  • ruff check --preview, ty check clean on the three packages.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request removes internal plugin name constants (bedrock_name, anthropic_name, and ollama_name) from the public exports of the genkit-amazon-bedrock, genkit-anthropic, and genkit-ollama packages. The corresponding test files have been updated to import these constants directly from their internal plugin modules instead of the package root. I have no feedback to provide as there are no review comments.

@huangjeff5
huangjeff5 enabled auto-merge (squash) October 10, 2026 00:10
@huangjeff5
huangjeff5 merged commit 67b1758 into main Oct 10, 2026
26 checks passed
@huangjeff5
huangjeff5 deleted the chore/py-unexport-name-helpers branch October 10, 2026 00:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants