Skip to content

docs: use bare decorators, docstrings, and model refs in README - #132

Merged
huangjeff5 merged 1 commit into
mainfrom
docs/readme-idioms
Nov 17, 2026
Merged

huangjeff5 merged 1 commit into
mainfrom
docs/readme-idioms

Conversation

@huangjeff5

Copy link
Copy Markdown
Collaborator

Updates the quick start examples in README.md to use bare @ai.tool, docstring descriptions, and GoogleAI.gemini(...) model refs.

# --- BEFORE ---
@ai.tool(description="Get current weather for a location")
async def get_weather(input: WeatherInput) -> str:
    return f"Sunny, 72°F in {input.city}"

stream = ai.generate_stream(
    model="googleai/gemini-flash-latest",
    ...
)

# --- AFTER ---
@ai.tool
async def get_weather(input: WeatherInput) -> str:
    """Get current weather for a location."""
    return f"Sunny, 72°F in {input.city}"

stream = ai.generate_stream(
    model=GoogleAI.gemini("gemini-flash-latest"),
    ...
)

Main Changes

  • Bare @ai.tool with docstring descriptions: Uses @ai.tool and moves the tool description into the function docstring instead of passing description=....
  • Typed model refs: Uses GoogleAI.gemini("gemini-flash-latest") instead of "googleai/gemini-flash-latest" across all four quick start examples.

Supersedes genkit-ai/genkit#7204 (Python docs and releases now live in this repo). Docsite counterpart: genkit-ai/docsite#380.

@cabljac cabljac 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.

LGTM

@huangjeff5
huangjeff5 merged commit 87bcfd9 into main Nov 17, 2026
20 checks passed
@huangjeff5
huangjeff5 deleted the docs/readme-idioms branch November 17, 2026 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants