Sigil Python Provider Helper: OpenAI
sigil-sdk-openai exposes strict OpenAI-shaped wrappers and mappers for both Chat Completions and Responses.
Installation
pip install sigil-sdk sigil-sdk-openai
Public API
-
Chat Completions namespace:
chat.completions.create(...)chat.completions.create_async(...)chat.completions.stream(...)chat.completions.stream_async(...)chat.completions.from_request_response(...)chat.completions.from_stream(...)
-
Responses namespace:
responses.create(...)responses.create_async(...)responses.stream(...)responses.stream_async(...)responses.from_request_response(...)responses.from_stream(...)
-
Embeddings namespace:
embeddings.create(...)embeddings.create_async(...)embeddings.from_request_response(...)
Integration styles
- Strict wrappers: call OpenAI and record in one step.
- Manual instrumentation: call OpenAI directly, then map strict OpenAI request/response payloads with
from_request_responseorfrom_stream.
Responses-first wrapper example
from openai import OpenAI
from sigil_sdk import Client, ClientConfig
from sigil_sdk_openai import OpenAIOptions, responses
sigil = Client(ClientConfig())
provider = OpenAI()
response = responses.create(
sigil,
{
"model": "gpt-5",
"instructions": "Be concise",
"input": "Summarize rollout status in 3 bullets",
"max_output_tokens": 300,
},
lambda request: provider.responses.create(**request),
OpenAIOptions(conversation_id="conv-1", agent_name="assistant", agent_version="1.0.0"),
)
Chat Completions stream example
from sigil_sdk_openai import ChatCompletionsStreamSummary, chat
summary = chat.completions.stream(
sigil,
{
"model": "gpt-5",
"stream": True,
"messages": [{"role": "user", "content": "Stream a short status update"}],
},
lambda request: ChatCompletionsStreamSummary(events=[]),
)
Embeddings example
from sigil_sdk_openai import embeddings
embedding_response = embeddings.create(
sigil,
{
"model": "text-embedding-3-small",
"input": ["hello", "world"],
},
lambda request: provider.embeddings.create(**request),
)
Manual instrumentation example (strict mapper)
from sigil_sdk import GenerationStart, ModelRef
from sigil_sdk_openai import OpenAIOptions, responses
request = {
"model": "gpt-5",
"instructions": "Be concise",
"input": "Summarize rollout status in 3 bullets",
}
opts = OpenAIOptions(
conversation_id="conv-1",
agent_name="assistant",
agent_version="1.0.0",
)
with sigil.start_generation(
GenerationStart(
conversation_id=opts.conversation_id,
agent_name=opts.agent_name,
agent_version=opts.agent_version,
model=ModelRef(provider=opts.provider_name, name=request["model"]),
)
) as rec:
try:
response = provider.responses.create(**request)
rec.set_result(responses.from_request_response(request, response, opts))
except Exception as exc:
rec.set_call_error(exc)
raise
Raw artifacts (debug opt-in)
Raw artifacts are off by default.
Enable with:
OpenAIOptions(raw_artifacts=True)
Artifact names:
- Chat:
openai.chat.request,openai.chat.response,openai.chat.tools,openai.chat.stream_events - Responses:
openai.responses.request,openai.responses.response,openai.responses.tools,openai.responses.stream_events
Call client.shutdown() during teardown to flush buffered telemetry.
Metadata
Release files for sigil-sdk-openai 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_openai-0.9.3.tar.gz | 14.1 kB | With provenance | Details for sigil_sdk_openai-0.9.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| sigil_sdk_openai-0.9.3-py3-none-any.whl | Python 3 | none | any | Details for sigil_sdk_openai-0.9.3-py3-none-any.whl |
Total release size: 24.3 kB
Release files / sigil_sdk_openai-0.9.3.tar.gz
| Download URL | sigil_sdk_openai-0.9.3.tar.gz |
|---|---|
| Size | 14.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2bdf6098e6f5ac8698571fa9793d461f0b0d38b0c533ba767939aad6e7523832
|
|
BLAKE2b-256 checksum How to use checksums |
33d52a911c4fc7fedfb20fc00ac12cd5238d85efdbcb8860bca6ed7cd7f83d3e
|
| 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_openai-0.9.3-py3-none-any.whl
| Download URL | sigil_sdk_openai-0.9.3-py3-none-any.whl |
|---|---|
| Size | 10.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f02809b9135054539e8d061f7cea565a1f395e25a41b69a16aefbbe6cced9563
|
|
BLAKE2b-256 checksum How to use checksums |
9dbf7d773f14385fcb772ff75c8a3fbcc83bc3ec1a22da9f53813565866d2dd1
|
| 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-openai 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_openai-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.