Sigil Python Provider Helper: Gemini
sigil-sdk-gemini provides strict Gemini Models wrappers and mappers for Sigil.
Installation
pip install sigil-sdk sigil-sdk-gemini google-genai
Public API
- Wrappers:
models.generate_content(...)models.generate_content_async(...)models.generate_content_stream(...)models.generate_content_stream_async(...)models.embed_content(...)models.embed_content_async(...)
- Mappers:
models.from_request_response(...)models.from_stream(...)models.embedding_from_response(...)
Wrapper Mode (Sync)
from google.genai import types as genai_types
from sigil_sdk import Client, ClientConfig
from sigil_sdk_gemini import GeminiOptions, models
client = Client(ClientConfig())
model = "gemini-2.5-pro"
contents = [genai_types.Content(role="user", parts=[genai_types.Part(text="Hello")])]
config = genai_types.GenerateContentConfig(max_output_tokens=256)
response = models.generate_content(
client,
model,
contents,
config,
lambda req_model, req_contents, req_config: gemini_client.models.generate_content(
model=req_model,
contents=req_contents,
config=req_config,
),
GeminiOptions(conversation_id="conv-1", agent_name="assistant", agent_version="1.0.0"),
)
Wrapper Mode (Stream)
from sigil_sdk_gemini import GeminiStreamSummary, models
summary = models.generate_content_stream(
client,
model,
contents,
config,
lambda req_model, req_contents, req_config: GeminiStreamSummary(
responses=list(gemini_client.models.generate_content_stream(
model=req_model,
contents=req_contents,
config=req_config,
))
),
)
Mapper Mode
generation = models.from_request_response(model, contents, config, response)
stream_generation = models.from_stream(model, contents, config, summary)
Embedding example
embedding_response = models.embed_content(
client,
"gemini-embedding-001",
contents,
None,
lambda req_model, req_contents, req_config: gemini_client.models.embed_content(
model=req_model,
contents=req_contents,
config=req_config,
),
)
Raw Provider Artifacts (Opt-In)
options = GeminiOptions(raw_artifacts=True)
Raw artifacts are default OFF and should only be enabled for diagnostics.
Provider metadata mapping
Gemini-specific fields are mapped as follows:
usage.thoughts_token_count-> normalizedusage.reasoning_tokensusage.tool_use_prompt_token_count-> metadatasigil.gen_ai.usage.tool_use_prompt_tokensconfig.thinking_config.thinking_budget-> metadatasigil.gen_ai.request.thinking.budget_tokensconfig.thinking_config.thinking_level-> metadatasigil.gen_ai.request.thinking.level
Metadata
Release files for sigil-sdk-gemini 0.9.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| sigil_sdk_gemini-0.9.3.tar.gz | 11.2 kB | With provenance | Details for sigil_sdk_gemini-0.9.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| sigil_sdk_gemini-0.9.3-py3-none-any.whl | Python 3 | none | any | Details for sigil_sdk_gemini-0.9.3-py3-none-any.whl |
Total release size: 19.7 kB
Release files / sigil_sdk_gemini-0.9.3.tar.gz
| Download URL | sigil_sdk_gemini-0.9.3.tar.gz |
|---|---|
| Size | 11.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cf717d544417b0a3a26ff46e39426232997788fd7bee636959cb9d72992c5f56
|
|
BLAKE2b-256 checksum How to use checksums |
dddfa6aa8ed23752295a603162e7240188af4b5bb5996ee20c2fb250043227ae
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 13, 2026.
Transparency logRelease files / sigil_sdk_gemini-0.9.3-py3-none-any.whl
| Download URL | sigil_sdk_gemini-0.9.3-py3-none-any.whl |
|---|---|
| Size | 8.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
944596be638f3ff76feae44bb24d6dbb471e3a0cba3e34352d5f23e3410969ed
|
|
BLAKE2b-256 checksum How to use checksums |
ee95d4ca2642515626cec284b7cb7f0f97e67197ded457eea9bab2f790cf9f31
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 13, 2026.
Transparency logSecurity for sigil-sdk-gemini 0.9.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for sigil_sdk_gemini-0.9.3.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 13, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.