Gemini helper wrappers for Sigil Python SDK
Project description
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
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sigil_sdk_gemini-0.2.0.tar.gz.
File metadata
- Download URL: sigil_sdk_gemini-0.2.0.tar.gz
- Upload date:
- Size: 11.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9858719a5a29fe1a054851d53ab2e7af6502e78c4ba1c9e1c837d75fb7b03dde
|
|
| MD5 |
0d8da7fc2567ec984f744b3698cafadb
|
|
| BLAKE2b-256 |
f7c6d384a96edaa872319f78500f98c653b41d21a9ebf231ce70697feb794bd3
|
Provenance
The following attestation bundles were made for sigil_sdk_gemini-0.2.0.tar.gz:
Publisher:
python-sdks-publish.yml on grafana/sigil-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sigil_sdk_gemini-0.2.0.tar.gz -
Subject digest:
9858719a5a29fe1a054851d53ab2e7af6502e78c4ba1c9e1c837d75fb7b03dde - Sigstore transparency entry: 1417606980
- Sigstore integration time:
-
Permalink:
grafana/sigil-sdk@3cfc596f2d3ca631ce9fa8fe3107d71c17caf924 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/grafana
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-sdks-publish.yml@3cfc596f2d3ca631ce9fa8fe3107d71c17caf924 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file sigil_sdk_gemini-0.2.0-py3-none-any.whl.
File metadata
- Download URL: sigil_sdk_gemini-0.2.0-py3-none-any.whl
- Upload date:
- Size: 8.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ec2ac329ad3c85bfc332a06f9528d85a042cafcb24079407614169f18b6800ff
|
|
| MD5 |
efd19c832142b38574b5ae1e95375b4d
|
|
| BLAKE2b-256 |
697312cf28fc854e4fcc2c39920a82b3d9006fdd5acf52fed4d460ba8ed5a58c
|
Provenance
The following attestation bundles were made for sigil_sdk_gemini-0.2.0-py3-none-any.whl:
Publisher:
python-sdks-publish.yml on grafana/sigil-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sigil_sdk_gemini-0.2.0-py3-none-any.whl -
Subject digest:
ec2ac329ad3c85bfc332a06f9528d85a042cafcb24079407614169f18b6800ff - Sigstore transparency entry: 1417607043
- Sigstore integration time:
-
Permalink:
grafana/sigil-sdk@3cfc596f2d3ca631ce9fa8fe3107d71c17caf924 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/grafana
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-sdks-publish.yml@3cfc596f2d3ca631ce9fa8fe3107d71c17caf924 -
Trigger Event:
workflow_dispatch
-
Statement type: