Skip to content

docs: update Gemini snippets to google-genai#92

Open
kunal-9090 wants to merge 4 commits into
ARPAHLS:mainfrom
kunal-9090:codex/issue-88-google-genai-docs
Open

docs: update Gemini snippets to google-genai#92
kunal-9090 wants to merge 4 commits into
ARPAHLS:mainfrom
kunal-9090:codex/issue-88-google-genai-docs

Conversation

@kunal-9090
Copy link
Copy Markdown

Summary

  • replace deprecated google-generativeai import references with google-genai docs wording
  • update README, Gemini usage guide, and skill docs to use google.genai imports and Client setup
  • leave framework and skill Python code unchanged, per issue scope

Closes #88

Checks

  • git diff --check
  • rg google-generativeai|google.generativeai|genai.configure|GenerativeModel README.md docs returned no matches

@rosspeili
Copy link
Copy Markdown
Contributor

Hi @kunal-9090, thanks for picking up #88 and for getting the import swap direction right, google.genai and genai.Client() are exactly the correct patterns for the new SDK. Good catch.

That said, this can't merge in its current state. The problem is that the code examples went from complete (but old API) to incomplete (new API). In every skill doc, the model invocation was replaced with a comment stub like:

# Pass SkillLoader.to_gemini_tool(bundle) in GenerateContentConfig.tools when calling client.models.generate_content(...)

A comment is not a working example. A contributor following these docs to integrate a skill with Gemini would end up with no tools attached to the model at all. The same applies to README.md, where the generate_content() call there has no config= argument, so tool and system_instruction are assigned but never used.

The fix needed is to complete each example with a real google-genai call, something like:

import google.genai as genai
from google.genai import types

client = genai.Client(api_key=os.environ["GOOGLE_API_KEY"])
response = client.models.generate_content(
    model="gemini-2.5-flash",
    contents="Screen wallet 0xd8dA... for risks.",
    config=types.GenerateContentConfig(
        tools=[SkillLoader.to_gemini_tool(bundle)],
        system_instruction=bundle["instructions"],
    ),
)

This pattern should be consistent across README.md, docs/usage/gemini.md, and all skill pages. Once the examples are complete and runnable, this is a clean merge. Happy to help if you have questions about the new SDK surface.

@kunal-9090
Copy link
Copy Markdown
Author

Thanks for the detailed review. I completed the Gemini examples with real \client.models.generate_content(..., config=types.GenerateContentConfig(...))\ calls across README, usage docs, and skill pages, and tightened the manual loop example in \docs/usage/gemini.md. \python -m compileall skillware skills tests\ passes; full pytest collection is currently blocked locally by missing optional deps: \ollama, \�s4, and \ itz.

@rosspeili
Copy link
Copy Markdown
Contributor

Thanks for iterating on the feedback, the direction is right: google.genai, genai.Client(), and types.GenerateContentConfig(tools=..., system_instruction=...) across README, docs/usage/gemini.md, and the skill pages. Keeping the diff docs-only also matches the issue scope.

Before we merge, we need the examples to be fully runnable end-to-end, consistent with the rest of the repo (docs/usage/agent_loops.md, docs/usage/skill_usage_template.md, and the patterns in examples/). Right now most Gemini blocks stop after skill.execute(...) and never send the tool result back to the model, and README ends on print(response.text) after a single turn — that breaks when the model returns a function call.

Please tighten the following:

  1. Complete the agent loop everywhere — after skill.execute(dict(part.function_call.args)), show the function_response follow-up (as you did in the advanced loop in gemini.md), or a short loop that matches examples/gemini_wallet_check.py.
  2. Update docs/usage/gemini.md §3 — remove stale enable_automatic_function_calling=True prose from the old SDK; align it with google-genai manual/automatic calling.
  3. Keep scope docs-only — no pyproject.toml, requirements.txt, or skill/framework Python changes here ([Feat]: Migrate from google-generativeai to google-genai SDK #80 handles dependency/code migration).
  4. Stay consistent — same client init style (genai.Client() vs explicit api_key=), same model id, and examples that mirror how Skillware expects tool names and execute payloads.
  5. Read CONTRIBUTING.md and Agent Contribution Workflow before the next push — especially scope discipline, verification checklists, and the documentation-only checklist.

Once those are addressed, we’ll review again and merge if everything aligns. Good work so far, you’re close.

@kunal-9090
Copy link
Copy Markdown
Author

Thanks for the follow-up review. I updated the Gemini docs/examples to show the full tool response continuation after local Skillware execution, removed the stale old-SDK automatic function calling wording from docs/usage/gemini.md, kept the follow-up docs-only, and aligned the snippets on genai.Client() with gemini-2.5-flash. Verified with git diff --check and python -m compileall skillware skills tests.

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.

[Doc Fix]: Remove google-generativeai import patterns from introduction.md, README, and usage guides

2 participants