Skip to content

Add Google GenAI plugin samples#319

Open
brianstrauch wants to merge 3 commits into
mainfrom
google-genai-plugin-samples
Open

Add Google GenAI plugin samples#319
brianstrauch wants to merge 3 commits into
mainfrom
google-genai-plugin-samples

Conversation

@brianstrauch

Copy link
Copy Markdown
Member

Adds a google_genai_plugin/ sample suite for temporalio.contrib.google_genai, mirroring the strands_plugin/ layout (one feature per sub-directory, each with workflow.py / run_worker.py / run_workflow.py / README.md).

Samples

Sample Feature Automated test
hello_world generate_content
tools automatic function calling (activity_as_tool + plain workflow-method tool)
streaming generate_content_stream + streaming_topic/WorkflowStream
chat multi-turn client.chats
structured_output response_schema + Pydantic
mcp TemporalMcpClientSession with a local echo MCP server
files client.files.upload runnable-only (live API)
interactions client.interactions stateful API runnable-only (live API)
agents client.agents CRUD runnable-only (live API)
vertex_ai vertexai=True configuration runnable-only (GCP creds)

Tests

tests/google_genai_plugin/ uses the plugin's GeminiTestServer to run the model-layer samples offline (no API key); the mcp test additionally registers a real echo MCP server. The files/interactions/agents/vertex_ai samples talk to backends GeminiTestServer does not mock, so they are runnable-only and documented as requiring live credentials.

Registration

  • pyproject.toml: google-genai dependency group (temporalio[google-genai,pydantic] + mcp) and wheel package
  • root README.md sample listing
  • .github/CODEOWNERS

Verification

  • uv run pytest tests/google_genai_plugin/ → 6 passed
  • mypy --check-untyped-defs --namespace-packages → no issues
  • ruff format --check + ruff check --select I → clean
  • all 10 sample modules import cleanly

Note: the google-genai extra is not yet in a released temporalio; until then install the SDK from source: uv pip install -e "../sdk-python[google-genai,pydantic]".

🤖 Generated with Claude Code

Add a google_genai_plugin/ sample suite for temporalio.contrib.google_genai,
mirroring the strands_plugin/ layout (one feature per sub-directory, each with
workflow.py / run_worker.py / run_workflow.py / README.md).

Samples cover every major plugin feature:
- hello_world: generate_content
- tools: automatic function calling (activity_as_tool + plain workflow-method tool)
- streaming: generate_content_stream + streaming_topic/WorkflowStream
- chat: multi-turn client.chats
- structured_output: response_schema + Pydantic
- mcp: TemporalMcpClientSession with a local echo MCP server
- files: client.files.upload (live API)
- interactions: client.interactions stateful API (live API)
- agents: client.agents CRUD (live API)
- vertex_ai: vertexai=True configuration (GCP credentials)

Tests under tests/google_genai_plugin/ use the plugin's GeminiTestServer to run
the model-layer samples offline; the mcp test additionally registers a real
echo MCP server. files/interactions/agents/vertex_ai are runnable-only (require
live credentials) and documented as such.

Register the suite in pyproject.toml (google-genai dependency group + wheel
package), the root README, and CODEOWNERS.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@brianstrauch brianstrauch requested review from a team as code owners June 18, 2026 18:45
brianstrauch and others added 2 commits June 18, 2026 12:07
Wrap the workflow.py, run_worker.py, and run_workflow.py bodies of each
sample in @@@SNIPSTART/@@@SNIPEND markers (python-google-genai-<sample>-<part>)
so the code can be embedded in docs, matching the strands_plugin convention.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Resolve conflicts in .github/CODEOWNERS, README.md, and pyproject.toml by
keeping both the google-genai-plugin and incoming AI SDK sample entries in
alphabetical order, and regenerate uv.lock.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant